pub struct CollectStrings<I>(pub I);Expand description
Write an ExactSizeIterator of String directly into an R character vector.
Strings require per-element CHARSXP allocation (no bulk copy_from_slice),
so this is a separate type from Collect.
§Example
ⓘ
#[miniextendr]
fn upper(words: Vec<String>) -> CollectStrings<impl ExactSizeIterator<Item = String>> {
CollectStrings(words.into_iter().map(|w| w.to_uppercase()))
}Tuple Fields§
§0: ITrait Implementations§
Source§impl<I> IntoR for CollectStrings<I>where
I: ExactSizeIterator<Item = String>,
impl<I> IntoR for CollectStrings<I>where
I: ExactSizeIterator<Item = String>,
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
Auto Trait Implementations§
impl<I> Freeze for CollectStrings<I>where
I: Freeze,
impl<I> RefUnwindSafe for CollectStrings<I>where
I: RefUnwindSafe,
impl<I> Send for CollectStrings<I>where
I: Send,
impl<I> Sync for CollectStrings<I>where
I: Sync,
impl<I> Unpin for CollectStrings<I>where
I: Unpin,
impl<I> UnsafeUnpin for CollectStrings<I>where
I: UnsafeUnpin,
impl<I> UnwindSafe for CollectStrings<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