pub struct Validity(/* private fields */);Expand description
An optional validity mask. None (the dense default) means every value is
present with no allocation; Some carries a Bitmap with at least one
missing value. The invariant “Some ⇒ has a missing value” is upheld by the
constructors so equality and has_nulls stay cheap and canonical.
Implementations§
Source§impl Validity
impl Validity
Sourcepub fn from_bitmap(bm: Bitmap) -> Validity
pub fn from_bitmap(bm: Bitmap) -> Validity
Wrap a bitmap, collapsing an all-present one back to dense so the dense fast path is always taken when there are no missing values.
Sourcepub fn from_valid_iter(
len: usize,
valid: impl IntoIterator<Item = bool>,
) -> Validity
pub fn from_valid_iter( len: usize, valid: impl IntoIterator<Item = bool>, ) -> Validity
Build from an iterator of valid flags; dense when all are present.
Sourcepub fn is_valid(&self, i: usize) -> bool
pub fn is_valid(&self, i: usize) -> bool
Whether element i is present. Dense ⇒ always true. i in bounds.
Sourcepub fn null_count(&self) -> usize
pub fn null_count(&self) -> usize
Number of missing values (dense ⇒ 0).
Sourcepub fn and(&self, other: &Validity) -> Validity
pub fn and(&self, other: &Validity) -> Validity
Combined validity of two equal-length columns: present only where both
are present — the missing-value rule for a binary op (x ∘ NA = NA).
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Validity
impl RefUnwindSafe for Validity
impl Send for Validity
impl Sync for Validity
impl Unpin for Validity
impl UnsafeUnpin for Validity
impl UnwindSafe for Validity
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more