Skip to main content

SyncProtocol

Trait SyncProtocol 

Source
pub trait SyncProtocol: Send + Sync {
    // Required methods
    fn send_event(
        &self,
        target: &NodeId,
        event: &SyncEvent,
    ) -> Result<(), AdapterError>;
    fn broadcast_event(&self, event: &SyncEvent) -> Result<(), AdapterError>;
    fn receive_events(&self) -> Result<Vec<SyncEvent>, AdapterError>;
}
Expand description

Protocol for transmitting sync events.

Required Methods§

Source

fn send_event( &self, target: &NodeId, event: &SyncEvent, ) -> Result<(), AdapterError>

Send an event to a specific node.

Source

fn broadcast_event(&self, event: &SyncEvent) -> Result<(), AdapterError>

Broadcast an event to all nodes.

Source

fn receive_events(&self) -> Result<Vec<SyncEvent>, AdapterError>

Receive pending events from the network.

Implementors§