pub struct OrderedSet<T: Ordered>(/* private fields */);

Implementations§

source§

impl<T: Ordered> OrderedSet<T>

source

pub fn new() -> Self

Constructs a new, empty OrderedSet.

Methods from Deref<Target = IndexSet<T>>§

source

pub fn capacity(&self) -> usize

Return the number of elements the set can hold without reallocating.

This number is a lower bound; the set might be able to hold more, but is guaranteed to be able to hold at least this many.

Computes in O(1) time.

source

pub fn hasher(&self) -> &S

Return a reference to the set’s BuildHasher.

source

pub fn len(&self) -> usize

Return the number of elements in the set.

Computes in O(1) time.

source

pub fn is_empty(&self) -> bool

Returns true if the set contains no elements.

Computes in O(1) time.

source

pub fn iter(&self) -> Iter<'_, T>

Return an iterator over the values of the set, in their order

source

pub fn clear(&mut self)

Remove all elements in the set, while preserving its capacity.

Computes in O(n) time.

source

pub fn truncate(&mut self, len: usize)

Shortens the set, keeping the first len elements and dropping the rest.

If len is greater than the set’s current length, this has no effect.

source

pub fn drain<R>(&mut self, range: R) -> Drain<'_, T>
where R: RangeBounds<usize>,

Clears the IndexSet in the given index range, returning those values as a drain iterator.

The range may be any type that implements RangeBounds<usize>, including all of the std::ops::Range* types, or even a tuple pair of Bound start and end values. To drain the set entirely, use RangeFull like set.drain(..).

This shifts down all entries following the drained range to fill the gap, and keeps the allocated memory for reuse.

Panics if the starting point is greater than the end point or if the end point is greater than the length of the set.

source

pub fn split_off(&mut self, at: usize) -> IndexSet<T, S>
where S: Clone,

Splits the collection into two at the given index.

Returns a newly allocated set containing the elements in the range [at, len). After the call, the original set will be left containing the elements [0, at) with its previous capacity unchanged.

Panics if at > len.

source

pub fn reserve(&mut self, additional: usize)

Reserve capacity for additional more values.

Computes in O(n) time.

source

pub fn reserve_exact(&mut self, additional: usize)

Reserve capacity for additional more values, without over-allocating.

Unlike reserve, this does not deliberately over-allocate the entry capacity to avoid frequent re-allocations. However, the underlying data structures may still have internal capacity requirements, and the allocator itself may give more space than requested, so this cannot be relied upon to be precisely minimal.

Computes in O(n) time.

source

pub fn try_reserve(&mut self, additional: usize) -> Result<(), TryReserveError>

Try to reserve capacity for additional more values.

Computes in O(n) time.

source

pub fn try_reserve_exact( &mut self, additional: usize ) -> Result<(), TryReserveError>

Try to reserve capacity for additional more values, without over-allocating.

Unlike try_reserve, this does not deliberately over-allocate the entry capacity to avoid frequent re-allocations. However, the underlying data structures may still have internal capacity requirements, and the allocator itself may give more space than requested, so this cannot be relied upon to be precisely minimal.

Computes in O(n) time.

source

pub fn shrink_to_fit(&mut self)

Shrink the capacity of the set as much as possible.

Computes in O(n) time.

source

pub fn shrink_to(&mut self, min_capacity: usize)

Shrink the capacity of the set with a lower limit.

Computes in O(n) time.

source

pub fn insert(&mut self, value: T) -> bool

Insert the value into the set.

If an equivalent item already exists in the set, it returns false leaving the original value in the set and without altering its insertion order. Otherwise, it inserts the new item and returns true.

Computes in O(1) time (amortized average).

source

pub fn insert_full(&mut self, value: T) -> (usize, bool)

Insert the value into the set, and get its index.

If an equivalent item already exists in the set, it returns the index of the existing item and false, leaving the original value in the set and without altering its insertion order. Otherwise, it inserts the new item and returns the index of the inserted item and true.

Computes in O(1) time (amortized average).

source

pub fn replace(&mut self, value: T) -> Option<T>

Adds a value to the set, replacing the existing value, if any, that is equal to the given one, without altering its insertion order. Returns the replaced value.

