Struct vortex_file::RowMask
source · pub struct RowMask { /* private fields */ }
Expand description
A RowMask captures a set of selected rows offset by a range.
i.e., row zero of the inner FilterMask represents the offset row of the RowMask.
Implementations§
source§impl RowMask
impl RowMask
pub fn try_new(mask: FilterMask, begin: usize, end: usize) -> VortexResult<Self>
sourcepub fn new_valid_between(begin: usize, end: usize) -> Self
pub fn new_valid_between(begin: usize, end: usize) -> Self
Construct a RowMask which is valid in the given range.
sourcepub fn new_invalid_between(begin: usize, end: usize) -> Self
pub fn new_invalid_between(begin: usize, end: usize) -> Self
Construct a RowMask which is invalid everywhere in the given range.
sourcepub fn from_mask_array(
array: &ArrayData,
begin: usize,
end: usize,
) -> VortexResult<Self>
pub fn from_mask_array( array: &ArrayData, begin: usize, end: usize, ) -> VortexResult<Self>
Construct a RowMask from a Boolean typed array.
True-valued positions are kept by the returned mask.
sourcepub fn from_index_array(
array: &ArrayData,
begin: usize,
end: usize,
) -> VortexResult<Self>
pub fn from_index_array( array: &ArrayData, begin: usize, end: usize, ) -> VortexResult<Self>
Construct a RowMask from an integral array.
The array values are interpreted as indices and those indices are kept by the returned mask.
sourcepub fn and_bitmask(&self, bitmask: ArrayData) -> VortexResult<Self>
pub fn and_bitmask(&self, bitmask: ArrayData) -> VortexResult<Self>
Combine the RowMask with bitmask values resulting in new RowMask containing only values true in the bitmask
pub fn is_all_false(&self) -> bool
pub fn begin(&self) -> usize
pub fn end(&self) -> usize
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
sourcepub fn slice(&self, begin: usize, end: usize) -> VortexResult<Self>
pub fn slice(&self, begin: usize, end: usize) -> VortexResult<Self>
Limit mask to [begin..end) range
sourcepub fn filter_array(
&self,
array: impl AsRef<ArrayData>,
) -> VortexResult<Option<ArrayData>>
pub fn filter_array( &self, array: impl AsRef<ArrayData>, ) -> VortexResult<Option<ArrayData>>
Filter array with this RowMask
.
This function assumes that Array is no longer than the mask length and that the mask starts on same offset as the array, i.e. the beginning of the array corresponds to the beginning of the mask with begin = 0
pub fn shift(self, offset: usize) -> VortexResult<RowMask>
pub fn true_count(&self) -> usize
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for RowMask
impl !RefUnwindSafe for RowMask
impl Send for RowMask
impl Sync for RowMask
impl Unpin for RowMask
impl !UnwindSafe for RowMask
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
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)
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>
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 more