pub struct PeerIterator { /* private fields */ }Expand description
Holds only a SharedPeerTracker handle: each call locks the tracker briefly and synchronously, so concurrent walks
interleave freely and nothing is locked while the caller awaits its RPCs.
Implementations§
Source§impl PeerIterator
impl PeerIterator
pub fn new( tracker: SharedPeerTracker, bucket_location_id: Id, max_iterations_since_high_watermark: usize, cache_radius: Option<LeadingAgreementBits>, ) -> Self
pub fn next_peer(&mut self) -> Option<(Peer, LeadingAgreementBits)>
pub fn iterations_since_high_watermark(&self) -> usize
pub fn add_peers(&mut self, peers: Vec<Peer>)
pub fn remove_peer(&mut self, peer: &Peer)
Auto Trait Implementations§
impl Freeze for PeerIterator
impl !RefUnwindSafe for PeerIterator
impl Send for PeerIterator
impl Sync for PeerIterator
impl Unpin for PeerIterator
impl UnsafeUnpin for PeerIterator
impl !UnwindSafe for PeerIterator
Blanket Implementations§
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
§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