pub enum Validity {
NonNullable,
AllValid,
AllInvalid,
Array(Array),
}
Expand description
Validity information for an array
Variants§
NonNullable
Items can’t be null
AllValid
All items are valid
AllInvalid
All items are null
Array(Array)
Specified items are null
Implementations§
Source§impl Validity
impl Validity
pub fn to_metadata(&self, length: usize) -> VortexResult<ValidityMetadata>
pub fn null_count(&self, length: usize) -> VortexResult<usize>
Sourcepub fn into_array(self) -> Option<Array>
pub fn into_array(self) -> Option<Array>
If Validity is Validity::Array
, returns the array, otherwise returns None
.
Sourcepub fn as_array(&self) -> Option<&Array>
pub fn as_array(&self) -> Option<&Array>
If Validity is Validity::Array
, returns a reference to the array array, otherwise returns None
.
pub fn nullability(&self) -> Nullability
pub fn all_valid(&self) -> VortexResult<bool>
Sourcepub fn is_valid(&self, index: usize) -> VortexResult<bool>
pub fn is_valid(&self, index: usize) -> VortexResult<bool>
Returns whether the index
item is valid.
pub fn is_null(&self, index: usize) -> VortexResult<bool>
pub fn slice(&self, start: usize, stop: usize) -> VortexResult<Self>
pub fn take(&self, indices: &Array) -> VortexResult<Self>
Sourcepub unsafe fn take_unchecked(&self, indices: &Array) -> VortexResult<Self>
pub unsafe fn take_unchecked(&self, indices: &Array) -> VortexResult<Self>
Take the validity buffer at the provided indices.
§Safety
It is assumed the caller has checked that all indices are <= the length of this validity buffer.
Failure to do so may result in UB.
pub fn filter(&self, mask: &Mask) -> VortexResult<Self>
pub fn to_logical(&self, length: usize) -> VortexResult<Mask>
Sourcepub fn and(self, rhs: Validity) -> VortexResult<Validity>
pub fn and(self, rhs: Validity) -> VortexResult<Validity>
Logically & two Validity values of the same length
pub fn patch( self, len: usize, indices: &Array, patches: Validity, ) -> VortexResult<Self>
Sourcepub fn into_nullable(self) -> Validity
pub fn into_nullable(self) -> Validity
Convert into a nullable variant
Sourcepub fn from_array(value: Array, nullability: Nullability) -> Self
pub fn from_array(value: Array, nullability: Nullability) -> Self
Create Validity from boolean array with given nullability of the array.
Note: You want to pass the nullability of parent array and not the nullability of the validity array itself as that is always nonnullable
Trait Implementations§
Source§impl From<BooleanBuffer> for Validity
impl From<BooleanBuffer> for Validity
Source§fn from(value: BooleanBuffer) -> Self
fn from(value: BooleanBuffer) -> Self
Source§impl From<NullBuffer> for Validity
impl From<NullBuffer> for Validity
Source§fn from(value: NullBuffer) -> Self
fn from(value: NullBuffer) -> Self
Source§impl From<Nullability> for Validity
impl From<Nullability> for Validity
Source§fn from(value: Nullability) -> Self
fn from(value: Nullability) -> Self
Source§impl FromIterator<Mask> for Validity
impl FromIterator<Mask> for Validity
Source§impl FromIterator<bool> for Validity
impl FromIterator<bool> for Validity
Auto Trait Implementations§
impl !Freeze for Validity
impl !RefUnwindSafe for Validity
impl Send for Validity
impl Sync for Validity
impl Unpin for Validity
impl !UnwindSafe for Validity
Blanket Implementations§
Source§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
Source§type ArchivedMetadata = ()
type ArchivedMetadata = ()
Source§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
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
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>
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>
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 moreSource§impl<T> LayoutRaw for T
impl<T> LayoutRaw for T
Source§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
Source§impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
Source§unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
Source§fn resolve_niched(out: Place<NichedOption<T, N1>>)
fn resolve_niched(out: Place<NichedOption<T, N1>>)
out
indicating that a T
is niched.