hashlink::linked_hash_set

Struct LinkedHashSet

Source
pub struct LinkedHashSet<T, S = DefaultHashBuilder> { /* private fields */ }

Implementations§

Source§

impl<T: Hash + Eq> LinkedHashSet<T, DefaultHashBuilder>

Source§

impl<T, S> LinkedHashSet<T, S>

Source

pub fn capacity(&self) -> usize

Source

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

Source

pub fn len(&self) -> usize

Source

pub fn is_empty(&self) -> bool

Source

pub fn drain(&mut self) -> Drain<'_, T>

Source

pub fn clear(&mut self)

Source

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

Source§

impl<T, S> LinkedHashSet<T, S>
where T: Eq + Hash, S: BuildHasher,

Source

pub fn with_hasher(hasher: S) -> LinkedHashSet<T, S>

Source

pub fn with_capacity_and_hasher( capacity: usize, hasher: S, ) -> LinkedHashSet<T, S>

Source

pub fn hasher(&self) -> &S

Source

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

Source

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

Source

pub fn shrink_to_fit(&mut self)

Source

pub fn difference<'a>( &'a self, other: &'a LinkedHashSet<T, S>, ) -> Difference<'a, T, S>

Source

pub fn symmetric_difference<'a>( &'a self, other: &'a LinkedHashSet<T, S>, ) -> SymmetricDifference<'a, T, S>

Source

pub fn intersection<'a>( &'a self, other: &'a LinkedHashSet<T, S>, ) -> Intersection<'a, T, S>

Source

pub fn union<'a>(&'a self, other: &'a LinkedHashSet<T, S>) -> Union<'a, T, S>

Source

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

Source

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

Source

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

Source

pub fn get_or_insert_with<Q, F>(&mut self, value: &Q, f: F) -> &T
where T: Borrow<Q>, Q: Hash + Eq + ?Sized, F: FnOnce(&Q) -> T,

Source

pub fn is_disjoint(&self, other: &LinkedHashSet<T, S>) -> bool

Source

pub fn is_subset(&self, other: &LinkedHashSet<T, S>) -> bool

Source

pub fn is_superset(&self, other: &LinkedHashSet<T, S>) -> bool

Source

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

Inserts the given value into the set.

If the set did not have this value present, inserts it at the back of the internal linked list and returns true, otherwise it moves the existing value to the back of the internal linked list and returns false.

Source

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

Adds the given value to the set, replacing the existing value.

If a previous value existed, returns the replaced value. In this case, the value’s position in the internal linked list is not changed.

Source

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

Source

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

Source

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

Source

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

Source

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

Source

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

Source

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

Source

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

Source

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

Trait Implementations§

Source§

impl<'a, 'b, T, S> BitAnd<&'b LinkedHashSet<T, S>> for &'a LinkedHashSet<T, S>
where T: Eq + Hash + Clone, S: BuildHasher + Default,

Source§

type Output = LinkedHashSet<T, S>

The resulting type after applying the & operator.
Source§

fn bitand(self, rhs: &LinkedHashSet<T, S>) -> LinkedHashSet<T, S>

Performs the & operation. Read more
Source§

impl<'a, 'b, T, S> BitOr<&'b LinkedHashSet<T, S>> for &'a LinkedHashSet<T, S>
where T: Eq + Hash + Clone, S: BuildHasher + Default,

Source§

type Output = LinkedHashSet<T, S>

The resulting type after applying the | operator.
Source§

fn bitor(self, rhs: &LinkedHashSet<T, S>) -> LinkedHashSet<T, S>

Performs the | operation. Read more
Source§

impl<'a, 'b, T, S> BitXor<&'b LinkedHashSet<T, S>> for &'a LinkedHashSet<T, S>
where T: Eq + Hash + Clone, S: BuildHasher + Default,

Source§

type Output = LinkedHashSet<T, S>

The resulting type after applying the ^ operator.
Source§

fn bitxor(self, rhs: &LinkedHashSet<T, S>) -> LinkedHashSet<T, S>

Performs the ^ operation. Read more
Source§

