Skip to main content

SynchronizationManager

Struct SynchronizationManager 

Source
pub struct SynchronizationManager { /* private fields */ }
Expand description

Manager for distributed schema synchronization.

Implementations§

Source§

impl SynchronizationManager

Source

pub fn new(node_id: NodeId, table: SymbolTable) -> Self

Create a new synchronization manager.

Source

pub fn set_resolution_strategy(&mut self, strategy: ConflictResolution)

Set the conflict resolution strategy.

Source

pub fn add_listener(&mut self, listener: Arc<dyn EventListener>)

Add an event listener.

Source

pub fn register_node(&mut self, node_id: NodeId)

Register a remote node.

Source

pub fn table(&self) -> &SymbolTable

Get the current symbol table.

Source

pub fn table_mut(&mut self) -> &mut SymbolTable

Get a mutable reference to the symbol table.

Source

pub fn pending_events(&self) -> Vec<SyncEvent>

Get pending events for broadcasting.

Source

pub fn clear_pending_events(&mut self)

Clear pending events (after successful broadcast).

Source

pub fn statistics(&self) -> &SyncStatistics

Get synchronization statistics.

Source

pub fn add_domain(&mut self, domain: DomainInfo) -> Result<(), AdapterError>

Add a domain and generate sync event.

Source

pub fn add_predicate( &mut self, predicate: PredicateInfo, ) -> Result<(), AdapterError>

Add a predicate and generate sync event.

Source

pub fn remove_domain(&mut self, name: &str) -> Result<(), AdapterError>

Remove a domain and generate sync event.

Source

pub fn apply_event( &mut self, event: SyncEvent, ) -> Result<ApplyResult, AdapterError>

Apply a sync event from another node.

Source

pub fn synchronize<P: SyncProtocol>( &mut self, protocol: &P, ) -> Result<(), AdapterError>

Synchronize with another node using a protocol.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.