Skip to main content

AltLogicalData

Trait AltLogicalData 

Source
pub trait AltLogicalData: AltrepLen {
    // Required method
    fn elt(&self, i: usize) -> Logical;

    // Provided methods
    fn as_r_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> { ... }
}
Expand description

Trait for types that can back an ALTLOGICAL vector.

Required Methods§

Source

fn elt(&self, i: usize) -> Logical

Get the logical element at index i.

Provided Methods§

Source

fn as_r_slice(&self) -> Option<&[i32]>

Optional: return a slice if data is contiguous i32 (R’s internal format).

Source

fn get_region(&self, start: usize, len: usize, buf: &mut [i32]) -> usize

Optional: bulk read into buffer (clamped to available data).

Source

fn is_sorted(&self) -> Option<Sortedness>

Optional: sortedness hint.

Source

fn no_na(&self) -> Option<bool>

Optional: does this vector contain any NA values?

Source

fn sum(&self, _na_rm: bool) -> Option<i64>

Optional: optimized sum (count of TRUE values).

Implementations on Foreign Types§

Source§

impl AltLogicalData for &[bool]

Source§

fn elt(&self, i: usize) -> Logical

Source§

fn no_na(&self) -> Option<bool>

Source§

fn sum(&self, _na_rm: bool) -> Option<i64>

Source§

impl AltLogicalData for Box<[bool]>

Source§

fn elt(&self, i: usize) -> Logical

Source§

fn no_na(&self) -> Option<bool>

Source§

fn sum(&self, _na_rm: bool) -> Option<i64>

Source§

impl AltLogicalData for Vec<bool>

Source§

fn elt(&self, i: usize) -> Logical

Source§

fn no_na(&self) -> Option<bool>

Source§

fn sum(&self, _na_rm: bool) -> Option<i64>

Source§

impl<const N: usize> AltLogicalData for [bool; N]

Source§

fn elt(&self, i: usize) -> Logical

Source§

fn no_na(&self) -> Option<bool>

Implementors§