Computes in O(1) time (average).

source

pub fn replace_full(&mut self, value: T) -> (usize, Option<T>)

Adds a value to the set, replacing the existing value, if any, that is equal to the given one, without altering its insertion order. Returns the index of the item and its replaced value.

Computes in O(1) time (average).

source

pub fn difference<S2, 'a>( &'a self, other: &'a IndexSet<T, S2> ) -> Difference<'a, T, S2>
where S2: BuildHasher,

Return an iterator over the values that are in self but not other.

Values are produced in the same order that they appear in self.

source

pub fn symmetric_difference<S2, 'a>( &'a self, other: &'a IndexSet<T, S2> ) -> SymmetricDifference<'a, T, S, S2>
where S2: BuildHasher,

Return an iterator over the values that are in self or other, but not in both.

Values from self are produced in their original order, followed by values from other in their original order.

source

pub fn intersection<S2, 'a>( &'a self, other: &'a IndexSet<T, S2> ) -> Intersection<'a, T, S2>
where S2: BuildHasher,

Return an iterator over the values that are in both self and other.

Values are produced in the same order that they appear in self.

source

pub fn union<S2, 'a>(&'a self, other: &'a IndexSet<T, S2>) -> Union<'a, T, S>
where S2: BuildHasher,

Return an iterator over all values that are in self or other.

Values from self are produced in their original order, followed by values that are unique to other in their original order.

source

pub fn splice<R, I>( &mut self, range: R, replace_with: I ) -> Splice<'_, <I as IntoIterator>::IntoIter, T, S>
where R: RangeBounds<usize>, I: IntoIterator<Item = T>,

Creates a splicing iterator that replaces the specified range in the set with the given replace_with iterator and yields the removed items. replace_with does not need to be the same length as range.

The range is removed even if the iterator is not consumed until the end. It is unspecified how many elements are removed from the set if the Splice value is leaked.

The input iterator replace_with is only consumed when the Splice value is dropped. If a value from the iterator matches an existing entry in the set (outside of range), then the original will be unchanged. Otherwise, the new value will be inserted in the replaced range.

Panics if the starting point is greater than the end point or if the end point is greater than the length of the set.

§Examples
use indexmap::IndexSet;

let mut set = IndexSet::from([0, 1, 2, 3, 4]);
let new = [5, 4, 3, 2, 1];
let removed: Vec<_> = set.splice(2..4, new).collect();

// 1 and 4 kept their positions, while 5, 3, and 2 were newly inserted.
assert!(set.into_iter().eq([0, 1, 5, 3, 2, 4]));
assert_eq!(removed, &[2, 3]);
source

pub fn contains<Q>(&self, value: &Q) -> bool
where Q: Hash + Equivalent<T> + ?Sized,

Return true if an equivalent to value exists in the set.

Computes in O(1) time (average).

source

pub fn get<Q>(&self, value: &Q) -> Option<&T>
where Q: Hash + Equivalent<T> + ?Sized,

Return a reference to the value stored in the set, if it is present, else None.

Computes in O(1) time (average).

source

pub fn get_full<Q>(&self, value: &Q) -> Option<(usize, &T)>
where Q: Hash + Equivalent<T> + ?Sized,

Return item index and value

source

pub fn get_index_of<Q>(&self, value: &Q) -> Option<usize>
where Q: Hash + Equivalent<T> + ?Sized,

Return item index, if it exists in the set

Computes in O(1) time (average).

source

pub fn remove<Q>(&mut self, value: &Q) -> bool
where Q: Hash + Equivalent<T> + ?Sized,

👎Deprecated: remove disrupts the set order – use swap_remove or shift_remove for explicit behavior.

Remove the value from the set, and return true if it was present.

NOTE: This is equivalent to .swap_remove(value), replacing this value’s position with the last element, and it is deprecated in favor of calling that explicitly. If you need to preserve the relative order of the values in the set, use .shift_remove(value) instead.

source

pub fn swap_remove<Q>(&mut self, value: &Q) -> bool
where Q: Hash + Equivalent<T> + ?Sized,

Remove the value from the set, and return true if it was present.

Like Vec::swap_remove, the value is removed by swapping it with the last element of the set and popping it off. This perturbs the position of what used to be the last element!

