pub struct NullableColumn<T: Clone> {
pub values: Vec<T>,
pub validity: BitMask,
}Expand description
A nullable column: values buffer + validity bitmap.
The validity bitmap uses the same bit layout as BitMask (LSB-first,
tail bits zeroed). validity.get(i) == true means values[i] is valid
(not null). When validity.get(i) == false, values[i] holds a
type-appropriate zero/empty value but MUST NOT be read as valid data.
Fields§
§values: Vec<T>§validity: BitMaskImplementations§
Source§impl<T: Clone + Default> NullableColumn<T>
impl<T: Clone + Default> NullableColumn<T>
Sourcepub fn from_values(values: Vec<T>) -> Self
pub fn from_values(values: Vec<T>) -> Self
Create a fully valid (non-null) nullable column from a slice.
Sourcepub fn new(values: Vec<T>, validity: BitMask) -> Self
pub fn new(values: Vec<T>, validity: BitMask) -> Self
Create a nullable column with explicit validity.
Panics if values.len() != validity.nrows().
Sourcepub fn count_valid(&self) -> usize
pub fn count_valid(&self) -> usize
Count non-null rows.
Trait Implementations§
Auto Trait Implementations§
impl<T> Freeze for NullableColumn<T>
impl<T> RefUnwindSafe for NullableColumn<T>where
T: RefUnwindSafe,
impl<T> Send for NullableColumn<T>where
T: Send,
impl<T> Sync for NullableColumn<T>where
T: Sync,
impl<T> Unpin for NullableColumn<T>where
T: Unpin,
impl<T> UnsafeUnpin for NullableColumn<T>
impl<T> UnwindSafe for NullableColumn<T>where
T: UnwindSafe,
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more