pub enum ReadConsistencyPolicy {
LeaseRead,
LinearizableRead,
EventualConsistency,
}Expand description
Policy for read operation consistency guarantees
Determines the trade-off between read consistency and performance. Clients can choose the appropriate level based on their requirements.
Variants§
LeaseRead
Lease-based reads for better performance with weaker consistency
The leader serves reads locally without contacting followers during the valid lease period. Assumes bounded clock drift between nodes. Provides lower latency but slightly weaker consistency guarantees compared to LinearizableRead.
LinearizableRead
Fully linearizable reads for strongest consistency
The leader verifies its leadership with a quorum before serving the read, ensuring strict linearizability. This guarantees that all reads reflect the most recent committed value in the cluster.
EventualConsistency
Eventually consistent reads from any node
Allows reading from any node (leader, follower, or candidate) without additional consistency checks. May return stale data but provides best read performance and availability. Suitable for scenarios where eventual consistency is acceptable. Can be served by non-leader nodes.
Trait Implementations§
Source§impl Clone for ReadConsistencyPolicy
impl Clone for ReadConsistencyPolicy
Source§fn clone(&self) -> ReadConsistencyPolicy
fn clone(&self) -> ReadConsistencyPolicy
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ReadConsistencyPolicy
impl Debug for ReadConsistencyPolicy
Source§impl Default for ReadConsistencyPolicy
impl Default for ReadConsistencyPolicy
Source§fn default() -> ReadConsistencyPolicy
fn default() -> ReadConsistencyPolicy
Source§impl<'de> Deserialize<'de> for ReadConsistencyPolicy
impl<'de> Deserialize<'de> for ReadConsistencyPolicy
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>,
Source§impl From<ReadConsistencyPolicy> for ReadConsistencyPolicy
impl From<ReadConsistencyPolicy> for ReadConsistencyPolicy
Source§fn from(proto_policy: ReadConsistencyPolicy) -> Self
fn from(proto_policy: ReadConsistencyPolicy) -> Self
Source§impl From<ReadConsistencyPolicy> for ReadConsistencyPolicy
impl From<ReadConsistencyPolicy> for ReadConsistencyPolicy
Source§fn from(config_policy: ReadConsistencyPolicy) -> Self
fn from(config_policy: ReadConsistencyPolicy) -> Self
Source§impl PartialEq for ReadConsistencyPolicy
impl PartialEq for ReadConsistencyPolicy
Source§impl Serialize for ReadConsistencyPolicy
impl Serialize for ReadConsistencyPolicy
impl Eq for ReadConsistencyPolicy
impl StructuralPartialEq for ReadConsistencyPolicy
Auto Trait Implementations§
impl Freeze for ReadConsistencyPolicy
impl RefUnwindSafe for ReadConsistencyPolicy
impl Send for ReadConsistencyPolicy
impl Sync for ReadConsistencyPolicy
impl Unpin for ReadConsistencyPolicy
impl UnwindSafe for ReadConsistencyPolicy
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
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
key and return true if they are equal.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
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request