#[repr(transparent)]pub struct Altrep<T>(pub T);Tuple Fields§
§0: TImplementations§
Source§impl<T> Altrep<T>
impl<T> Altrep<T>
Sourcepub fn into_inner(self) -> T
pub fn into_inner(self) -> T
Unwrap and return the inner value.
Sourcepub fn into_altrep_sexp(self) -> AltrepSexpwhere
T: RegisterAltrep + TypedExternal,
pub fn into_altrep_sexp(self) -> AltrepSexpwhere
T: RegisterAltrep + TypedExternal,
Convert to R ALTREP and wrap in AltrepSexp (!Send + !Sync).
This creates the ALTREP SEXP and wraps it in an AltrepSexp that
prevents the result from being sent to non-R threads. Use this when
you need to keep the ALTREP vector in Rust code and want compile-time
thread safety guarantees.
For returning directly to R from #[miniextendr] functions, use
Altrep<T> as the return type (which implements IntoR) or call
.into_sexp() / .into_sexp_altrep() instead.
Trait Implementations§
Source§impl<T> IntoR for Altrep<T>where
T: RegisterAltrep + TypedExternal,
Convert Altrep<T> to R using ALTREP representation.
impl<T> IntoR for Altrep<T>where
T: RegisterAltrep + TypedExternal,
Convert Altrep<T> to R using ALTREP representation.
This creates an ALTREP object where the data stays in Rust and is provided to R on-demand through ALTREP callbacks.
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
impl<T: Copy> Copy for Altrep<T>
impl<T: Eq> Eq for Altrep<T>
impl<T> StructuralPartialEq for Altrep<T>
Auto Trait Implementations§
impl<T> Freeze for Altrep<T>where
T: Freeze,
impl<T> RefUnwindSafe for Altrep<T>where
T: RefUnwindSafe,
impl<T> Send for Altrep<T>where
T: Send,
impl<T> Sync for Altrep<T>where
T: Sync,
impl<T> Unpin for Altrep<T>where
T: Unpin,
impl<T> UnsafeUnpin for Altrep<T>where
T: UnsafeUnpin,
impl<T> UnwindSafe for Altrep<T>where
T: 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