Trait Store
pub trait Store {
type FromStore: Debug + Send;
// Required methods
fn on_swarm_event(&mut self, event: &FromSwarm<'_>);
fn addresses_of_peer(
&self,
peer: &PeerId,
) -> Option<impl Iterator<Item = &Multiaddr>>;
fn poll(&mut self, cx: &mut Context<'_>) -> Option<Event<Self::FromStore>>;
}
Available on crate feature
peer-store
only.Expand description
A store that contains all observed addresses of peers.
Required Associated Types§
Required Methods§
fn on_swarm_event(&mut self, event: &FromSwarm<'_>)
fn on_swarm_event(&mut self, event: &FromSwarm<'_>)
How this store handles events from Swarm
.
fn addresses_of_peer(
&self,
peer: &PeerId,
) -> Option<impl Iterator<Item = &Multiaddr>>
fn addresses_of_peer( &self, peer: &PeerId, ) -> Option<impl Iterator<Item = &Multiaddr>>
Get all stored addresses of the peer.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.