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§
Sourcefn send_event(
&self,
target: &NodeId,
event: &SyncEvent,
) -> Result<(), AdapterError>
fn send_event( &self, target: &NodeId, event: &SyncEvent, ) -> Result<(), AdapterError>
Send an event to a specific node.
Sourcefn broadcast_event(&self, event: &SyncEvent) -> Result<(), AdapterError>
fn broadcast_event(&self, event: &SyncEvent) -> Result<(), AdapterError>
Broadcast an event to all nodes.
Sourcefn receive_events(&self) -> Result<Vec<SyncEvent>, AdapterError>
fn receive_events(&self) -> Result<Vec<SyncEvent>, AdapterError>
Receive pending events from the network.