Trait extendr_api::wrapper::altrep::AltrepImpl[][src]

pub trait AltrepImpl: Clone + Debug {
    fn length(&self) -> usize;

    fn unserialize_ex(
        class: Robj,
        state: Robj,
        attributes: Robj,
        obj_flags: i32,
        levels: i32
    ) -> Robj { ... }
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

Get the virtual length of the vector. For example for a compact range, return end - start + 1.

Provided methods

Constructor that is called when loading an Altrep object from a file.

Simplified constructor that is called when loading an Altrep object from a file.

Fetch the state of this object when writing to a file.

Duplicate this object, possibly duplicating attributes. Currently this manifests the array but preserves the original object.

Duplicate this object. Called by Rf_duplicate. Currently this manifests the array but preserves the original object.

Coerce this object into some other type, if possible.

Print the text for .Internal(inspect(obj))

Get the data pointer for this vector, possibly expanding the compact representation into a full R vector.

Get the data pointer for this vector, returning NULL if the object is unmaterialized.

Implement subsetting (eg. x[10:19]) for this Altrep vector.

Implementors