pub trait KnownMailboxesStore: Send + Sync {
// Required methods
fn add_mailbox<'life0, 'async_trait>(
&'life0 self,
mailbox: KnownMailbox,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn get_mailbox<'life0, 'life1, 'async_trait>(
&'life0 self,
peer_id: &'life1 PeerId,
) -> Pin<Box<dyn Future<Output = Result<Option<KnownMailbox>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn list_mailboxes<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<KnownMailbox>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn remove_mailbox<'life0, 'life1, 'async_trait>(
&'life0 self,
peer_id: &'life1 PeerId,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn increment_success<'life0, 'life1, 'async_trait>(
&'life0 self,
peer_id: &'life1 PeerId,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn increment_failure<'life0, 'life1, 'async_trait>(
&'life0 self,
peer_id: &'life1 PeerId,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
}Expand description
A trait for managing known mailbox nodes.
Required Methods§
Sourcefn add_mailbox<'life0, 'async_trait>(
&'life0 self,
mailbox: KnownMailbox,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn add_mailbox<'life0, 'async_trait>(
&'life0 self,
mailbox: KnownMailbox,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Adds a new KnownMailbox to the store.
Sourcefn get_mailbox<'life0, 'life1, 'async_trait>(
&'life0 self,
peer_id: &'life1 PeerId,
) -> Pin<Box<dyn Future<Output = Result<Option<KnownMailbox>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_mailbox<'life0, 'life1, 'async_trait>(
&'life0 self,
peer_id: &'life1 PeerId,
) -> Pin<Box<dyn Future<Output = Result<Option<KnownMailbox>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Retrieves a KnownMailbox by its PeerId.
Sourcefn list_mailboxes<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<KnownMailbox>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn list_mailboxes<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<KnownMailbox>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Lists all known mailboxes.
Sourcefn remove_mailbox<'life0, 'life1, 'async_trait>(
&'life0 self,
peer_id: &'life1 PeerId,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn remove_mailbox<'life0, 'life1, 'async_trait>(
&'life0 self,
peer_id: &'life1 PeerId,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Removes a KnownMailbox from the store.