Enum vortex_array::compute::SearchResult
source · pub enum SearchResult {
Found(usize),
NotFound(usize),
}
Expand description
Result of performing search_sorted on an Array
Variants§
Found(usize)
Result for a found element was found at the given index in the sorted array
NotFound(usize)
Result for an element not found, but that could be inserted at the given position in the sorted order.
Implementations§
source§impl SearchResult
impl SearchResult
sourcepub fn to_found(self) -> Option<usize>
pub fn to_found(self) -> Option<usize>
Convert search result to an index only if the value have been found
sourcepub fn to_index(self) -> usize
pub fn to_index(self) -> usize
Extract index out of search result regardless of whether the value have been found or not
sourcepub fn to_offsets_index(self, len: usize) -> usize
pub fn to_offsets_index(self, len: usize) -> usize
Convert search result into an index suitable for searching array of offset indices, i.e. first element starts at 0.
For example for a ChunkedArray with chunk offsets array [0, 3, 8, 10] you can use this method to obtain index suitable for indexing into it after performing a search
sourcepub fn to_ends_index(self, len: usize) -> usize
pub fn to_ends_index(self, len: usize) -> usize
Convert search result into an index suitable for searching array of end indices without 0 offset, i.e. first element implicitly covers 0..0th-element range.
For example for a RunEndArray with ends array [3, 8, 10], you can use this method to obtain index suitable for indexing into it after performing a search
Trait Implementations§
source§impl Clone for SearchResult
impl Clone for SearchResult
source§fn clone(&self) -> SearchResult
fn clone(&self) -> SearchResult
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for SearchResult
impl Debug for SearchResult
source§impl Display for SearchResult
impl Display for SearchResult
source§impl PartialEq for SearchResult
impl PartialEq for SearchResult
impl Copy for SearchResult
impl Eq for SearchResult
impl StructuralPartialEq for SearchResult
Auto Trait Implementations§
impl Freeze for SearchResult
impl RefUnwindSafe for SearchResult
impl Send for SearchResult
impl Sync for SearchResult
impl Unpin for SearchResult
impl UnwindSafe for SearchResult
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§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