pub struct CollectNA<I>(pub I);Expand description
Write an ExactSizeIterator of Option<T> directly into an R vector with NA support.
None values become NA in R. Works for f64 and i32.
§Example
ⓘ
#[miniextendr]
fn with_gaps(n: i32) -> CollectNA<impl ExactSizeIterator<Item = Option<f64>>> {
CollectNA((0..n).map(|i| if i % 3 == 0 { None } else { Some(i as f64) }))
}Tuple Fields§
§0: ITrait Implementations§
Source§impl<I> IntoR for CollectNA<I>
impl<I> IntoR for CollectNA<I>
Source§type Error = Infallible
type Error = Infallible
The error type for fallible conversions. Read more
Source§fn try_into_sexp(self) -> Result<SEXP, Self::Error>
fn try_into_sexp(self) -> Result<SEXP, Self::Error>
Try to convert this value to an R SEXP. Read more
Source§unsafe fn try_into_sexp_unchecked(self) -> Result<SEXP, Self::Error>
unsafe fn try_into_sexp_unchecked(self) -> Result<SEXP, Self::Error>
Try to convert to SEXP without thread safety checks. Read more
Source§unsafe fn into_sexp_unchecked(self) -> SEXP
unsafe fn into_sexp_unchecked(self) -> SEXP
Convert to SEXP without thread safety checks, panicking on error. Read more
Auto Trait Implementations§
impl<I> Freeze for CollectNA<I>where
I: Freeze,
impl<I> RefUnwindSafe for CollectNA<I>where
I: RefUnwindSafe,
impl<I> Send for CollectNA<I>where
I: Send,
impl<I> Sync for CollectNA<I>where
I: Sync,
impl<I> Unpin for CollectNA<I>where
I: Unpin,
impl<I> UnsafeUnpin for CollectNA<I>where
I: UnsafeUnpin,
impl<I> UnwindSafe for CollectNA<I>where
I: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more