pub struct RelayIdSet { /* private fields */ }
Expand description
A set of relay identities, backed by HashSet
.
§Note
I’d rather use HashSet
entirely, but that doesn’t let us index by
RelayIdRef.
Implementations§
Source§impl RelayIdSet
impl RelayIdSet
Sourcepub fn insert<T: Into<RelayId>>(&mut self, key: T) -> bool
pub fn insert<T: Into<RelayId>>(&mut self, key: T) -> bool
Insert key
into this set.
Return true if it was not already there.
Sourcepub fn remove<'a, T: Into<RelayIdRef<'a>>>(&mut self, key: T) -> bool
pub fn remove<'a, T: Into<RelayIdRef<'a>>>(&mut self, key: T) -> bool
Remove key
from the set.
Return true if key
was present.
Sourcepub fn contains<'a, T: Into<RelayIdRef<'a>>>(&self, key: T) -> bool
pub fn contains<'a, T: Into<RelayIdRef<'a>>>(&self, key: T) -> bool
Return true if key
is a member of this set.
Sourcepub fn iter(&self) -> impl Iterator<Item = RelayIdRef<'_>>
pub fn iter(&self) -> impl Iterator<Item = RelayIdRef<'_>>
Return an iterator over the members of this set.
The ordering of the iterator is undefined; do not rely on it.
Trait Implementations§
Source§impl Clone for RelayIdSet
impl Clone for RelayIdSet
Source§fn clone(&self) -> RelayIdSet
fn clone(&self) -> RelayIdSet
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for RelayIdSet
impl Debug for RelayIdSet
Source§impl Default for RelayIdSet
impl Default for RelayIdSet
Source§fn default() -> RelayIdSet
fn default() -> RelayIdSet
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for RelayIdSet
impl<'de> Deserialize<'de> for RelayIdSet
Source§fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
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<ID: Into<RelayId>> Extend<ID> for RelayIdSet
impl<ID: Into<RelayId>> Extend<ID> for RelayIdSet
Source§fn extend<T: IntoIterator<Item = ID>>(&mut self, iter: T)
fn extend<T: IntoIterator<Item = ID>>(&mut self, iter: T)
Extends a collection with the contents of an iterator. Read more
Source§fn extend_one(&mut self, item: A)
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)
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 FromIterator<RelayId> for RelayIdSet
impl FromIterator<RelayId> for RelayIdSet
Source§impl PartialEq for RelayIdSet
impl PartialEq for RelayIdSet
Source§impl Serialize for RelayIdSet
impl Serialize for RelayIdSet
impl Eq for RelayIdSet
impl StructuralPartialEq for RelayIdSet
Auto Trait Implementations§
impl Freeze for RelayIdSet
impl RefUnwindSafe for RelayIdSet
impl Send for RelayIdSet
impl Sync for RelayIdSet
impl Unpin for RelayIdSet
impl UnwindSafe for RelayIdSet
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
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
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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>
Converts
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>
Converts
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