pub struct SynchronizationManager { /* private fields */ }Expand description
Manager for distributed schema synchronization.
Implementations§
Source§impl SynchronizationManager
impl SynchronizationManager
Sourcepub fn new(node_id: NodeId, table: SymbolTable) -> Self
pub fn new(node_id: NodeId, table: SymbolTable) -> Self
Create a new synchronization manager.
Sourcepub fn set_resolution_strategy(&mut self, strategy: ConflictResolution)
pub fn set_resolution_strategy(&mut self, strategy: ConflictResolution)
Set the conflict resolution strategy.
Sourcepub fn add_listener(&mut self, listener: Arc<dyn EventListener>)
pub fn add_listener(&mut self, listener: Arc<dyn EventListener>)
Add an event listener.
Sourcepub fn register_node(&mut self, node_id: NodeId)
pub fn register_node(&mut self, node_id: NodeId)
Register a remote node.
Sourcepub fn table(&self) -> &SymbolTable
pub fn table(&self) -> &SymbolTable
Get the current symbol table.
Sourcepub fn table_mut(&mut self) -> &mut SymbolTable
pub fn table_mut(&mut self) -> &mut SymbolTable
Get a mutable reference to the symbol table.
Sourcepub fn pending_events(&self) -> Vec<SyncEvent>
pub fn pending_events(&self) -> Vec<SyncEvent>
Get pending events for broadcasting.
Sourcepub fn clear_pending_events(&mut self)
pub fn clear_pending_events(&mut self)
Clear pending events (after successful broadcast).
Sourcepub fn statistics(&self) -> &SyncStatistics
pub fn statistics(&self) -> &SyncStatistics
Get synchronization statistics.
Sourcepub fn add_domain(&mut self, domain: DomainInfo) -> Result<(), AdapterError>
pub fn add_domain(&mut self, domain: DomainInfo) -> Result<(), AdapterError>
Add a domain and generate sync event.
Sourcepub fn add_predicate(
&mut self,
predicate: PredicateInfo,
) -> Result<(), AdapterError>
pub fn add_predicate( &mut self, predicate: PredicateInfo, ) -> Result<(), AdapterError>
Add a predicate and generate sync event.
Sourcepub fn remove_domain(&mut self, name: &str) -> Result<(), AdapterError>
pub fn remove_domain(&mut self, name: &str) -> Result<(), AdapterError>
Remove a domain and generate sync event.
Sourcepub fn apply_event(
&mut self,
event: SyncEvent,
) -> Result<ApplyResult, AdapterError>
pub fn apply_event( &mut self, event: SyncEvent, ) -> Result<ApplyResult, AdapterError>
Apply a sync event from another node.
Sourcepub fn synchronize<P: SyncProtocol>(
&mut self,
protocol: &P,
) -> Result<(), AdapterError>
pub fn synchronize<P: SyncProtocol>( &mut self, protocol: &P, ) -> Result<(), AdapterError>
Synchronize with another node using a protocol.
Auto Trait Implementations§
impl Freeze for SynchronizationManager
impl !RefUnwindSafe for SynchronizationManager
impl Send for SynchronizationManager
impl Sync for SynchronizationManager
impl Unpin for SynchronizationManager
impl UnsafeUnpin for SynchronizationManager
impl !UnwindSafe for SynchronizationManager
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more