pub struct AddrManager { /* private fields */ }Expand description
Address manager
Implementations§
Source§impl AddrManager
impl AddrManager
Sourcepub fn fetch_random<F>(&mut self, count: usize, filter: F) -> Vec<AddrInfo>
pub fn fetch_random<F>(&mut self, count: usize, filter: F) -> Vec<AddrInfo>
Randomly return addrs that worth to try or connect.
Sourcepub fn addrs_iter(&self) -> impl Iterator<Item = &AddrInfo>
pub fn addrs_iter(&self) -> impl Iterator<Item = &AddrInfo>
Addresses iterator
Sourcepub fn remove(&mut self, addr: &Multiaddr) -> Option<AddrInfo>
pub fn remove(&mut self, addr: &Multiaddr) -> Option<AddrInfo>
Remove an address by ip and port
Trait Implementations§
Source§impl Default for AddrManager
impl Default for AddrManager
Source§fn default() -> AddrManager
fn default() -> AddrManager
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for AddrManager
impl RefUnwindSafe for AddrManager
impl Send for AddrManager
impl Sync for AddrManager
impl Unpin for AddrManager
impl UnwindSafe for AddrManager
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
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