pub struct Durability {
pub local_sync: SyncPolicy,
pub replica_sync: SyncPolicy,
pub replica_ack: ReplicaAckPolicy,
}Expand description
Durability characteristics for a transaction.
Specifies the durability guarantees associated with a transaction when it’s committed. The durability policy consists of:
- Local sync policy: how the master node synchronizes
- Replica sync policy: how replica nodes synchronize
- Replica acknowledgment policy: how many replicas must acknowledge
Fields§
§local_sync: SyncPolicySync policy for the local (master) node.
replica_sync: SyncPolicySync policy for replica nodes.
replica_ack: ReplicaAckPolicyAcknowledgment policy for replicas.
Implementations§
Source§impl Durability
impl Durability
Sourcepub const COMMIT_SYNC: Self
pub const COMMIT_SYNC: Self
Maximum durability: Sync on master and replicas, all replicas acknowledge.
Sourcepub const COMMIT_NO_SYNC: Self
pub const COMMIT_NO_SYNC: Self
No sync on commit, maximum performance.
Sourcepub const COMMIT_WRITE_NO_SYNC: Self
pub const COMMIT_WRITE_NO_SYNC: Self
Write but no sync on commit, good balance of performance and durability.
Sourcepub fn new(
local_sync: SyncPolicy,
replica_sync: SyncPolicy,
replica_ack: ReplicaAckPolicy,
) -> Self
pub fn new( local_sync: SyncPolicy, replica_sync: SyncPolicy, replica_ack: ReplicaAckPolicy, ) -> Self
Creates a new Durability with the specified policies.
Trait Implementations§
Source§impl Clone for Durability
impl Clone for Durability
Source§fn clone(&self) -> Durability
fn clone(&self) -> Durability
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for Durability
Source§impl Debug for Durability
impl Debug for Durability
Source§impl Default for Durability
impl Default for Durability
impl Eq for Durability
Source§impl PartialEq for Durability
impl PartialEq for Durability
Source§fn eq(&self, other: &Durability) -> bool
fn eq(&self, other: &Durability) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for Durability
Auto Trait Implementations§
impl Freeze for Durability
impl RefUnwindSafe for Durability
impl Send for Durability
impl Sync for Durability
impl Unpin for Durability
impl UnsafeUnpin for Durability
impl UnwindSafe for Durability
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,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.