Struct everscale_network::adnl::PeersSet
source · [−]pub struct PeersSet { /* private fields */ }Expand description
A set of unique short node ids
Implementations
sourceimpl PeersSet
impl PeersSet
pub fn with_capacity(capacity: usize) -> Self
pub fn version(&self) -> u64
pub fn contains(&self, peer: &NodeIdShort) -> bool
pub fn get(&self, index: usize) -> Option<NodeIdShort>
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
pub fn iter(&self) -> PeersCacheIter<'_>
pub fn get_random_peers(
&self,
amount: usize,
except: Option<&NodeIdShort>
) -> Vec<NodeIdShort>
pub fn randomly_fill_from(
&self,
other: &PeersSet,
amount: usize,
except: Option<&FxDashSet<NodeIdShort>>
)
sourcepub fn insert(&self, peer_id: NodeIdShort) -> bool
pub fn insert(&self, peer_id: NodeIdShort) -> bool
Adds a value to the set.
If the set did not have this value present, true is returned.
pub fn extend<I>(&self, peers: I) where
I: IntoIterator<Item = NodeIdShort>,
Trait Implementations
sourceimpl IntoIterator for PeersSet
impl IntoIterator for PeersSet
type Item = NodeIdShort
type Item = NodeIdShort
The type of the elements being iterated over.
type IntoIter = IntoIter<NodeIdShort, Global>
type IntoIter = IntoIter<NodeIdShort, Global>
Which kind of iterator are we turning this into?
sourceimpl<'a> IntoIterator for &'a PeersSet
impl<'a> IntoIterator for &'a PeersSet
Auto Trait Implementations
impl !RefUnwindSafe for PeersSet
impl Send for PeersSet
impl Sync for PeersSet
impl Unpin for PeersSet
impl UnwindSafe for PeersSet
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
sourceimpl<Choices> CoproductSubsetter<CNil, HNil> for Choices
impl<Choices> CoproductSubsetter<CNil, HNil> for Choices
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
fn vzip(self) -> V
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber to this type, returning a
WithDispatch wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber to this type, returning a
WithDispatch wrapper. Read more