Struct vortex_array::patches::Patches
source · pub struct Patches { /* private fields */ }
Expand description
A helper for working with patched arrays.
Implementations§
source§impl Patches
impl Patches
pub fn new(array_len: usize, indices: ArrayData, values: ArrayData) -> Self
pub fn into_parts(self) -> (usize, ArrayData, ArrayData)
pub fn array_len(&self) -> usize
pub fn num_patches(&self) -> usize
pub fn dtype(&self) -> &DType
pub fn indices(&self) -> &ArrayData
pub fn into_indices(self) -> ArrayData
pub fn values(&self) -> &ArrayData
pub fn into_values(self) -> ArrayData
pub fn indices_ptype(&self) -> PType
pub fn to_metadata( &self, len: usize, dtype: &DType, ) -> VortexResult<PatchesMetadata>
sourcepub fn get_patched(&self, index: usize) -> VortexResult<Option<Scalar>>
pub fn get_patched(&self, index: usize) -> VortexResult<Option<Scalar>>
Get the patched value at a given index if it exists.
sourcepub fn search_sorted<T: Into<Scalar>>(
&self,
target: T,
side: SearchSortedSide,
) -> VortexResult<SearchResult>
pub fn search_sorted<T: Into<Scalar>>( &self, target: T, side: SearchSortedSide, ) -> VortexResult<SearchResult>
Return the search_sorted result for the given target re-mapped into the original indices.
sourcepub fn filter(&self, mask: FilterMask) -> VortexResult<Option<Self>>
pub fn filter(&self, mask: FilterMask) -> VortexResult<Option<Self>>
Filter the patches by a mask, resulting in new patches for the filtered array.
sourcepub fn slice(&self, start: usize, stop: usize) -> VortexResult<Option<Self>>
pub fn slice(&self, start: usize, stop: usize) -> VortexResult<Option<Self>>
Slice the patches by a range of the patched array.
sourcepub fn take(&self, take_indices: &ArrayData) -> VortexResult<Option<Self>>
pub fn take(&self, take_indices: &ArrayData) -> VortexResult<Option<Self>>
Take the indices from the patches.
pub fn take_search( &self, take_indices: PrimitiveArray, ) -> VortexResult<Option<Self>>
pub fn take_map( &self, take_indices: PrimitiveArray, ) -> VortexResult<Option<Self>>
pub fn map_values<F>(self, f: F) -> VortexResult<Self>
pub fn map_values_opt<F>(self, f: F) -> VortexResult<Option<Self>>
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for Patches
impl !RefUnwindSafe for Patches
impl Send for Patches
impl Sync for Patches
impl Unpin for Patches
impl !UnwindSafe for Patches
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