pub trait PeerDirectory: Send + Sync {
// Required methods
fn lookup_x25519<'life0, 'life1, 'async_trait>(
&'life0 self,
peer: &'life1 NodeId,
) -> Pin<Box<dyn Future<Output = Option<[u8; 32]>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn lookup_name<'life0, 'life1, 'async_trait>(
&'life0 self,
peer: &'life1 NodeId,
) -> Pin<Box<dyn Future<Output = Option<String>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn subscribe(&self) -> Receiver<PeerDirectoryEvent>;
}Expand description
Read-mostly access to the daemon’s keystore of known peers.
The implementation lives in pim-daemon; plugins receive it as
Arc<dyn PeerDirectory> through PluginContext.
Required Methods§
Sourcefn lookup_x25519<'life0, 'life1, 'async_trait>(
&'life0 self,
peer: &'life1 NodeId,
) -> Pin<Box<dyn Future<Output = Option<[u8; 32]>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn lookup_x25519<'life0, 'life1, 'async_trait>(
&'life0 self,
peer: &'life1 NodeId,
) -> Pin<Box<dyn Future<Output = Option<[u8; 32]>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Latest cached X25519 public key for peer, if known.
Sourcefn lookup_name<'life0, 'life1, 'async_trait>(
&'life0 self,
peer: &'life1 NodeId,
) -> Pin<Box<dyn Future<Output = Option<String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn lookup_name<'life0, 'life1, 'async_trait>(
&'life0 self,
peer: &'life1 NodeId,
) -> Pin<Box<dyn Future<Output = Option<String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Latest friendly name observed for peer, if known.
Sourcefn subscribe(&self) -> Receiver<PeerDirectoryEvent>
fn subscribe(&self) -> Receiver<PeerDirectoryEvent>
Subscribe to identity-state events. Each subscriber gets every event emitted after the moment of subscription.