pub struct WriteAggregator { /* private fields */ }Expand description
Counts acks against a target derived from a crate::WriteConsistency
and cluster_size.
Implementations§
Source§impl WriteAggregator
impl WriteAggregator
pub fn new(target: usize) -> Self
pub fn ack(&mut self)
pub fn nack(&mut self)
Sourcepub fn is_satisfied(&self) -> bool
pub fn is_satisfied(&self) -> bool
True when enough positive acks have arrived.
Sourcepub fn is_failed(&self, cluster_size: usize) -> bool
pub fn is_failed(&self, cluster_size: usize) -> bool
True when so many negative acks have arrived that the target can no longer be reached.
pub fn received(&self) -> usize
pub fn target(&self) -> usize
Trait Implementations§
Auto Trait Implementations§
impl Freeze for WriteAggregator
impl RefUnwindSafe for WriteAggregator
impl Send for WriteAggregator
impl Sync for WriteAggregator
impl Unpin for WriteAggregator
impl UnsafeUnpin for WriteAggregator
impl UnwindSafe for WriteAggregator
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