#[non_exhaustive]pub struct ReplicationConfig {
pub replica_path: String,
pub sync_url: Option<String>,
pub auth_token: Option<String>,
pub sync_interval_secs: u64,
}Expand description
Configuration for distributed SQLite replica database sync.
Debug redacts auth_token and prints only the scheme of sync_url.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.replica_path: StringLocal SQLite file path representing the local database replica.
sync_url: Option<String>Remote SQLite database sync master URL.
auth_token: Option<String>Security authentication bearer token for connection validation.
sync_interval_secs: u64Synchronization check interval in seconds (default is 10 seconds).
Implementations§
Source§impl ReplicationConfig
impl ReplicationConfig
Sourcepub fn new(replica_path: impl Into<String>) -> Self
pub fn new(replica_path: impl Into<String>) -> Self
Creates a new ReplicationConfig using the constructor and builder pattern.
Sourcepub fn with_sync_url(self, sync_url: impl Into<String>) -> Self
pub fn with_sync_url(self, sync_url: impl Into<String>) -> Self
Attaches the remote sync master URL (e.g. “libsql://my-db.turso.io”).
Sourcepub fn with_auth_token(self, auth_token: impl Into<String>) -> Self
pub fn with_auth_token(self, auth_token: impl Into<String>) -> Self
Sets the remote connection authentication token.
Sourcepub fn with_sync_interval(self, secs: u64) -> Self
pub fn with_sync_interval(self, secs: u64) -> Self
Sets the interval duration between sync queries in seconds.
Trait Implementations§
Source§impl Clone for ReplicationConfig
impl Clone for ReplicationConfig
Auto Trait Implementations§
impl Freeze for ReplicationConfig
impl RefUnwindSafe for ReplicationConfig
impl Send for ReplicationConfig
impl Sync for ReplicationConfig
impl Unpin for ReplicationConfig
impl UnsafeUnpin for ReplicationConfig
impl UnwindSafe for ReplicationConfig
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