Enum sorted_vec::FindOrInsert
source · Expand description
Value returned when find_or_insert is used.
Variants§
Implementations§
source§impl FindOrInsert
impl FindOrInsert
sourcepub fn found(&self) -> Option<usize>
pub fn found(&self) -> Option<usize>
If an equivalent element was found in the container, get the value of its index. Otherwise get None.
sourcepub fn inserted(&self) -> Option<usize>
pub fn inserted(&self) -> Option<usize>
If the provided element was inserted into the container, get the value of its index. Otherwise get None.
sourcepub fn is_inserted(&self) -> bool
pub fn is_inserted(&self) -> bool
Returns true if the element was inserted.
Trait Implementations§
source§impl Debug for FindOrInsert
impl Debug for FindOrInsert
source§impl From<Result<usize, usize>> for FindOrInsert
impl From<Result<usize, usize>> for FindOrInsert
Converts from the binary_search result type into the FindOrInsert type
source§impl Hash for FindOrInsert
impl Hash for FindOrInsert
source§impl Ord for FindOrInsert
impl Ord for FindOrInsert
source§fn cmp(&self, other: &FindOrInsert) -> Ordering
fn cmp(&self, other: &FindOrInsert) -> Ordering
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
source§impl PartialEq<FindOrInsert> for FindOrInsert
impl PartialEq<FindOrInsert> for FindOrInsert
source§fn eq(&self, other: &FindOrInsert) -> bool
fn eq(&self, other: &FindOrInsert) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl PartialOrd<FindOrInsert> for FindOrInsert
impl PartialOrd<FindOrInsert> for FindOrInsert
source§fn partial_cmp(&self, other: &FindOrInsert) -> Option<Ordering>
fn partial_cmp(&self, other: &FindOrInsert) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read more