Skip to main content

DistributedProtocol

Trait DistributedProtocol 

Source
pub trait DistributedProtocol: Send + Sync {
    // Required methods
    fn broadcast<'life0, 'async_trait>(
        &'life0 self,
        operation: CacheOperation,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn handle_operation<'life0, 'async_trait>(
        &'life0 self,
        operation: CacheOperation,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn sync_with_peer<'life0, 'life1, 'async_trait>(
        &'life0 self,
        peer_id: &'life1 str,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
}
Expand description

Distributed cache protocol

Required Methods§

Source

fn broadcast<'life0, 'async_trait>( &'life0 self, operation: CacheOperation, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Broadcast operation to peers

Source

fn handle_operation<'life0, 'async_trait>( &'life0 self, operation: CacheOperation, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Handle incoming operation

Source

fn sync_with_peer<'life0, 'life1, 'async_trait>( &'life0 self, peer_id: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Sync with peer

Implementors§