pub trait AltrepImpl: Clone + Debug {
// Required method
fn length(&self) -> usize;
// Provided methods
fn unserialize(_class: Robj, _state: Robj) -> Robj { ... }
fn serialized_state(_x: SEXP) -> Robj { ... }
fn duplicate_ex(x: SEXP, deep: bool) -> Robj { ... }
fn duplicate(x: SEXP, _deep: bool) -> Robj { ... }
fn coerce(_x: SEXP, _ty: Rtype) -> Robj { ... }
fn inspect(&self, _pre: i32, _deep: bool, _pvec: i32) -> bool { ... }
fn dataptr(x: SEXP, _writeable: bool) -> *mut u8 { ... }
fn dataptr_or_null(x: SEXP) -> *const u8 { ... }
fn extract_subset(_x: Robj, _indx: Robj, _call: Robj) -> Robj { ... }
}
Expand description
Rust trait for implementing ALTREP. Implement one or more of these methods to generate an Altrep class. This is likely to be unstable for a while.
Required Methods§
Provided Methods§
Sourcefn unserialize(_class: Robj, _state: Robj) -> Robj
fn unserialize(_class: Robj, _state: Robj) -> Robj
Simplified constructor that is called when loading an Altrep object from a file.
Sourcefn serialized_state(_x: SEXP) -> Robj
fn serialized_state(_x: SEXP) -> Robj
Fetch the state of this object when writing to a file.
Sourcefn duplicate_ex(x: SEXP, deep: bool) -> Robj
fn duplicate_ex(x: SEXP, deep: bool) -> Robj
Duplicate this object, possibly duplicating attributes. Currently this manifests the array but preserves the original object.
Sourcefn duplicate(x: SEXP, _deep: bool) -> Robj
fn duplicate(x: SEXP, _deep: bool) -> Robj
Duplicate this object. Called by Rf_duplicate. Currently this manifests the array but preserves the original object.
Sourcefn inspect(&self, _pre: i32, _deep: bool, _pvec: i32) -> bool
fn inspect(&self, _pre: i32, _deep: bool, _pvec: i32) -> bool
Print the text for .Internal(inspect(obj))
Sourcefn dataptr(x: SEXP, _writeable: bool) -> *mut u8
fn dataptr(x: SEXP, _writeable: bool) -> *mut u8
Get the data pointer for this vector, possibly expanding the compact representation into a full R vector.
Sourcefn dataptr_or_null(x: SEXP) -> *const u8
fn dataptr_or_null(x: SEXP) -> *const u8
Get the data pointer for this vector, returning NULL if the object is unmaterialized.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.