pub struct GenericOrdSet<A, P>where
P: SharedPointerKind,{ /* private fields */ }
Expand description
An ordered set.
An immutable ordered map implemented as a B+tree 1.
Most operations on this type of set are O(log n). A
GenericHashSet
is usually a better choice for
performance, but the OrdSet
has the advantage of only requiring
an Ord
constraint on its values, and of being
ordered, so values always come out from lowest to highest, where a
GenericHashSet
has no guaranteed ordering.
Implementations§
Source§impl<A, P> GenericOrdSet<A, P>where
P: SharedPointerKind,
impl<A, P> GenericOrdSet<A, P>where
P: SharedPointerKind,
Sourcepub fn new() -> GenericOrdSet<A, P>
pub fn new() -> GenericOrdSet<A, P>
Construct an empty set.
Sourcepub fn unit(a: A) -> GenericOrdSet<A, P>
pub fn unit(a: A) -> GenericOrdSet<A, P>
Construct a set with a single value.
§Examples
let set = OrdSet::unit(123);
assert!(set.contains(&123));
Sourcepub fn is_empty(&self) -> bool
pub fn is_empty(&self) -> bool
Test whether a set is empty.
Time: O(1)
§Examples
assert!(
!ordset![1, 2, 3].is_empty()
);
assert!(
OrdSet::<i32>::new().is_empty()
);
Sourcepub fn ptr_eq(&self, other: &GenericOrdSet<A, P>) -> bool
pub fn ptr_eq(&self, other: &GenericOrdSet<A, 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)
Source§impl<A, P> GenericOrdSet<A, P>where
A: Ord,
P: SharedPointerKind,
impl<A, P> GenericOrdSet<A, P>where
A: Ord,
P: SharedPointerKind,
Sourcepub fn get_min(&self) -> Option<&A>
pub fn get_min(&self) -> Option<&A>
Get the smallest value in a set.
If the set is empty, returns None
.
Time: O(log n)
Sourcepub fn get_max(&self) -> Option<&A>
pub fn get_max(&self) -> Option<&A>
Get the largest value in a set.
If the set is empty, returns None
.
Time: O(log n)
Sourcepub fn range<R, BA>(&self, range: R) -> RangedIter<'_, A, P> ⓘ
pub fn range<R, BA>(&self, range: R) -> RangedIter<'_, A, P> ⓘ
Create an iterator over a range inside the set.
Sourcepub fn diff<'a, 'b>(
&'a self,
other: &'b GenericOrdSet<A, P>,
) -> DiffIter<'a, 'b, A, P> ⓘ
pub fn diff<'a, 'b>( &'a self, other: &'b GenericOrdSet<A, P>, ) -> DiffIter<'a, 'b, A, P> ⓘ
Get an iterator over the differences between this set and another, i.e. the set of entries to add or remove to this set in order to make it equal to the other set.
This function will avoid visiting nodes which are shared between the two sets, meaning that even very large sets can be compared quickly if most of their structure is shared.
Time: O(n) (where n is the number of unique elements across the two sets, minus the number of elements belonging to nodes shared between them)
Sourcepub fn contains<BA>(&self, a: &BA) -> bool
pub fn contains<BA>(&self, a: &BA) -> bool
Test if a value is part of a set.
Time: O(log n)
§Examples
let mut set = ordset!{1, 2, 3};
assert!(set.contains(&1));
assert!(!set.contains(&4));
Sourcepub fn get<BK>(&self, k: &BK) -> Option<&A>
pub fn get<BK>(&self, k: &BK) -> Option<&A>
Returns a reference to the element in the set, if any, that is equal to the value. The value may be any borrowed form of the set’s element type, but the ordering on the borrowed form must match the ordering on the element type.
This is useful when the elements in the set are unique by for example an id, and you want to get the element out of the set by using the id.
§Examples
// Implements Eq and ord by delegating to id
struct FancyItem {
id: u32,
data: String,
}
let mut set = ordset!{
FancyItem {id: 0, data: String::from("Hello")},
FancyItem {id: 1, data: String::from("Test")}
};
assert_eq!(set.get(&1).unwrap().data, "Test");
assert_eq!(set.get(&0).unwrap().data, "Hello");
Sourcepub fn get_prev<BK>(&self, k: &BK) -> Option<&A>
pub fn get_prev<BK>(&self, k: &BK) -> Option<&A>
Get the closest smaller value in a set to a given value.
If the set contains the given value, this is returned.
Otherwise, the closest value in the set smaller than the
given value is returned. If the smallest value in the set
is larger than the given value, None
is returned.
§Examples
let set = ordset![1, 3, 5, 7, 9];
assert_eq!(Some(&5), set.get_prev(&6));
Sourcepub fn get_next<BK>(&self, k: &BK) -> Option<&A>
pub fn get_next<BK>(&self, k: &BK) -> Option<&A>
Get the closest larger value in a set to a given value.
If the set contains the given value, this is returned.
Otherwise, the closest value in the set larger than the
given value is returned. If the largest value in the set
is smaller than the given value, None
is returned.
§Examples
let set = ordset![1, 3, 5, 7, 9];
assert_eq!(Some(&5), set.get_next(&4));
Sourcepub fn is_subset<RS>(&self, other: RS) -> boolwhere
RS: Borrow<GenericOrdSet<A, P>>,
pub fn is_subset<RS>(&self, other: RS) -> boolwhere
RS: Borrow<GenericOrdSet<A, 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 m) where m is the size of the other set
Sourcepub fn is_proper_subset<RS>(&self, other: RS) -> boolwhere
RS: Borrow<GenericOrdSet<A, P>>,
pub fn is_proper_subset<RS>(&self, other: RS) -> boolwhere
RS: Borrow<GenericOrdSet<A, 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 m) where m is the size of the other set
Source§impl<A, P> GenericOrdSet<A, P>
impl<A, P> GenericOrdSet<A, P>
Sourcepub fn insert(&mut self, a: A) -> Option<A>
pub fn insert(&mut self, a: A) -> Option<A>
Insert a value into a set.
Time: O(log n)
§Examples
let mut set = ordset!{};
set.insert(123);
set.insert(456);
assert_eq!(
set,
ordset![123, 456]
);
Sourcepub fn remove_min(&mut self) -> Option<A>
pub fn remove_min(&mut self) -> Option<A>
Remove the smallest value from a set.
Time: O(log n)
Sourcepub fn remove_max(&mut self) -> Option<A>
pub fn remove_max(&mut self) -> Option<A>
Remove the largest value from a set.
Time: O(log n)
Sourcepub fn update(&self, a: A) -> GenericOrdSet<A, P>
pub fn update(&self, a: A) -> GenericOrdSet<A, P>
Construct a new set from the current set with the given value added.
Time: O(log n)
§Examples
let set = ordset![456];
assert_eq!(
set.update(123),
ordset![123, 456]
);
Sourcepub fn without<BA>(&self, a: &BA) -> GenericOrdSet<A, P>
pub fn without<BA>(&self, a: &BA) -> GenericOrdSet<A, P>
Construct a new set with the given value removed if it’s in the set.
Time: O(log n)
Sourcepub fn without_min(&self) -> (Option<A>, GenericOrdSet<A, P>)
pub fn without_min(&self) -> (Option<A>, GenericOrdSet<A, P>)
Remove the smallest value from a set, and return that value as well as the updated set.
Time: O(log n)
Sourcepub fn without_max(&self) -> (Option<A>, GenericOrdSet<A, P>)
pub fn without_max(&self) -> (Option<A>, GenericOrdSet<A, P>)
Remove the largest value from a set, and return that value as well as the updated set.
Time: O(log n)
Sourcepub fn union(self, other: GenericOrdSet<A, P>) -> GenericOrdSet<A, P>
pub fn union(self, other: GenericOrdSet<A, P>) -> GenericOrdSet<A, P>
Construct the union of two sets.
Time: O(n log n)
§Examples
let set1 = ordset!{1, 2};
let set2 = ordset!{2, 3};
let expected = ordset!{1, 2, 3};
assert_eq!(expected, set1.union(set2));
Sourcepub fn unions<I>(i: I) -> GenericOrdSet<A, P>where
I: IntoIterator<Item = GenericOrdSet<A, P>>,
pub fn unions<I>(i: I) -> GenericOrdSet<A, P>where
I: IntoIterator<Item = GenericOrdSet<A, P>>,
Construct the union of multiple sets.
Time: O(n log n)
Sourcepub fn difference(self, other: GenericOrdSet<A, P>) -> GenericOrdSet<A, 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: GenericOrdSet<A, P>) -> GenericOrdSet<A, 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 = ordset!{1, 2};
let set2 = ordset!{2, 3};
let expected = ordset!{1, 3};
assert_eq!(expected, set1.difference(set2));
Sourcepub fn symmetric_difference(
self,
other: GenericOrdSet<A, P>,
) -> GenericOrdSet<A, P>
pub fn symmetric_difference( self, other: GenericOrdSet<A, P>, ) -> GenericOrdSet<A, P>
Construct the symmetric difference between two sets.
Time: O(n log n)
§Examples
let set1 = ordset!{1, 2};
let set2 = ordset!{2, 3};
let expected = ordset!{1, 3};
assert_eq!(expected, set1.symmetric_difference(set2));
Sourcepub fn relative_complement(
self,
other: GenericOrdSet<A, P>,
) -> GenericOrdSet<A, P>
pub fn relative_complement( self, other: GenericOrdSet<A, P>, ) -> GenericOrdSet<A, 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 = ordset!{1, 2};
let set2 = ordset!{2, 3};
let expected = ordset!{1};
assert_eq!(expected, set1.relative_complement(set2));
Sourcepub fn intersection(self, other: GenericOrdSet<A, P>) -> GenericOrdSet<A, P>
pub fn intersection(self, other: GenericOrdSet<A, P>) -> GenericOrdSet<A, P>
Construct the intersection of two sets.
Time: O(n log n)
§Examples
let set1 = ordset!{1, 2};
let set2 = ordset!{2, 3};
let expected = ordset!{2};
assert_eq!(expected, set1.intersection(set2));
Sourcepub fn split<BA>(self, split: &BA) -> (GenericOrdSet<A, P>, GenericOrdSet<A, P>)
pub fn split<BA>(self, split: &BA) -> (GenericOrdSet<A, P>, GenericOrdSet<A, P>)
Split a set into two, with the left hand set containing values
which are smaller than split
, and the right hand set
containing values which are larger than split
.
The split
value itself is discarded.
Time: O(n)
Sourcepub fn split_member<BA>(
self,
split: &BA,
) -> (GenericOrdSet<A, P>, bool, GenericOrdSet<A, P>)
pub fn split_member<BA>( self, split: &BA, ) -> (GenericOrdSet<A, P>, bool, GenericOrdSet<A, P>)
Split a set into two, with the left hand set containing values
which are smaller than split
, and the right hand set
containing values which are larger than split
.
Returns a tuple of the two sets and a boolean which is true if
the split
value existed in the original set, and false
otherwise.
Time: O(n)
Sourcepub fn take(&self, n: usize) -> GenericOrdSet<A, P>
pub fn take(&self, n: usize) -> GenericOrdSet<A, P>
Construct a set with only the n
smallest values from a given
set.
Time: O(n)
Sourcepub fn skip(&self, n: usize) -> GenericOrdSet<A, P>
pub fn skip(&self, n: usize) -> GenericOrdSet<A, P>
Construct a set with the n
smallest values removed from a
given set.
Time: O(n)
Trait Implementations§
Source§impl<A, P> Add for &GenericOrdSet<A, P>
impl<A, P> Add for &GenericOrdSet<A, P>
Source§type Output = GenericOrdSet<A, P>
type Output = GenericOrdSet<A, P>
+
operator.Source§fn add(
self,
other: &GenericOrdSet<A, P>,
) -> <&GenericOrdSet<A, P> as Add>::Output
fn add( self, other: &GenericOrdSet<A, P>, ) -> <&GenericOrdSet<A, P> as Add>::Output
+
operation. Read moreSource§impl<A, P> Add for GenericOrdSet<A, P>
impl<A, P> Add for GenericOrdSet<A, P>
Source§type Output = GenericOrdSet<A, P>
type Output = GenericOrdSet<A, P>
+
operator.Source§fn add(self, other: GenericOrdSet<A, P>) -> <GenericOrdSet<A, P> as Add>::Output
fn add(self, other: GenericOrdSet<A, P>) -> <GenericOrdSet<A, P> as Add>::Output
+
operation. Read moreSource§impl<A, P> Clone for GenericOrdSet<A, P>where
P: SharedPointerKind,
impl<A, P> Clone for GenericOrdSet<A, P>where
P: SharedPointerKind,
Source§fn clone(&self) -> GenericOrdSet<A, P>
fn clone(&self) -> GenericOrdSet<A, 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, P> Debug for GenericOrdSet<A, P>
impl<A, P> Debug for GenericOrdSet<A, P>
Source§impl<A, P> Default for GenericOrdSet<A, P>where
P: SharedPointerKind,
impl<A, P> Default for GenericOrdSet<A, P>where
P: SharedPointerKind,
Source§fn default() -> GenericOrdSet<A, P>
fn default() -> GenericOrdSet<A, P>
Source§impl<'de, A, P> Deserialize<'de> for GenericOrdSet<A, P>
impl<'de, A, P> Deserialize<'de> for GenericOrdSet<A, P>
Source§fn deserialize<D>(
des: D,
) -> Result<GenericOrdSet<A, P>, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
fn deserialize<D>(
des: D,
) -> Result<GenericOrdSet<A, P>, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
Source§impl<A, R, P> Extend<R> for GenericOrdSet<A, P>
impl<A, R, P> Extend<R> for GenericOrdSet<A, 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, P> From<&'a [A]> for GenericOrdSet<A, P>
impl<'a, A, P> From<&'a [A]> for GenericOrdSet<A, P>
Source§fn from(slice: &'a [A]) -> GenericOrdSet<A, P>
fn from(slice: &'a [A]) -> GenericOrdSet<A, P>
Source§impl<A, P> From<&BTreeSet<A>> for GenericOrdSet<A, P>
impl<A, P> From<&BTreeSet<A>> for GenericOrdSet<A, P>
Source§fn from(btree_set: &BTreeSet<A>) -> GenericOrdSet<A, P>
fn from(btree_set: &BTreeSet<A>) -> GenericOrdSet<A, 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, OA, P1, P2> From<&GenericOrdSet<&A, P2>> for GenericOrdSet<OA, P1>where
A: ToOwned<Owned = OA> + Ord + ?Sized,
OA: Borrow<A> + Ord + Clone,
P1: SharedPointerKind,
P2: SharedPointerKind,
impl<A, OA, P1, P2> From<&GenericOrdSet<&A, P2>> for GenericOrdSet<OA, P1>where
A: ToOwned<Owned = OA> + Ord + ?Sized,
OA: Borrow<A> + Ord + Clone,
P1: SharedPointerKind,
P2: SharedPointerKind,
Source§fn from(set: &GenericOrdSet<&A, P2>) -> GenericOrdSet<OA, P1>
fn from(set: &GenericOrdSet<&A, P2>) -> GenericOrdSet<OA, 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, P> From<&HashSet<A>> for GenericOrdSet<A, P>
impl<A, P> From<&HashSet<A>> for GenericOrdSet<A, P>
Source§fn from(hash_set: &HashSet<A>) -> GenericOrdSet<A, P>
fn from(hash_set: &HashSet<A>) -> GenericOrdSet<A, P>
Source§impl<A, P> From<&Vec<A>> for GenericOrdSet<A, P>
impl<A, P> From<&Vec<A>> for GenericOrdSet<A, P>
Source§fn from(vec: &Vec<A>) -> GenericOrdSet<A, P>
fn from(vec: &Vec<A>) -> GenericOrdSet<A, P>
Source§impl<A, P> From<BTreeSet<A>> for GenericOrdSet<A, P>
impl<A, P> From<BTreeSet<A>> for GenericOrdSet<A, P>
Source§fn from(btree_set: BTreeSet<A>) -> GenericOrdSet<A, P>
fn from(btree_set: BTreeSet<A>) -> GenericOrdSet<A, 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, P> From<HashSet<A>> for GenericOrdSet<A, P>
impl<A, P> From<HashSet<A>> for GenericOrdSet<A, P>
Source§fn from(hash_set: HashSet<A>) -> GenericOrdSet<A, P>
fn from(hash_set: HashSet<A>) -> GenericOrdSet<A, P>
Source§impl<A, P> From<Vec<A>> for GenericOrdSet<A, P>
impl<A, P> From<Vec<A>> for GenericOrdSet<A, P>
Source§fn from(vec: Vec<A>) -> GenericOrdSet<A, P>
fn from(vec: Vec<A>) -> GenericOrdSet<A, P>
Source§impl<A, R, P> FromIterator<R> for GenericOrdSet<A, P>
impl<A, R, P> FromIterator<R> for GenericOrdSet<A, P>
Source§fn from_iter<T>(i: T) -> GenericOrdSet<A, P>where
T: IntoIterator<Item = R>,
fn from_iter<T>(i: T) -> GenericOrdSet<A, P>where
T: IntoIterator<Item = R>,
Source§impl<A, P> Hash for GenericOrdSet<A, P>
impl<A, P> Hash for GenericOrdSet<A, P>
Source§impl<'a, A, P> IntoIterator for &'a GenericOrdSet<A, P>where
A: 'a + Ord,
P: SharedPointerKind,
impl<'a, A, P> IntoIterator for &'a GenericOrdSet<A, P>where
A: 'a + Ord,
P: SharedPointerKind,
Source§impl<A, P> IntoIterator for GenericOrdSet<A, P>
impl<A, P> IntoIterator for GenericOrdSet<A, P>
Source§type IntoIter = ConsumingIter<A, P>
type IntoIter = ConsumingIter<A, P>
Source§fn into_iter(self) -> <GenericOrdSet<A, P> as IntoIterator>::IntoIter
fn into_iter(self) -> <GenericOrdSet<A, P> as IntoIterator>::IntoIter
Source§impl<A, P> Mul for &GenericOrdSet<A, P>
impl<A, P> Mul for &GenericOrdSet<A, P>
Source§type Output = GenericOrdSet<A, P>
type Output = GenericOrdSet<A, P>
*
operator.Source§fn mul(
self,
other: &GenericOrdSet<A, P>,
) -> <&GenericOrdSet<A, P> as Mul>::Output
fn mul( self, other: &GenericOrdSet<A, P>, ) -> <&GenericOrdSet<A, P> as Mul>::Output
*
operation. Read moreSource§impl<A, P> Mul for GenericOrdSet<A, P>
impl<A, P> Mul for GenericOrdSet<A, P>
Source§type Output = GenericOrdSet<A, P>
type Output = GenericOrdSet<A, P>
*
operator.Source§fn mul(self, other: GenericOrdSet<A, P>) -> <GenericOrdSet<A, P> as Mul>::Output
fn mul(self, other: GenericOrdSet<A, P>) -> <GenericOrdSet<A, P> as Mul>::Output
*
operation. Read moreSource§impl<A, P> Ord for GenericOrdSet<A, P>where
A: Ord,
P: SharedPointerKind,
impl<A, P> Ord for GenericOrdSet<A, P>where
A: Ord,
P: SharedPointerKind,
Source§fn cmp(&self, other: &GenericOrdSet<A, P>) -> Ordering
fn cmp(&self, other: &GenericOrdSet<A, P>) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl<A, P> PartialEq for GenericOrdSet<A, P>where
A: Ord,
P: SharedPointerKind,
impl<A, P> PartialEq for GenericOrdSet<A, P>where
A: Ord,
P: SharedPointerKind,
Source§impl<A, P> PartialOrd for GenericOrdSet<A, P>where
A: Ord,
P: SharedPointerKind,
impl<A, P> PartialOrd for GenericOrdSet<A, P>where
A: Ord,
P: SharedPointerKind,
Source§impl<A, P> Serialize for GenericOrdSet<A, P>
impl<A, P> Serialize for GenericOrdSet<A, P>
Source§fn serialize<S>(
&self,
ser: S,
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where
S: Serializer,
fn serialize<S>(
&self,
ser: S,
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where
S: Serializer,
Source§impl<A, P> Sum for GenericOrdSet<A, P>
impl<A, P> Sum for GenericOrdSet<A, P>
Source§fn sum<I>(it: I) -> GenericOrdSet<A, P>where
I: Iterator<Item = GenericOrdSet<A, P>>,
fn sum<I>(it: I) -> GenericOrdSet<A, P>where
I: Iterator<Item = GenericOrdSet<A, P>>,
Self
from the elements by “summing up”
the items.impl<A, P> Eq for GenericOrdSet<A, P>where
A: Ord,
P: SharedPointerKind,
Auto Trait Implementations§
impl<A, P> Freeze for GenericOrdSet<A, P>where
P: Freeze,
impl<A, P> RefUnwindSafe for GenericOrdSet<A, P>where
P: RefUnwindSafe,
A: RefUnwindSafe,
impl<A, P> Send for GenericOrdSet<A, P>
impl<A, P> Sync for GenericOrdSet<A, P>
impl<A, P> Unpin for GenericOrdSet<A, P>
impl<A, P> UnwindSafe for GenericOrdSet<A, P>where
P: UnwindSafe,
A: UnwindSafe,
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> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
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