ClusterNode

Trait ClusterNode 

Source
pub trait ClusterNode {
    type NodeType: Debug;
    type NodeIdType: Display + Clone + Debug + PartialEq + From<String> + Eq + Hash + Send + Sync;

    // Required methods
    fn send_message<'life0, 'async_trait>(
        &'life0 self,
        msg: Message<Self>,
    ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
       where Self: Sized + 'async_trait,
             'life0: 'async_trait;
    fn node_id(&self) -> &Self::NodeIdType;
}
Expand description

A Cluster node

Required Associated Types§

Source

type NodeType: Debug

concrete node type

Source

type NodeIdType: Display + Clone + Debug + PartialEq + From<String> + Eq + Hash + Send + Sync

Type of node identifier, can be string or integer or any other type

Required Methods§

Source

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

send messages to the node

Source

fn node_id(&self) -> &Self::NodeIdType

unique node identifier

Implementors§