Struct tor_linkspec::RelayIdSet
source · [−]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
sourceimpl 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
sourceimpl Clone for RelayIdSet
impl Clone for RelayIdSet
sourcefn clone(&self) -> RelayIdSet
fn clone(&self) -> RelayIdSet
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for RelayIdSet
impl Debug for RelayIdSet
sourceimpl Default for RelayIdSet
impl Default for RelayIdSet
sourcefn default() -> RelayIdSet
fn default() -> RelayIdSet
Returns the “default value” for a type. Read more
sourceimpl<'de> Deserialize<'de> for RelayIdSet
impl<'de> Deserialize<'de> for RelayIdSet
sourcefn 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
sourceimpl<ID: Into<RelayId>> Extend<ID> for RelayIdSet
impl<ID: Into<RelayId>> Extend<ID> for RelayIdSet
sourcefn 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
sourcefn extend_one(&mut self, item: A)
fn extend_one(&mut self, item: A)
extend_one
)Extends a collection with exactly one element.
sourcefn extend_reserve(&mut self, additional: usize)
fn extend_reserve(&mut self, additional: usize)
extend_one
)Reserves capacity in a collection for the given number of additional elements. Read more
sourceimpl FromIterator<RelayId> for RelayIdSet
impl FromIterator<RelayId> for RelayIdSet
sourcefn from_iter<T: IntoIterator<Item = RelayId>>(iter: T) -> Self
fn from_iter<T: IntoIterator<Item = RelayId>>(iter: T) -> Self
Creates a value from an iterator. Read more
sourceimpl PartialEq<RelayIdSet> for RelayIdSet
impl PartialEq<RelayIdSet> for RelayIdSet
sourcefn eq(&self, other: &RelayIdSet) -> bool
fn eq(&self, other: &RelayIdSet) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
sourceimpl Serialize for RelayIdSet
impl Serialize for RelayIdSet
impl Eq for RelayIdSet
impl StructuralEq for RelayIdSet
impl StructuralPartialEq for RelayIdSet
Auto Trait Implementations
impl RefUnwindSafe for RelayIdSet
impl Send for RelayIdSet
impl Sync for RelayIdSet
impl Unpin for RelayIdSet
impl UnwindSafe for RelayIdSet
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more