pub struct GenericHashSet<A, S, P>where
P: SharedPointerKind,{ /* private fields */ }
Expand description
An unordered set.
An immutable hash set using [hash array mapped tries] 1.
Most operations on this set are O(logx n) for a
suitably high x that it should be nearly O(1) for most sets.
Because of this, it’s a great choice for a generic set as long as
you don’t mind that values will need to implement
Hash
and Eq
.
Values will have a predictable order based on the hasher
being used. Unless otherwise specified, this will be the standard
RandomState
hasher.
Implementations§
Source§impl<A, S, P> GenericHashSet<A, S, P>
impl<A, S, P> GenericHashSet<A, S, P>
Sourcepub fn unit(a: A) -> GenericHashSet<A, S, P>
pub fn unit(a: A) -> GenericHashSet<A, S, P>
Construct a set with a single value.
§Examples
let set = HashSet::unit(123);
assert!(set.contains(&123));
Source§impl<A, S, P> GenericHashSet<A, S, P>where
P: SharedPointerKind,
impl<A, S, P> GenericHashSet<A, S, P>where
P: SharedPointerKind,
Sourcepub fn new() -> GenericHashSet<A, S, P>where
S: Default,
pub fn new() -> GenericHashSet<A, S, P>where
S: Default,
Construct an empty set.
Sourcepub fn is_empty(&self) -> bool
pub fn is_empty(&self) -> bool
Test whether a set is empty.
Time: O(1)
§Examples
assert!(
!hashset![1, 2, 3].is_empty()
);
assert!(
HashSet::<i32>::new().is_empty()
);
Sourcepub fn ptr_eq(&self, other: &GenericHashSet<A, S, P>) -> bool
pub fn ptr_eq(&self, other: &GenericHashSet<A, S, P>) -> bool
Test whether two sets refer to the same content in memory.
This is true if the two sides are references to the same set, or if the two sets refer to the same root node.
This would return true if you’re comparing a set to itself, or if you’re comparing a set to a fresh clone of itself.
Time: O(1)
Sourcepub fn with_hasher(hasher: S) -> GenericHashSet<A, S, P>
pub fn with_hasher(hasher: S) -> GenericHashSet<A, S, P>
Construct an empty hash set using the provided hasher.
Sourcepub fn hasher(&self) -> &S
pub fn hasher(&self) -> &S
Get a reference to the set’s BuildHasher
.
Sourcepub fn new_from<A2>(&self) -> GenericHashSet<A2, S, P>
pub fn new_from<A2>(&self) -> GenericHashSet<A2, S, P>
Construct an empty hash set using the same hasher as the current hash set.
Sourcepub fn clear(&mut self)
pub fn clear(&mut self)
Discard all elements from the set.
This leaves you with an empty set, and all elements that were previously inside it are dropped.
Time: O(n)
§Examples
let mut set = hashset![1, 2, 3];
set.clear();
assert!(set.is_empty());
Sourcepub fn iter(&self) -> Iter<'_, A, P> ⓘ
pub fn iter(&self) -> Iter<'_, A, P> ⓘ
Get an iterator over the values in a hash set.
Please note that the order is consistent between sets using the same hasher, but no other ordering guarantee is offered. Items will not come out in insertion order or sort order. They will, however, come out in the same order every time for the same set.
Source§impl<A, S, P> GenericHashSet<A, S, P>
impl<A, S, P> GenericHashSet<A, S, P>
Sourcepub fn is_subset<RS>(&self, other: RS) -> boolwhere
RS: Borrow<GenericHashSet<A, S, P>>,
pub fn is_subset<RS>(&self, other: RS) -> boolwhere
RS: Borrow<GenericHashSet<A, S, P>>,
Test whether a set is a subset of another set, meaning that all values in our set must also be in the other set.
Time: O(n log n)
Sourcepub fn is_proper_subset<RS>(&self, other: RS) -> boolwhere
RS: Borrow<GenericHashSet<A, S, P>>,
pub fn is_proper_subset<RS>(&self, other: RS) -> boolwhere
RS: Borrow<GenericHashSet<A, S, P>>,
Test whether a set is a proper subset of another set, meaning that all values in our set must also be in the other set. A proper subset must also be smaller than the other set.
Time: O(n log n)
Source§impl<A, S, P> GenericHashSet<A, S, P>
impl<A, S, P> GenericHashSet<A, S, P>
Sourcepub fn remove<BA>(&mut self, a: &BA) -> Option<A>
pub fn remove<BA>(&mut self, a: &BA) -> Option<A>
Remove a value from a set if it exists.
Time: O(log n)
Sourcepub fn update(&self, a: A) -> GenericHashSet<A, S, P>
pub fn update(&self, a: A) -> GenericHashSet<A, S, P>
Construct a new set from the current set with the given value added.
Time: O(log n)
§Examples
let set = hashset![123];
assert_eq!(
set.update(456),
hashset![123, 456]
);
Sourcepub fn without<BA>(&self, a: &BA) -> GenericHashSet<A, S, P>
pub fn without<BA>(&self, a: &BA) -> GenericHashSet<A, S, P>
Construct a new set with the given value removed if it’s in the set.
Time: O(log n)
Sourcepub fn retain<F>(&mut self, f: F)
pub fn retain<F>(&mut self, f: F)
Filter out values from a set which don’t satisfy a predicate.
This is slightly more efficient than filtering using an iterator, in that it doesn’t need to rehash the retained values, but it still needs to reconstruct the entire tree structure of the set.
Time: O(n log n)
§Examples
let mut set = hashset![1, 2, 3];
set.retain(|v| *v > 1);
let expected = hashset![2, 3];
assert_eq!(expected, set);
Sourcepub fn union(self, other: GenericHashSet<A, S, P>) -> GenericHashSet<A, S, P>
pub fn union(self, other: GenericHashSet<A, S, P>) -> GenericHashSet<A, S, P>
Construct the union of two sets.
Time: O(n log n)
§Examples
let set1 = hashset!{1, 2};
let set2 = hashset!{2, 3};
let expected = hashset!{1, 2, 3};
assert_eq!(expected, set1.union(set2));
Sourcepub fn unions<I>(i: I) -> GenericHashSet<A, S, P>
pub fn unions<I>(i: I) -> GenericHashSet<A, S, P>
Construct the union of multiple sets.
Time: O(n log n)
Sourcepub fn difference(
self,
other: GenericHashSet<A, S, P>,
) -> GenericHashSet<A, S, P>
👎Deprecated since 2.0.1: to avoid conflicting behaviors between std and imbl, the difference
alias for symmetric_difference
will be removed.
pub fn difference( self, other: GenericHashSet<A, S, P>, ) -> GenericHashSet<A, S, P>
difference
alias for symmetric_difference
will be removed.Construct the symmetric difference between two sets.
This is an alias for the
symmetric_difference
method.
Time: O(n log n)
§Examples
let set1 = hashset!{1, 2};
let set2 = hashset!{2, 3};
let expected = hashset!{1, 3};
assert_eq!(expected, set1.difference(set2));
Sourcepub fn symmetric_difference(
self,
other: GenericHashSet<A, S, P>,
) -> GenericHashSet<A, S, P>
pub fn symmetric_difference( self, other: GenericHashSet<A, S, P>, ) -> GenericHashSet<A, S, P>
Construct the symmetric difference between two sets.
Time: O(n log n)
§Examples
let set1 = hashset!{1, 2};
let set2 = hashset!{2, 3};
let expected = hashset!{1, 3};
assert_eq!(expected, set1.symmetric_difference(set2));
Sourcepub fn relative_complement(
self,
other: GenericHashSet<A, S, P>,
) -> GenericHashSet<A, S, P>
pub fn relative_complement( self, other: GenericHashSet<A, S, P>, ) -> GenericHashSet<A, S, P>
Construct the relative complement between two sets, that is the set
of values in self
that do not occur in other
.
Time: O(m log n) where m is the size of the other set
§Examples
let set1 = hashset!{1, 2};
let set2 = hashset!{2, 3};
let expected = hashset!{1};
assert_eq!(expected, set1.relative_complement(set2));
Sourcepub fn intersection(
self,
other: GenericHashSet<A, S, P>,
) -> GenericHashSet<A, S, P>
pub fn intersection( self, other: GenericHashSet<A, S, P>, ) -> GenericHashSet<A, S, P>
Construct the intersection of two sets.
Time: O(n log n)
§Examples
let set1 = hashset!{1, 2};
let set2 = hashset!{2, 3};
let expected = hashset!{2};
assert_eq!(expected, set1.intersection(set2));
Trait Implementations§
Source§impl<'a, A, S, P> Add for &'a GenericHashSet<A, S, P>
impl<'a, A, S, P> Add for &'a GenericHashSet<A, S, P>
Source§type Output = GenericHashSet<A, S, P>
type Output = GenericHashSet<A, S, P>
+
operator.Source§fn add(
self,
other: &'a GenericHashSet<A, S, P>,
) -> <&'a GenericHashSet<A, S, P> as Add>::Output
fn add( self, other: &'a GenericHashSet<A, S, P>, ) -> <&'a GenericHashSet<A, S, P> as Add>::Output
+
operation. Read moreSource§impl<A, S, P> Add for GenericHashSet<A, S, P>
impl<A, S, P> Add for GenericHashSet<A, S, P>
Source§type Output = GenericHashSet<A, S, P>
type Output = GenericHashSet<A, S, P>
+
operator.Source§fn add(
self,
other: GenericHashSet<A, S, P>,
) -> <GenericHashSet<A, S, P> as Add>::Output
fn add( self, other: GenericHashSet<A, S, P>, ) -> <GenericHashSet<A, S, P> as Add>::Output
+
operation. Read moreSource§impl<A, S, P> Clone for GenericHashSet<A, S, P>
impl<A, S, P> Clone for GenericHashSet<A, S, P>
Source§fn clone(&self) -> GenericHashSet<A, S, P>
fn clone(&self) -> GenericHashSet<A, S, P>
Clone a set.
Time: O(1)
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl<A, S, P> Debug for GenericHashSet<A, S, P>
impl<A, S, P> Debug for GenericHashSet<A, S, P>
Source§impl<A, S, P> Default for GenericHashSet<A, S, P>where
S: Default,
P: SharedPointerKind,
impl<A, S, P> Default for GenericHashSet<A, S, P>where
S: Default,
P: SharedPointerKind,
Source§fn default() -> GenericHashSet<A, S, P>
fn default() -> GenericHashSet<A, S, P>
Source§impl<'de, A, S, P> Deserialize<'de> for GenericHashSet<A, S, P>where
A: Deserialize<'de> + Hash + Eq + Clone,
S: BuildHasher + Default + Clone,
P: SharedPointerKind,
impl<'de, A, S, P> Deserialize<'de> for GenericHashSet<A, S, P>where
A: Deserialize<'de> + Hash + Eq + Clone,
S: BuildHasher + Default + Clone,
P: SharedPointerKind,
Source§fn deserialize<D>(
des: D,
) -> Result<GenericHashSet<A, S, P>, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
fn deserialize<D>(
des: D,
) -> Result<GenericHashSet<A, S, P>, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
Source§impl<A, S, R, P> Extend<R> for GenericHashSet<A, S, P>
impl<A, S, R, P> Extend<R> for GenericHashSet<A, S, P>
Source§fn extend<I>(&mut self, iter: I)where
I: IntoIterator<Item = R>,
fn extend<I>(&mut self, iter: I)where
I: IntoIterator<Item = R>,
Source§fn extend_one(&mut self, item: A)
fn extend_one(&mut self, item: A)
extend_one
)Source§fn extend_reserve(&mut self, additional: usize)
fn extend_reserve(&mut self, additional: usize)
extend_one
)Source§impl<'a, A, S, P> From<&'a [A]> for GenericHashSet<A, S, P>
impl<'a, A, S, P> From<&'a [A]> for GenericHashSet<A, S, P>
Source§fn from(slice: &'a [A]) -> GenericHashSet<A, S, P>
fn from(slice: &'a [A]) -> GenericHashSet<A, S, P>
Source§impl<'a, A, S, P> From<&'a BTreeSet<A>> for GenericHashSet<A, S, P>
impl<'a, A, S, P> From<&'a BTreeSet<A>> for GenericHashSet<A, S, P>
Source§fn from(btree_set: &BTreeSet<A>) -> GenericHashSet<A, S, P>
fn from(btree_set: &BTreeSet<A>) -> GenericHashSet<A, S, P>
Source§impl<'s, 'a, A, OA, SA, SB, P1, P2> From<&'s GenericHashSet<&'a A, SA, P1>> for GenericHashSet<OA, SB, P2>where
A: ToOwned<Owned = OA> + Hash + Eq + ?Sized,
OA: Borrow<A> + Hash + Eq + Clone,
SA: BuildHasher,
SB: BuildHasher + Default + Clone,
P1: SharedPointerKind,
P2: SharedPointerKind,
impl<'s, 'a, A, OA, SA, SB, P1, P2> From<&'s GenericHashSet<&'a A, SA, P1>> for GenericHashSet<OA, SB, P2>where
A: ToOwned<Owned = OA> + Hash + Eq + ?Sized,
OA: Borrow<A> + Hash + Eq + Clone,
SA: BuildHasher,
SB: BuildHasher + Default + Clone,
P1: SharedPointerKind,
P2: SharedPointerKind,
Source§fn from(set: &GenericHashSet<&A, SA, P1>) -> GenericHashSet<OA, SB, P2>
fn from(set: &GenericHashSet<&A, SA, P1>) -> GenericHashSet<OA, SB, P2>
Source§impl<A, S, P1, P2> From<&GenericHashSet<A, S, P2>> for GenericOrdSet<A, P1>
impl<A, S, P1, P2> From<&GenericHashSet<A, S, P2>> for GenericOrdSet<A, P1>
Source§fn from(hashset: &GenericHashSet<A, S, P2>) -> GenericOrdSet<A, P1>
fn from(hashset: &GenericHashSet<A, S, P2>) -> GenericOrdSet<A, P1>
Source§impl<'a, A, S, P1, P2> From<&'a GenericOrdSet<A, P2>> for GenericHashSet<A, S, P1>where
A: Ord + Hash + Eq + Clone,
S: BuildHasher + Default + Clone,
P1: SharedPointerKind,
P2: SharedPointerKind,
impl<'a, A, S, P1, P2> From<&'a GenericOrdSet<A, P2>> for GenericHashSet<A, S, P1>where
A: Ord + Hash + Eq + Clone,
S: BuildHasher + Default + Clone,
P1: SharedPointerKind,
P2: SharedPointerKind,
Source§fn from(ordset: &GenericOrdSet<A, P2>) -> GenericHashSet<A, S, P1>
fn from(ordset: &GenericOrdSet<A, P2>) -> GenericHashSet<A, S, P1>
Source§impl<'a, A, S, P1, P2> From<&'a GenericVector<A, P2>> for GenericHashSet<A, S, P1>where
A: Hash + Eq + Clone,
S: BuildHasher + Default + Clone,
P1: SharedPointerKind,
P2: SharedPointerKind,
impl<'a, A, S, P1, P2> From<&'a GenericVector<A, P2>> for GenericHashSet<A, S, P1>where
A: Hash + Eq + Clone,
S: BuildHasher + Default + Clone,
P1: SharedPointerKind,
P2: SharedPointerKind,
Source§fn from(vector: &GenericVector<A, P2>) -> GenericHashSet<A, S, P1>
fn from(vector: &GenericVector<A, P2>) -> GenericHashSet<A, S, P1>
Source§impl<'a, A, S, P> From<&'a HashSet<A>> for GenericHashSet<A, S, P>
impl<'a, A, S, P> From<&'a HashSet<A>> for GenericHashSet<A, S, P>
Source§fn from(hash_set: &HashSet<A>) -> GenericHashSet<A, S, P>
fn from(hash_set: &HashSet<A>) -> GenericHashSet<A, S, P>
Source§impl<'a, A, S, P> From<&'a Vec<A>> for GenericHashSet<A, S, P>
impl<'a, A, S, P> From<&'a Vec<A>> for GenericHashSet<A, S, P>
Source§fn from(vec: &Vec<A>) -> GenericHashSet<A, S, P>
fn from(vec: &Vec<A>) -> GenericHashSet<A, S, P>
Source§impl<A, S, const N: usize, P> From<[A; N]> for GenericHashSet<A, S, P>
impl<A, S, const N: usize, P> From<[A; N]> for GenericHashSet<A, S, P>
Source§fn from(arr: [A; N]) -> GenericHashSet<A, S, P>
fn from(arr: [A; N]) -> GenericHashSet<A, S, P>
Source§impl<A, S, P1, P2> From<GenericHashSet<A, S, P2>> for GenericOrdSet<A, P1>
impl<A, S, P1, P2> From<GenericHashSet<A, S, P2>> for GenericOrdSet<A, P1>
Source§fn from(hashset: GenericHashSet<A, S, P2>) -> GenericOrdSet<A, P1>
fn from(hashset: GenericHashSet<A, S, P2>) -> GenericOrdSet<A, P1>
Source§impl<A, S, P1, P2> From<GenericOrdSet<A, P2>> for GenericHashSet<A, S, P1>where
A: Ord + Hash + Eq + Clone,
S: BuildHasher + Default + Clone,
P1: SharedPointerKind,
P2: SharedPointerKind,
impl<A, S, P1, P2> From<GenericOrdSet<A, P2>> for GenericHashSet<A, S, P1>where
A: Ord + Hash + Eq + Clone,
S: BuildHasher + Default + Clone,
P1: SharedPointerKind,
P2: SharedPointerKind,
Source§fn from(ordset: GenericOrdSet<A, P2>) -> GenericHashSet<A, S, P1>
fn from(ordset: GenericOrdSet<A, P2>) -> GenericHashSet<A, S, P1>
Source§impl<A, S, P1, P2> From<GenericVector<A, P2>> for GenericHashSet<A, S, P1>where
A: Hash + Eq + Clone,
S: BuildHasher + Default + Clone,
P1: SharedPointerKind,
P2: SharedPointerKind,
impl<A, S, P1, P2> From<GenericVector<A, P2>> for GenericHashSet<A, S, P1>where
A: Hash + Eq + Clone,
S: BuildHasher + Default + Clone,
P1: SharedPointerKind,
P2: SharedPointerKind,
Source§fn from(vector: GenericVector<A, P2>) -> GenericHashSet<A, S, P1>
fn from(vector: GenericVector<A, P2>) -> GenericHashSet<A, S, P1>
Source§impl<A, S, P> From<HashSet<A>> for GenericHashSet<A, S, P>
impl<A, S, P> From<HashSet<A>> for GenericHashSet<A, S, P>
Source§fn from(hash_set: HashSet<A>) -> GenericHashSet<A, S, P>
fn from(hash_set: HashSet<A>) -> GenericHashSet<A, S, P>
Source§impl<A, S, P> From<Vec<A>> for GenericHashSet<A, S, P>
impl<A, S, P> From<Vec<A>> for GenericHashSet<A, S, P>
Source§fn from(vec: Vec<A>) -> GenericHashSet<A, S, P>
fn from(vec: Vec<A>) -> GenericHashSet<A, S, P>
Source§impl<A, RA, S, P> FromIterator<RA> for GenericHashSet<A, S, P>
impl<A, RA, S, P> FromIterator<RA> for GenericHashSet<A, S, P>
Source§fn from_iter<T>(i: T) -> GenericHashSet<A, S, P>where
T: IntoIterator<Item = RA>,
fn from_iter<T>(i: T) -> GenericHashSet<A, S, P>where
T: IntoIterator<Item = RA>,
Source§impl<'a, A, S, P> IntoIterator for &'a GenericHashSet<A, S, P>
impl<'a, A, S, P> IntoIterator for &'a GenericHashSet<A, S, P>
Source§impl<A, S, P> IntoIterator for GenericHashSet<A, S, P>
impl<A, S, P> IntoIterator for GenericHashSet<A, S, P>
Source§type IntoIter = ConsumingIter<<GenericHashSet<A, S, P> as IntoIterator>::Item, P>
type IntoIter = ConsumingIter<<GenericHashSet<A, S, P> as IntoIterator>::Item, P>
Source§fn into_iter(self) -> <GenericHashSet<A, S, P> as IntoIterator>::IntoIter
fn into_iter(self) -> <GenericHashSet<A, S, P> as IntoIterator>::IntoIter
Source§impl<'a, A, S, P> Mul for &'a GenericHashSet<A, S, P>
impl<'a, A, S, P> Mul for &'a GenericHashSet<A, S, P>
Source§type Output = GenericHashSet<A, S, P>
type Output = GenericHashSet<A, S, P>
*
operator.Source§fn mul(
self,
other: &'a GenericHashSet<A, S, P>,
) -> <&'a GenericHashSet<A, S, P> as Mul>::Output
fn mul( self, other: &'a GenericHashSet<A, S, P>, ) -> <&'a GenericHashSet<A, S, P> as Mul>::Output
*
operation. Read moreSource§impl<A, S, P> Mul for GenericHashSet<A, S, P>
impl<A, S, P> Mul for GenericHashSet<A, S, P>
Source§type Output = GenericHashSet<A, S, P>
type Output = GenericHashSet<A, S, P>
*
operator.Source§fn mul(
self,
other: GenericHashSet<A, S, P>,
) -> <GenericHashSet<A, S, P> as Mul>::Output
fn mul( self, other: GenericHashSet<A, S, P>, ) -> <GenericHashSet<A, S, P> as Mul>::Output
*
operation. Read moreSource§impl<A, S1, P1, S2, P2> PartialEq<GenericHashSet<A, S2, P2>> for GenericHashSet<A, S1, P1>
impl<A, S1, P1, S2, P2> PartialEq<GenericHashSet<A, S2, P2>> for GenericHashSet<A, S1, P1>
Source§impl<A, S, P> Serialize for GenericHashSet<A, S, P>
impl<A, S, P> Serialize for GenericHashSet<A, S, P>
Source§fn serialize<Ser>(
&self,
ser: Ser,
) -> Result<<Ser as Serializer>::Ok, <Ser as Serializer>::Error>where
Ser: Serializer,
fn serialize<Ser>(
&self,
ser: Ser,
) -> Result<<Ser as Serializer>::Ok, <Ser as Serializer>::Error>where
Ser: Serializer,
Source§impl<A, S, P> Sum for GenericHashSet<A, S, P>
impl<A, S, P> Sum for GenericHashSet<A, S, P>
Source§fn sum<I>(it: I) -> GenericHashSet<A, S, P>where
I: Iterator<Item = GenericHashSet<A, S, P>>,
fn sum<I>(it: I) -> GenericHashSet<A, S, P>where
I: Iterator<Item = GenericHashSet<A, S, P>>,
Self
from the elements by “summing up”
the items.impl<A, S, P> Eq for GenericHashSet<A, S, P>
Auto Trait Implementations§
impl<A, S, P> Freeze for GenericHashSet<A, S, P>
impl<A, S, P> RefUnwindSafe for GenericHashSet<A, S, P>
impl<A, S, P> Send for GenericHashSet<A, S, P>
impl<A, S, P> Sync for GenericHashSet<A, S, P>
impl<A, S, P> Unpin for GenericHashSet<A, S, P>where
S: Unpin,
impl<A, S, P> UnwindSafe for GenericHashSet<A, S, P>
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§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§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