pub struct VolatileState<D: Lattice> {
pub delta_buffers: HashMap<ReplicaId, PeerDeltaBuffer<D>>,
pub peer_acks: HashMap<ReplicaId, SeqNo>,
}Expand description
Volatile state for causal anti-entropy (lost on crash)
Fields§
§delta_buffers: HashMap<ReplicaId, PeerDeltaBuffer<D>>Per-peer delta buffers: Dᵢ[j]
peer_acks: HashMap<ReplicaId, SeqNo>Per-peer acknowledgment tracking: Aᵢ[j] Stores the last sequence number we’ve received from each peer
Implementations§
Source§impl<D: Lattice> VolatileState<D>
impl<D: Lattice> VolatileState<D>
pub fn new() -> Self
Sourcepub fn register_peer(&mut self, peer_id: ReplicaId)
pub fn register_peer(&mut self, peer_id: ReplicaId)
Register a peer
Sourcepub fn get_peer_ack(&self, peer_id: &str) -> SeqNo
pub fn get_peer_ack(&self, peer_id: &str) -> SeqNo
Get last acked sequence from a peer
Sourcepub fn update_peer_ack(&mut self, peer_id: &str, seq: SeqNo)
pub fn update_peer_ack(&mut self, peer_id: &str, seq: SeqNo)
Update the ack for a peer
Trait Implementations§
Source§impl<D: Clone + Lattice> Clone for VolatileState<D>
impl<D: Clone + Lattice> Clone for VolatileState<D>
Source§fn clone(&self) -> VolatileState<D>
fn clone(&self) -> VolatileState<D>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl<D> Freeze for VolatileState<D>
impl<D> RefUnwindSafe for VolatileState<D>where
D: RefUnwindSafe,
impl<D> Send for VolatileState<D>where
D: Send,
impl<D> Sync for VolatileState<D>where
D: Sync,
impl<D> Unpin for VolatileState<D>where
D: Unpin,
impl<D> UnwindSafe for VolatileState<D>where
D: 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