Enum vortex_array::validity::Validity
source · pub enum Validity {
NonNullable,
AllValid,
AllInvalid,
Array(ArrayData),
}
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(ArrayData)
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<ArrayData>
pub fn into_array(self) -> Option<ArrayData>
If Validity is Validity::Array
, returns the array, otherwise returns None
.
sourcepub fn as_array(&self) -> Option<&ArrayData>
pub fn as_array(&self) -> Option<&ArrayData>
If Validity is Validity::Array
, returns a reference to the array array, otherwise returns None
.
pub fn nullability(&self) -> Nullability
pub fn is_null(&self, index: usize) -> bool
pub fn slice(&self, start: usize, stop: usize) -> VortexResult<Self>
pub fn take(&self, indices: &ArrayData) -> VortexResult<Self>
sourcepub unsafe fn take_unchecked(&self, indices: &ArrayData) -> VortexResult<Self>
pub unsafe fn take_unchecked(&self, indices: &ArrayData) -> 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: &FilterMask) -> VortexResult<Self>
pub fn to_logical(&self, length: usize) -> LogicalValidity
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: &ArrayData, patches: Validity, ) -> VortexResult<Self>
sourcepub fn into_nullable(self) -> Validity
pub fn into_nullable(self) -> Validity
Convert into a nullable variant
Trait Implementations§
source§impl From<BooleanBuffer> for Validity
impl From<BooleanBuffer> for Validity
source§fn from(value: BooleanBuffer) -> Self
fn from(value: BooleanBuffer) -> Self
Converts to this type from the input type.
source§impl FromIterator<LogicalValidity> for Validity
impl FromIterator<LogicalValidity> for Validity
source§fn from_iter<T: IntoIterator<Item = LogicalValidity>>(iter: T) -> Self
fn from_iter<T: IntoIterator<Item = LogicalValidity>>(iter: T) -> Self
Creates a value from an iterator. Read more
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> 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§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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