Skip to main content

Carrier

Struct Carrier 

Source
struct Carrier<T>(PhantomData<T>);
Expand description

The carrier ALTREP class of T: a zero-length raw vector whose Serialized_state encodes the value and whose Unserialize decodes it.

data1 is the owning pointer while the value lives in it, and a holder (Decoded) from Unserialize until the first access attaches the value; data2 is then the state that was read, which a save before the first access writes back unchanged.

Tuple Fields§

§0: PhantomData<T>

Trait Implementations§

Source§

impl<T: TypedExternal> AltVec for Carrier<T>

Source§

const HAS_DATAPTR: bool = true

Set to true to register dataptr.
Source§

const HAS_DATAPTR_OR_NULL: bool = true

Set to true to register dataptr_or_null.
Source§

fn dataptr(_x: SEXP, _writable: bool) -> *mut c_void

Get raw data pointer.
Source§

fn dataptr_or_null(_x: SEXP) -> *const c_void

Get data pointer without forcing materialization.
Source§

const HAS_EXTRACT_SUBSET: bool = false

Set to true to register extract_subset.
Source§

fn extract_subset(_x: SEXP, _indx: SEXP, _call: SEXP) -> SEXP

Optimized subsetting.
Source§

impl<T: TypedExternal> Altrep for Carrier<T>

Source§

const HAS_SERIALIZED_STATE: bool = true

Set to true to register serialized_state.
Source§

const HAS_UNSERIALIZE: bool = true

Set to true to register unserialize.
Source§

fn length(_x: SEXP) -> R_xlen_t

Returns the length of the ALTREP vector. This is REQUIRED - R cannot determine vector length without it.
Source§

fn serialized_state(x: SEXP) -> SEXP

Return serialization state.
Source§

fn unserialize(_class: SEXP, state: SEXP) -> SEXP

Reconstruct ALTREP from serialized state.
Source§

const GUARD: AltrepGuard = AltrepGuard::RUnwind

The guard mode for native reads and inspection on this type. Read more
Source§

const HAS_UNSERIALIZE_EX: bool = false

Set to true to register unserialize_ex.
Source§

fn unserialize_ex( _class: SEXP, _state: SEXP, _attr: SEXP, _objf: i32, _levs: i32, ) -> SEXP

Extended unserialization with attributes.
Source§

const HAS_DUPLICATE: bool = false

Set to true to register duplicate.
Source§

fn duplicate(_x: SEXP, _deep: bool) -> SEXP

Duplicate the ALTREP object.
Source§

const HAS_DUPLICATE_EX: bool = false

Set to true to register duplicate_ex.
Source§

fn duplicate_ex(_x: SEXP, _deep: bool) -> SEXP

Extended duplication.
Source§

const HAS_COERCE: bool = false

Set to true to register coerce.
Source§

fn coerce(_x: SEXP, _to_type: SEXPTYPE) -> SEXP

Coerce to another type.
Source§

const HAS_INSPECT: bool = false

Set to true to register inspect.
Source§

fn inspect( _x: SEXP, _pre: i32, _deep: i32, _pvec: i32, _inspect_subtree: Option<unsafe extern "C-unwind" fn(SEXP, i32, i32, i32)>, ) -> bool

Custom inspection for .Internal(inspect()).

Auto Trait Implementations§

§

impl<T> Forget for Carrier<T>

§

impl<T> Freeze for Carrier<T>
where PhantomData<T>: Freeze,

§

impl<T> RefUnwindSafe for Carrier<T>

§

impl<T> Send for Carrier<T>
where PhantomData<T>: Send,

§

impl<T> Sync for Carrier<T>
where PhantomData<T>: Sync,

§

impl<T> Unpin for Carrier<T>
where PhantomData<T>: Unpin,

§

impl<T> UnsafeUnpin for Carrier<T>

§

impl<T> UnwindSafe for Carrier<T>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> SizeHint for T
where T: ?Sized,

Source§

default fn lower_bound(&self) -> usize

🔬This is a nightly-only experimental API. (core_io_internals)
Returns a lower bound on the number of elements this container-like item contains. For example, an array [u8; 12] could return any value between 0 and 12 inclusively as a correct implementation. Read more
Source§

default fn upper_bound(&self) -> Option<usize>

🔬This is a nightly-only experimental API. (core_io_internals)
Returns an upper bound on the number of elements this container-like item contains if it can be determined, otherwise None. Read more
Source§

final fn size_hint(&self) -> (usize, Option<usize>)

🔬This is a nightly-only experimental API. (core_io_internals)
Returns an estimate for the number of elements this container like type contains. Read more
Source§

impl<T> SizedTypeProperties for T

Source§

#[doc(hidden)]
const SIZE: usize

🔬This is a nightly-only experimental API. (sized_type_properties)
Source§

#[doc(hidden)]
const ALIGN: usize

🔬This is a nightly-only experimental API. (sized_type_properties)
Source§

#[doc(hidden)]
const ALIGNMENT: Alignment

🔬This is a nightly-only experimental API. (ptr_alignment_type)
Source§

#[doc(hidden)]
const IS_ZST: bool

🔬This is a nightly-only experimental API. (sized_type_properties)
true if this type requires no storage. false if its size is greater than zero. Read more
Source§

#[doc(hidden)]
const LAYOUT: Layout

🔬This is a nightly-only experimental API. (sized_type_properties)
Source§

#[doc(hidden)]
const MAX_SLICE_LEN: usize

🔬This is a nightly-only experimental API. (sized_type_properties)
The largest safe length for a [Self]. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.

Layout§

Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...) attributes. Please see the Rust Reference's “Type Layout” chapter for details on type layout guarantees.

Size: 0 bytes