pub trait AltIntegerData: AltrepLen {
// Required method
fn elt(&self, i: usize) -> i32;
// Provided methods
fn as_slice(&self) -> Option<&[i32]> { ... }
fn get_region(&self, start: usize, len: usize, buf: &mut [i32]) -> usize { ... }
fn is_sorted(&self) -> Option<Sortedness> { ... }
fn no_na(&self) -> Option<bool> { ... }
fn sum(&self, _na_rm: bool) -> Option<i64> { ... }
fn min(&self, _na_rm: bool) -> Option<i32> { ... }
fn max(&self, _na_rm: bool) -> Option<i32> { ... }
}Expand description
Trait for types that can back an ALTINTEGER vector.
Implement this to create custom integer ALTREP classes.
Required Methods§
Provided Methods§
Sourcefn as_slice(&self) -> Option<&[i32]>
fn as_slice(&self) -> Option<&[i32]>
Optional: return a pointer to contiguous data if available. Default returns None (no contiguous backing).
Sourcefn get_region(&self, start: usize, len: usize, buf: &mut [i32]) -> usize
fn get_region(&self, start: usize, len: usize, buf: &mut [i32]) -> usize
Optional: bulk read into buffer. Returns number of elements read.
Bounds are clamped to the vector length; see fill_region for the
shared safety contract.
Sourcefn is_sorted(&self) -> Option<Sortedness>
fn is_sorted(&self) -> Option<Sortedness>
Optional: sortedness hint. Default is unknown.
Sourcefn sum(&self, _na_rm: bool) -> Option<i64>
fn sum(&self, _na_rm: bool) -> Option<i64>
Optional: optimized sum. Default returns None (use R’s default).