KnownMailboxesStore

Trait KnownMailboxesStore 

Source
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§

Source

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.

Source

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.

Source

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.

Source

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.

Source

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,

Increments the success count for a mailbox.

Source

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,

Increments the failure count for a mailbox.

Implementors§