pub struct KnownPeersManager { /* private fields */ }
Expand description
Handles networking parameters. It manages network parameters set and its persistence.
Implementations§
source§impl KnownPeersManager
impl KnownPeersManager
sourcepub fn new(
config: KnownPeersManagerConfig,
) -> Result<Self, KnownPeersManagerPersistenceError>
pub fn new( config: KnownPeersManagerConfig, ) -> Result<Self, KnownPeersManagerPersistenceError>
Object constructor.
sourcepub fn boxed(self) -> Box<dyn KnownPeersRegistry>
pub fn boxed(self) -> Box<dyn KnownPeersRegistry>
Creates a reference to the NetworkingParametersRegistry
trait implementation.
Trait Implementations§
source§impl Drop for KnownPeersManager
impl Drop for KnownPeersManager
source§impl KnownPeersRegistry for KnownPeersManager
impl KnownPeersRegistry for KnownPeersManager
source§fn add_known_peer<'life0, 'async_trait>(
&'life0 mut self,
peer_id: PeerId,
addresses: Vec<Multiaddr>,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn add_known_peer<'life0, 'async_trait>(
&'life0 mut self,
peer_id: PeerId,
addresses: Vec<Multiaddr>,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Registers a peer ID and associated addresses
source§fn remove_known_peer_addresses<'life0, 'async_trait>(
&'life0 mut self,
peer_id: PeerId,
addresses: Vec<Multiaddr>,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn remove_known_peer_addresses<'life0, 'async_trait>(
&'life0 mut self,
peer_id: PeerId,
addresses: Vec<Multiaddr>,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Unregisters associated addresses for peer ID.
source§fn remove_all_known_peer_addresses(&mut self, peer_id: PeerId)
fn remove_all_known_peer_addresses(&mut self, peer_id: PeerId)
Unregisters associated addresses for peer ID.
source§fn all_known_peers<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Vec<(PeerId, Vec<Multiaddr>)>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn all_known_peers<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Vec<(PeerId, Vec<Multiaddr>)>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Returns all known peers and their addresses without P2P suffix at the end
source§fn run<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn run<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Drive async work in the persistence provider
source§fn on_unreachable_address(
&mut self,
handler: Arc<dyn Fn(&PeerAddressRemovedEvent) + Send + Sync + 'static>,
) -> Option<HandlerId>
fn on_unreachable_address( &mut self, handler: Arc<dyn Fn(&PeerAddressRemovedEvent) + Send + Sync + 'static>, ) -> Option<HandlerId>
Triggers when we removed the peer address from the permanent storage. Returns optional
event HandlerId. Option enables stub implementation. One of the usages is to notify
Kademlia about the expired(unreachable) address when it check for how long address was
unreachable.
Auto Trait Implementations§
impl Freeze for KnownPeersManager
impl !RefUnwindSafe for KnownPeersManager
impl Send for KnownPeersManager
impl Sync for KnownPeersManager
impl Unpin for KnownPeersManager
impl !UnwindSafe for KnownPeersManager
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