pub trait StateSynchronization {
// Required methods
fn init(config: SyncConfig) -> Result<(), SyncError>;
fn start_sync(&mut self) -> Result<(), SyncError>;
fn stop_sync(&mut self) -> Result<(), SyncError>;
fn request_state(&mut self) -> Result<ProtocolState, SyncError>;
fn send_state(&mut self, state: &ProtocolState) -> Result<(), SyncError>;
fn resolve_conflicts(
&mut self,
states: Vec<ProtocolState>,
) -> Result<ProtocolState, SyncError>;
}
Expand description
State synchronization trait defining the interface for sync operations.
Required Methods§
Sourcefn init(config: SyncConfig) -> Result<(), SyncError>
fn init(config: SyncConfig) -> Result<(), SyncError>
Initialize synchronization with configuration.
Sourcefn start_sync(&mut self) -> Result<(), SyncError>
fn start_sync(&mut self) -> Result<(), SyncError>
Start state synchronization.
Sourcefn request_state(&mut self) -> Result<ProtocolState, SyncError>
fn request_state(&mut self) -> Result<ProtocolState, SyncError>
Request state from peers.
Sourcefn send_state(&mut self, state: &ProtocolState) -> Result<(), SyncError>
fn send_state(&mut self, state: &ProtocolState) -> Result<(), SyncError>
Send state to peers.
Sourcefn resolve_conflicts(
&mut self,
states: Vec<ProtocolState>,
) -> Result<ProtocolState, SyncError>
fn resolve_conflicts( &mut self, states: Vec<ProtocolState>, ) -> Result<ProtocolState, SyncError>
Resolve state conflicts.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.