Return false if value was not in the set.

Computes in O(1) time (average).

source

pub fn shift_remove<Q>(&mut self, value: &Q) -> bool
where Q: Hash + Equivalent<T> + ?Sized,

Remove the value from the set, and return true if it was present.

Like Vec::remove, the value is removed by shifting all of the elements that follow it, preserving their relative order. This perturbs the index of all of those elements!

Return false if value was not in the set.

Computes in O(n) time (average).

source

pub fn take<Q>(&mut self, value: &Q) -> Option<T>
where Q: Hash + Equivalent<T> + ?Sized,

👎Deprecated: take disrupts the set order – use swap_take or shift_take for explicit behavior.

Removes and returns the value in the set, if any, that is equal to the given one.

NOTE: This is equivalent to .swap_take(value), replacing this value’s position with the last element, and it is deprecated in favor of calling that explicitly. If you need to preserve the relative order of the values in the set, use .shift_take(value) instead.

source

pub fn swap_take<Q>(&mut self, value: &Q) -> Option<T>
where Q: Hash + Equivalent<T> + ?Sized,

Removes and returns the value in the set, if any, that is equal to the given one.

Like Vec::swap_remove, the value is removed by swapping it with the last element of the set and popping it off. This perturbs the position of what used to be the last element!

Return None if value was not in the set.

Computes in O(1) time (average).

source

pub fn shift_take<Q>(&mut self, value: &Q) -> Option<T>
where Q: Hash + Equivalent<T> + ?Sized,

Removes and returns the value in the set, if any, that is equal to the given one.

Like Vec::remove, the value is removed by shifting all of the elements that follow it, preserving their relative order. This perturbs the index of all of those elements!

Return None if value was not in the set.

Computes in O(n) time (average).

source

pub fn swap_remove_full<Q>(&mut self, value: &Q) -> Option<(usize, T)>
where Q: Hash + Equivalent<T> + ?Sized,

Remove the value from the set return it and the index it had.

Like Vec::swap_remove, the value is removed by swapping it with the last element of the set and popping it off. This perturbs the position of what used to be the last element!

Return None if value was not in the set.

source

pub fn shift_remove_full<Q>(&mut self, value: &Q) -> Option<(usize, T)>
where Q: Hash + Equivalent<T> + ?Sized,

Remove the value from the set return it and the index it had.

Like Vec::remove, the value is removed by shifting all of the elements that follow it, preserving their relative order. This perturbs the index of all of those elements!

Return None if value was not in the set.

source

pub fn pop(&mut self) -> Option<T>

Remove the last value

This preserves the order of the remaining elements.

Computes in O(1) time (average).

source

pub fn retain<F>(&mut self, keep: F)
where F: FnMut(&T) -> bool,

Scan through each value in the set and keep those where the closure keep returns true.

The elements are visited in order, and remaining elements keep their order.

Computes in O(n) time (average).

source

pub fn sort(&mut self)
where T: Ord,

Sort the set’s values by their default ordering.

See sort_by for details.

source

pub fn sort_by<F>(&mut self, cmp: F)
where F: FnMut(&T, &T) -> Ordering,

Sort the set’s values in place using the comparison function cmp.

Computes in O(n log n) time and O(n) space. The sort is stable.

source

pub fn sort_unstable(&mut self)
where T: Ord,

Sort the set’s values by their default ordering.

See sort_unstable_by for details.

source

pub fn sort_unstable_by<F>(&mut self, cmp: F)
where F: FnMut(&T, &T) -> Ordering,

Sort the set’s values in place using the comparison function cmp.

Computes in O(n log n) time. The sort is unstable.

source

pub fn sort_by_cached_key<K, F>(&mut self, sort_key: F)
where K: Ord, F: FnMut(&T) -> K,

Sort the set’s values in place using a key extraction function.

During sorting, the function is called at most once per entry, by using temporary storage to remember the results of its evaluation. The order of calls to the function is unspecified and may change between versions of indexmap or the standard library.

Computes in O(m n + n log n + c) time () and O(n) space, where the function is O(m), n is the length of the map, and c the capacity. The sort is stable.

Search over a sorted set for a value.

