pub enum ConsistencyLevel {
DcOne,
DcQuorum,
DcSafeQuorum,
DcEachSafeQuorum,
}Expand description
Quorum policy for read or write paths.
§Examples
use dynomite::conf::ConsistencyLevel;
let lvl = ConsistencyLevel::parse("read_consistency", "DC_QUORUM").unwrap();
assert_eq!(lvl, ConsistencyLevel::DcQuorum);Variants§
DcOne
Single replica acknowledgement.
DcQuorum
Majority within a single datacenter.
DcSafeQuorum
Majority within a single datacenter with checksum repair.
DcEachSafeQuorum
Majority within every datacenter, with checksum repair.
Implementations§
Source§impl ConsistencyLevel
impl ConsistencyLevel
Sourcepub fn parse(field: &'static str, s: &str) -> Result<Self, ConfError>
pub fn parse(field: &'static str, s: &str) -> Result<Self, ConfError>
Parse a read_consistency or write_consistency value.
Comparison is case-insensitive against the canonical names
DC_ONE, DC_QUORUM, DC_SAFE_QUORUM, and
DC_EACH_SAFE_QUORUM.
§Examples
use dynomite::conf::ConsistencyLevel;
assert_eq!(
ConsistencyLevel::parse("read_consistency", "dc_one").unwrap(),
ConsistencyLevel::DcOne,
);
assert!(ConsistencyLevel::parse("read_consistency", "nope").is_err());Trait Implementations§
Source§impl Clone for ConsistencyLevel
impl Clone for ConsistencyLevel
Source§fn clone(&self) -> ConsistencyLevel
fn clone(&self) -> ConsistencyLevel
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 moreSource§impl Debug for ConsistencyLevel
impl Debug for ConsistencyLevel
Source§impl Display for ConsistencyLevel
impl Display for ConsistencyLevel
Source§impl Hash for ConsistencyLevel
impl Hash for ConsistencyLevel
Source§impl PartialEq for ConsistencyLevel
impl PartialEq for ConsistencyLevel
Source§fn eq(&self, other: &ConsistencyLevel) -> bool
fn eq(&self, other: &ConsistencyLevel) -> bool
Tests for
self and other values to be equal, and is used by ==.impl Copy for ConsistencyLevel
impl Eq for ConsistencyLevel
impl StructuralPartialEq for ConsistencyLevel
Auto Trait Implementations§
impl Freeze for ConsistencyLevel
impl RefUnwindSafe for ConsistencyLevel
impl Send for ConsistencyLevel
impl Sync for ConsistencyLevel
impl Unpin for ConsistencyLevel
impl UnsafeUnpin for ConsistencyLevel
impl UnwindSafe for ConsistencyLevel
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§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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.