pub enum ReplicationFactor {
MustReach(usize),
Range(ReplicationRange),
}Expand description
The replication factor of a syncing operation.
Variants§
MustReach(usize)
The syncing operation much reach the given value.
Range(ReplicationRange)
The syncing operation must reach a minimum value, but may continue to reach a maximum value.
Implementations§
Source§impl ReplicationFactor
impl ReplicationFactor
Sourcepub fn range(lower: usize, upper: usize) -> ReplicationFactor
pub fn range(lower: usize, upper: usize) -> ReplicationFactor
Construct a replication factor with the lower and upper bounds.
If lower >= upper, then ReplicationFactor::MustReach is constructed instead of
ReplicationFactor::Range.
Sourcepub fn must_reach(factor: usize) -> ReplicationFactor
pub fn must_reach(factor: usize) -> ReplicationFactor
Construct a replication factor where the factor must be reached.
Sourcepub fn lower_bound(&self) -> usize
pub fn lower_bound(&self) -> usize
Get the lower bound of the replication factor.
Sourcepub fn upper_bound(&self) -> Option<usize>
pub fn upper_bound(&self) -> Option<usize>
Get the upper bound of the replication factor, if the replication factor is a range.
Sourcepub fn min(self, new: usize) -> ReplicationFactor
pub fn min(self, new: usize) -> ReplicationFactor
Set the minimum target of the ReplicationFactor to a new value.
If the original value is smaller than the new value, then the original is kept.
If the ReplicationFactor is a range, it performs min on the upper
bound of the range.
If self was originally a ReplicationFactor::Range, and min >= max, then
the returned value will be ReplicationFactor::MustReach.
Trait Implementations§
Source§impl Clone for ReplicationFactor
impl Clone for ReplicationFactor
Source§fn clone(&self) -> ReplicationFactor
fn clone(&self) -> ReplicationFactor
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ReplicationFactor
impl Debug for ReplicationFactor
Source§impl Default for ReplicationFactor
impl Default for ReplicationFactor
Source§fn default() -> ReplicationFactor
fn default() -> ReplicationFactor
Source§impl PartialEq for ReplicationFactor
impl PartialEq for ReplicationFactor
impl Copy for ReplicationFactor
impl Eq for ReplicationFactor
impl StructuralPartialEq for ReplicationFactor
Auto Trait Implementations§
impl Freeze for ReplicationFactor
impl RefUnwindSafe for ReplicationFactor
impl Send for ReplicationFactor
impl Sync for ReplicationFactor
impl Unpin for ReplicationFactor
impl UnwindSafe for ReplicationFactor
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§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> 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>
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>
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