pub struct Node<T: Element> { /* private fields */ }Expand description
A node in a quorum system.
Nodes are identified by x: equality, ordering, and hashing only look
at x. Capacities are in requests per unit time; the defaults are a
capacity of 1.0 and a latency of 1 second.
Implementations§
Source§impl<T: Element> Node<T>
impl<T: Element> Node<T>
Sourcepub fn with_capacity(self, capacity: f64) -> Result<Self>
pub fn with_capacity(self, capacity: f64) -> Result<Self>
Set one capacity for both reads and writes.
§Errors
Returns Error::InvalidExpression unless capacity is finite
and positive.
Sourcepub fn with_read_write_capacity(self, read: f64, write: f64) -> Result<Self>
pub fn with_read_write_capacity(self, read: f64, write: f64) -> Result<Self>
Set separate read and write capacities.
§Errors
Returns Error::InvalidExpression unless both capacities are
finite and positive.
Sourcepub fn with_latency(self, latency: Duration) -> Self
pub fn with_latency(self, latency: Duration) -> Self
Set the latency for this node.
Sourcepub fn read_capacity(&self) -> f64
pub fn read_capacity(&self) -> f64
Read capacity (requests per unit time).
Sourcepub fn write_capacity(&self) -> f64
pub fn write_capacity(&self) -> f64
Write capacity (requests per unit time).
Trait Implementations§
impl<T: Element> Eq for Node<T>
Source§impl<T: Element> Ord for Node<T>
impl<T: Element> Ord for Node<T>
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the minimum of two values. Read more
Source§impl<T: Element> PartialOrd for Node<T>
impl<T: Element> PartialOrd for Node<T>
Auto Trait Implementations§
impl<T> Freeze for Node<T>where
T: Freeze,
impl<T> RefUnwindSafe for Node<T>where
T: RefUnwindSafe,
impl<T> Send for Node<T>
impl<T> Sync for Node<T>
impl<T> Unpin for Node<T>where
T: Unpin,
impl<T> UnsafeUnpin for Node<T>where
T: UnsafeUnpin,
impl<T> UnwindSafe for Node<T>where
T: UnwindSafe,
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,
§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
impl<T> Element for T
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.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> ⓘ
Converts
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> ⓘ
Converts
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