Struct hashlink::linked_hash_set::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,

§

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,

§

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,

§

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>

§

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) -> Iter<'a, T>

Creates an iterator from a value. Read more
source§

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

§

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

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<'a, 'b, T, S> Sub<&'b LinkedHashSet<T, S>> for &'a LinkedHashSet<T, S>
where T: Eq + Hash + Clone, S: BuildHasher + Default,

§

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§

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

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

§

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.