Returns the position where that value is present, or the position where it can be inserted to maintain the sort. See slice::binary_search for more details.

Computes in O(log(n)) time, which is notably less scalable than looking the value up using get_index_of, but this can also position missing values.

source

pub fn binary_search_by<'a, F>(&'a self, f: F) -> Result<usize, usize>
where F: FnMut(&'a T) -> Ordering,

Search over a sorted set with a comparator function.

Returns the position where that value is present, or the position where it can be inserted to maintain the sort. See slice::binary_search_by for more details.

Computes in O(log(n)) time.

source

pub fn binary_search_by_key<'a, B, F>( &'a self, b: &B, f: F ) -> Result<usize, usize>
where F: FnMut(&'a T) -> B, B: Ord,

Search over a sorted set with an extraction function.

Returns the position where that value is present, or the position where it can be inserted to maintain the sort. See slice::binary_search_by_key for more details.

Computes in O(log(n)) time.

source

pub fn partition_point<P>(&self, pred: P) -> usize
where P: FnMut(&T) -> bool,

Returns the index of the partition point of a sorted set according to the given predicate (the index of the first element of the second partition).

See slice::partition_point for more details.

Computes in O(log(n)) time.

source

pub fn reverse(&mut self)

Reverses the order of the set’s values in place.

Computes in O(n) time and O(1) space.

source

pub fn as_slice(&self) -> &Slice<T>

Returns a slice of all the values in the set.

Computes in O(1) time.

source

pub fn get_index(&self, index: usize) -> Option<&T>

Get a value by index

Valid indices are 0 <= index < self.len()

Computes in O(1) time.

source

pub fn get_range<R>(&self, range: R) -> Option<&Slice<T>>
where R: RangeBounds<usize>,

Returns a slice of values in the given range of indices.

Valid indices are 0 <= index < self.len()

Computes in O(1) time.

source

pub fn first(&self) -> Option<&T>

Get the first value

Computes in O(1) time.

source

pub fn last(&self) -> Option<&T>

Get the last value

Computes in O(1) time.

source

pub fn swap_remove_index(&mut self, index: usize) -> Option<T>

Remove the value by index

Valid indices are 0 <= index < self.len()

Like Vec::swap_remove, the value is removed by swapping it with the last element of the set and popping it off. This perturbs the position of what used to be the last element!

Computes in O(1) time (average).

source

pub fn shift_remove_index(&mut self, index: usize) -> Option<T>

Remove the value by index

Valid indices are 0 <= index < self.len()

Like Vec::remove, the value is removed by shifting all of the elements that follow it, preserving their relative order. This perturbs the index of all of those elements!

Computes in O(n) time (average).

source

pub fn move_index(&mut self, from: usize, to: usize)

Moves the position of a value from one index to another by shifting all other values in-between.

  • If from < to, the other values will shift down while the targeted value moves up.
  • If from > to, the other values will shift up while the targeted value moves down.

Panics if from or to are out of bounds.

Computes in O(n) time (average).

source

pub fn swap_indices(&mut self, a: usize, b: usize)

Swaps the position of two values in the set.

Panics if a or b are out of bounds.

source

pub fn is_disjoint<S2>(&self, other: &IndexSet<T, S2>) -> bool
where S2: BuildHasher,

Returns true if self has no elements in common with other.

source

pub fn is_subset<S2>(&self, other: &IndexSet<T, S2>) -> bool
where S2: BuildHasher,

Returns true if all elements of self are contained in other.

source

pub fn is_superset<S2>(&self, other: &IndexSet<T, S2>) -> bool
where S2: BuildHasher,

Returns true if all elements of other are contained in self.

source

pub fn par_difference<S2, 'a>( &'a self, other: &'a IndexSet<T, S2> ) -> ParDifference<'a, T, S, S2>
where S2: BuildHasher + Sync,

Return a parallel iterator over the values that are in self but not other.

While parallel iterators can process items in any order, their relative order in the self set is still preserved for operations like reduce and collect.

source

pub fn par_symmetric_difference<S2, 'a>( &'a self, other: &'a IndexSet<T, S2> ) -> ParSymmetricDifference<'a, T, S, S2>
where S2: BuildHasher + Sync,

Return a parallel iterator over the values that are in self or other, but not in both.

While parallel iterators can process items in any order, their relative order in the sets is still preserved for operations like reduce and collect. Values from self are produced in their original order, followed by values from other in their original order.

source

pub fn par_intersection<S2, 'a>( &'a self, other: &'a IndexSet<T, S2> ) -> ParIntersection<'a, T, S, S2>
where S2: BuildHasher + Sync,

Return a parallel iterator over the values that are in both self and other.

While parallel iterators can process items in any order, their relative order in the self set is still preserved for operations like reduce and collect.

source

pub fn par_union<S2, 'a>( &'a self, other: &'a IndexSet<T, S2> ) -> ParUnion<'a, T, S, S2>
where S2: BuildHasher + Sync,

Return a parallel iterator over all values that are in self or other.

While parallel iterators can process items in any order, their relative order in the sets is still preserved for operations like reduce and collect. Values from self are produced in their original order, followed by values that are unique to other in their original order.

source

pub fn par_eq<S2>(&self, other: &IndexSet<T, S2>) -> bool
where S2: BuildHasher + Sync,

Returns true if self contains all of the same values as other, regardless of each set’s indexed order, determined in parallel.

source

pub fn par_is_disjoint<S2>(&self, other: &IndexSet<T, S2>) -> bool
where S2: BuildHasher + Sync,

Returns true if self has no elements in common with other, determined in parallel.

source

pub fn par_is_superset<S2>(&self, other: &IndexSet<T, S2>) -> bool
where S2: BuildHasher + Sync,

Returns true if all elements of other are contained in self, determined in parallel.

source

pub fn par_is_subset<S2>(&self, other: &IndexSet<T, S2>) -> bool
where S2: BuildHasher + Sync,

Returns true if all elements of self are contained in other, determined in parallel.

source

pub fn par_sort(&mut self)
where T: Ord,

Sort the set’s values in parallel by their default ordering.

source

pub fn par_sort_by<F>(&mut self, cmp: F)
where F: Fn(&T, &T) -> Ordering + Sync,

Sort the set’s values in place and in parallel, using the comparison function cmp.

source

pub fn par_sort_unstable(&mut self)
where T: Ord,

Sort the set’s values in parallel by their default ordering.

source

pub fn par_sort_unstable_by<F>(&mut self, cmp: F)
where F: Fn(&T, &T) -> Ordering + Sync,

Sort the set’s values in place and in parallel, using the comparison function cmp.

source

pub fn par_sort_by_cached_key<K, F>(&mut self, sort_key: F)
where K: Ord + Send, F: Fn(&T) -> K + Sync,

Sort the set’s values in place and in parallel, using a key extraction function.

Trait Implementations§

source§

impl<T: Ordered> BitAnd<&OrderedSet<T>> for OrderedSet<T>

§

type Output = OrderedSet<T>

The resulting type after applying the & operator.
source§

fn bitand(self, other: &Self) -> Self::Output

Performs the & operation. Read more
source§

impl<T: Ordered> BitAndAssign<&OrderedSet<T>> for OrderedSet<T>

source§

fn bitand_assign(&mut self, other: &Self)

Performs the &= operation. Read more
source§

impl<T: Ordered> BitOr<&OrderedSet<T>> for OrderedSet<T>

§

type Output = OrderedSet<T>

The resulting type after applying the | operator.
source§

fn bitor(self, other: &Self) -> Self::Output

Performs the | operation. Read more
source§

impl<T: Ordered> BitOrAssign<&OrderedSet<T>> for OrderedSet<T>

source§

fn bitor_assign(&mut self, other: &Self)

Performs the |= operation. Read more
source§

impl<T: Ordered> BitXor<&OrderedSet<T>> for OrderedSet<T>

§

type Output = OrderedSet<T>

The resulting type after applying the ^ operator.
source§

fn bitxor(self, other: &Self) -> Self::Output

Performs the ^ operation. Read more
source§

impl<T: Ordered> BitXorAssign<&OrderedSet<T>> for OrderedSet<T>

source§

fn bitxor_assign(&mut self, other: &Self)

Performs the ^= operation. Read more
source§

impl<T: Clone + Ordered> Clone for OrderedSet<T>

source§

fn clone(&self) -> OrderedSet<T>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<T: Debug + Ordered> Debug for OrderedSet<T>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<T: Ordered> Default for OrderedSet<T>

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl<T: Ordered> Deref for OrderedSet<T>

§

type Target = IndexSet<T>

The resulting type after dereferencing.
source§

fn deref(&self) -> &Self::Target

Dereferences the value.
source§

impl<T: Ordered> DerefMut for OrderedSet<T>

source§

fn deref_mut(&mut self) -> &mut Self::Target

Mutably dereferences the value.
source§

impl<'de, T: Ordered + Deserialize<'de>> Deserialize<'de> for OrderedSet<T>

source§

fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
where D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
source§

impl<T: Ordered, const N: usize> From<[T; N]> for OrderedSet<T>

source§

fn from(arr: [T; N]) -> Self

Converts to this type from the input type.
source§

impl<T: Ordered> FromIterator<T> for OrderedSet<T>

source§

fn from_iter<I: IntoIterator<Item = T>>(iterable: I) -> Self

Creates a value from an iterator. Read more
source§

impl<T: Ordered> Hash for OrderedSet<T>

source§

fn hash<H: Hasher>(&self, state: &mut H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl<'a, T: Ordered> IntoIterator for &'a OrderedSet<T>

§

type Item = &'a T

The type of the elements being iterated over.
§

type IntoIter = Iter<'a, T>

Which kind of iterator are we turning this into?
source§

fn into_iter(self) -> Self::IntoIter

Creates an iterator from a value. Read more
source§

impl<T: Ordered> IntoIterator for OrderedSet<T>

§

type Item = T

The type of the elements being iterated over.
§

type IntoIter = IntoIter<T>

Which kind of iterator are we turning this into?
source§

fn into_iter(self) -> Self::IntoIter

Creates an iterator from a value. Read more
source§

impl<T: Ordered> Ord for OrderedSet<T>

source§

fn cmp(&self, other: &Self) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized + PartialOrd,

Restrict a value to a certain interval. Read more
source§

impl<T: Ordered> PartialEq for OrderedSet<T>

source§

fn eq(&self, other: &Self) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<T: Ordered> PartialOrd for OrderedSet<T>

source§

fn partial_cmp(&self, other: &Self) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

fn lt(&self, other: &Rhs) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

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
1.0.0 · source§

fn gt(&self, other: &Rhs) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

fn ge(&self, other: &Rhs) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more
source§

impl Restriction<&OrderedSet<String>> for OrderedSetRestrict<String, Restrict>

source§

fn matches(&self, val: &OrderedSet<String>) -> bool

source§

impl Restriction<&OrderedSet<String>> for Restrict<Restrict>

source§

fn matches(&self, val: &OrderedSet<String>) -> bool

source§

impl<T: Ordered> Sub<&OrderedSet<T>> for OrderedSet<T>

§

type Output = OrderedSet<T>

The resulting type after applying the - operator.
source§

fn sub(self, other: &Self) -> Self::Output

Performs the - operation. Read more
source§

impl<T: Ordered> SubAssign<&OrderedSet<T>> for OrderedSet<T>

source§

fn sub_assign(&mut self, other: &Self)

Performs the -= operation. Read more
source§

impl<T: Ordered> Eq for OrderedSet<T>

Auto Trait Implementations§

§

impl<T> RefUnwindSafe for OrderedSet<T>
where T: RefUnwindSafe,

§

impl<T> Send for OrderedSet<T>
where T: Send,

§

impl<T> Sync for OrderedSet<T>
where T: Sync,

§

impl<T> Unpin for OrderedSet<T>
where T: Unpin,

§

impl<T> UnwindSafe for OrderedSet<T>
where T: UnwindSafe,

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<Q, K> Comparable<K> for Q
where Q: Ord + ?Sized, K: Borrow<Q> + ?Sized,

§

fn compare(&self, key: &K) -> Ordering

Compare self to key and return their ordering.
§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

source§

impl<T> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

source§

impl<T> Ordered for T
where T: Debug + PartialEq + Eq + PartialOrd + Ord + Clone + Hash,

§

impl<T> Sequence for T
where T: Eq + Hash,