Trait extendr_api::wrapper::altrep::AltrepImpl
source · 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.