NetworkEventHandler

Trait NetworkEventHandler 

Source
pub trait NetworkEventHandler: Send + Sync {
    // Required methods
    fn on_node_connected<'life0, 'async_trait>(
        &'life0 self,
        node_id: NodeId,
    ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn on_node_disconnected<'life0, 'async_trait>(
        &'life0 self,
        node_id: NodeId,
    ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn on_network_partition<'life0, 'async_trait>(
        &'life0 self,
        active_nodes: HashSet<NodeId>,
    ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn on_quorum_lost<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn on_quorum_restored<'life0, 'async_trait>(
        &'life0 self,
        active_nodes: HashSet<NodeId>,
    ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}

Required Methods§

Source

fn on_node_connected<'life0, 'async_trait>( &'life0 self, node_id: NodeId, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source

fn on_node_disconnected<'life0, 'async_trait>( &'life0 self, node_id: NodeId, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source

fn on_network_partition<'life0, 'async_trait>( &'life0 self, active_nodes: HashSet<NodeId>, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source

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

Source

fn on_quorum_restored<'life0, 'async_trait>( &'life0 self, active_nodes: HashSet<NodeId>, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Implementors§