pub struct StoragePair { /* private fields */ }Expand description
A pair of storage that are to be synchronised.
Merely wraps around the declaration of what shall be synchronised. It can be
constructed offline and is the entry point to generate a stream of operations via
Plan::new and then execute them.
New pairs can be created via StoragePair::new.
Implementations§
Source§impl StoragePair
impl StoragePair
Sourcepub fn new(
storage_a: Arc<dyn Storage>,
storage_b: Arc<dyn Storage>,
) -> StoragePair
pub fn new( storage_a: Arc<dyn Storage>, storage_b: Arc<dyn Storage>, ) -> StoragePair
Create a new instance.
By default, no collections are to be synchronised. See other associated functions for details con configuring additional collections.
Sourcepub fn with_mapping(self, mapping: SyncedCollection) -> Self
pub fn with_mapping(self, mapping: SyncedCollection) -> Self
Include the specified mapping when synchronising.
Sourcepub fn with_all_from_a(self) -> Self
pub fn with_all_from_a(self) -> Self
Include all collections from storage A when synchronising.
By default, only explicitly included collections are synchronised.
Sourcepub fn with_all_from_b(self) -> Self
pub fn with_all_from_b(self) -> Self
Include all collections from storage B when synchronising.
By default, only explicitly included collections are synchronised.
Sourcepub fn on_empty(self, action: OnEmpty) -> Self
pub fn on_empty(self, action: OnEmpty) -> Self
Action to take when a collection is completely emptied.
Sourcepub fn with_mode(self, mode: Arc<dyn Mode>) -> Self
pub fn with_mode(self, mode: Arc<dyn Mode>) -> Self
Set the synchronization mode.
By default, TwoWaySync is used.
Trait Implementations§
Source§impl Clone for StoragePair
impl Clone for StoragePair
Source§fn clone(&self) -> StoragePair
fn clone(&self) -> StoragePair
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more