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