pub struct SyncSettings {
pub sync_enabled: bool,
pub sync_on_commit: bool,
pub interval_seconds: Option<u64>,
pub properties: HashMap<String, String>,
}Expand description
Synchronization settings for a database
Per-user-per-database sync configuration. Different users may have different sync preferences for the same database.
§Construction
Use factory methods for common configurations:
SyncSettings::disabled()— sync disabled (this is theDefault)SyncSettings::enabled()— sync enabled, no sync on commitSyncSettings::on_commit()— sync enabled with sync on commit on every transaction
Chain .with_interval() to override the periodic sync interval:
let settings = SyncSettings::enabled().with_interval(60);Fields§
§sync_enabled: boolWhether user wants to sync this database
sync_on_commit: boolSync on commit Whether to sync after every commit
interval_seconds: Option<u64>Sync interval in seconds (for periodic sync).
None uses the background sync default interval.
properties: HashMap<String, String>Additional sync configuration
Implementations§
Source§impl SyncSettings
impl SyncSettings
Sourcepub fn with_interval(self, seconds: u64) -> Self
pub fn with_interval(self, seconds: u64) -> Self
Set periodic sync interval in seconds.
Trait Implementations§
Source§impl Clone for SyncSettings
impl Clone for SyncSettings
Source§fn clone(&self) -> SyncSettings
fn clone(&self) -> SyncSettings
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for SyncSettings
impl Debug for SyncSettings
Source§impl Default for SyncSettings
impl Default for SyncSettings
Source§impl<'de> Deserialize<'de> for SyncSettings
impl<'de> Deserialize<'de> for SyncSettings
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for SyncSettings
impl RefUnwindSafe for SyncSettings
impl Send for SyncSettings
impl Sync for SyncSettings
impl Unpin for SyncSettings
impl UnwindSafe for SyncSettings
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> CompatExt for T
impl<T> CompatExt for T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more