impl<T: Hash + Eq + Clone, S: BuildHasher + Clone> Clone for LinkedHashSet<T, S>

Source§

fn clone(&self) -> Self

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, S> Debug for LinkedHashSet<T, S>
where T: Debug,

Source§

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

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

impl<T, S> Default for LinkedHashSet<T, S>
where S: Default,

Source§

fn default() -> LinkedHashSet<T, S>

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

impl<'a, T, S> Extend<&'a T> for LinkedHashSet<T, S>
where T: 'a + Eq + Hash + Copy, S: BuildHasher,

Source§

fn extend<I: IntoIterator<Item = &'a T>>(&mut self, iter: I)

Extends a collection with the contents of an iterator. Read more
Source§

fn extend_one(&mut self, item: A)

🔬This is a nightly-only experimental API. (extend_one)
Extends a collection with exactly one element.
Source§

fn extend_reserve(&mut self, additional: usize)

🔬This is a nightly-only experimental API. (extend_one)
Reserves capacity in a collection for the given number of additional elements. Read more
Source§

impl<T, S> Extend<T> for LinkedHashSet<T, S>
where T: Eq + Hash, S: BuildHasher,

Source§

fn extend<I: IntoIterator<Item = T>>(&mut self, iter: I)

Extends a collection with the contents of an iterator. Read more
Source§

fn extend_one(&mut self, item: A)

🔬This is a nightly-only experimental API. (extend_one)
Extends a collection with exactly one element.
Source§

fn extend_reserve(&mut self, additional: usize)

🔬This is a nightly-only experimental API. (extend_one)
Reserves capacity in a collection for the given number of additional elements. Read more
Source§

impl<T, S> FromIterator<T> for LinkedHashSet<T, S>
where T: Eq + Hash, S: BuildHasher + Default,

Source§

fn from_iter<I: IntoIterator<Item = T>>(iter: I) -> LinkedHashSet<T, S>

Creates a value from an iterator. Read more
Source§

impl<T, S> Hash for LinkedHashSet<T, S>
where T: Eq + Hash, S: BuildHasher,

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, S> IntoIterator for &'a LinkedHashSet<T, S>

Source§

type Item = &'a T

The type of the elements being iterated over.
Source§

type IntoIter = Iter<'a, T>

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

fn into_iter(self) -> Iter<'a, T>

Creates an iterator from a value. Read more
Source§

impl<T, S> IntoIterator for LinkedHashSet<T, S>

Source§

type Item = T

The type of the elements being iterated over.
Source§

type IntoIter = IntoIter<T>

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

fn into_iter(self) -> IntoIter<T>

Creates an iterator from a value. Read more
Source§

impl<T, S> PartialEq for LinkedHashSet<T, S>
where T: Eq + Hash, S: BuildHasher,

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<'a, 'b, T, S> Sub<&'b LinkedHashSet<T, S>> for &'a LinkedHashSet<T, S>
where T: Eq + Hash + Clone, S: BuildHasher + Default,

Source§

type Output = LinkedHashSet<T, S>

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: &LinkedHashSet<T, S>) -> LinkedHashSet<T, S>

Performs the - operation. Read more
Source§

impl<T, S> Eq for LinkedHashSet<T, S>
where T: Eq + Hash, S: BuildHasher,

Auto Trait Implementations§

§

impl<T, S> Freeze for LinkedHashSet<T, S>
where S: Freeze,

§

impl<T, S> RefUnwindSafe for LinkedHashSet<T, S>

§

impl<T, S> Send for LinkedHashSet<T, S>
where T: Send, S: Send,

§

impl<T, S> Sync for LinkedHashSet<T, S>
where T: Sync, S: Sync,

§

impl<T, S> Unpin for LinkedHashSet<T, S>
where S: Unpin,

§

impl<T, S> UnwindSafe for LinkedHashSet<T, S>

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
Source§

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

Source§

unsafe fn clone_to_uninit(&self, dst: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
Source§

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

Source§

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

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

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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.

Source§

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

Source§

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>,

Source§

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>,

Source§

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.