pub struct PeerDeltaBuffer<D: Lattice> {
delta: Option<D>,
from_seq: SeqNo,
to_seq: SeqNo,
}Expand description
Per-peer delta buffer for causal mode
Stores deltas that need to be sent to a specific peer, along with the sequence range they cover.
Fields§
§delta: Option<D>The accumulated delta to send
from_seq: SeqNoSequence number before the first delta in buffer
to_seq: SeqNoSequence number of the last delta in buffer
Implementations§
Source§impl<D: Lattice> PeerDeltaBuffer<D>
impl<D: Lattice> PeerDeltaBuffer<D>
pub fn new() -> Self
Sourcepub fn start_from(seq: SeqNo) -> Self
pub fn start_from(seq: SeqNo) -> Self
Start tracking from a specific sequence number
Sourcepub fn has_pending(&self) -> bool
pub fn has_pending(&self) -> bool
Check if buffer has pending deltas
Sourcepub fn reset_from(&mut self, seq: SeqNo)
pub fn reset_from(&mut self, seq: SeqNo)
Reset the buffer from a new sequence (after peer reconnect)
Trait Implementations§
Source§impl<D: Clone + Lattice> Clone for PeerDeltaBuffer<D>
impl<D: Clone + Lattice> Clone for PeerDeltaBuffer<D>
Source§fn clone(&self) -> PeerDeltaBuffer<D>
fn clone(&self) -> PeerDeltaBuffer<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 moreSource§impl<D: Debug + Lattice> Debug for PeerDeltaBuffer<D>
impl<D: Debug + Lattice> Debug for PeerDeltaBuffer<D>
Auto Trait Implementations§
impl<D> Freeze for PeerDeltaBuffer<D>where
D: Freeze,
impl<D> RefUnwindSafe for PeerDeltaBuffer<D>where
D: RefUnwindSafe,
impl<D> Send for PeerDeltaBuffer<D>where
D: Send,
impl<D> Sync for PeerDeltaBuffer<D>where
D: Sync,
impl<D> Unpin for PeerDeltaBuffer<D>where
D: Unpin,
impl<D> UnwindSafe for PeerDeltaBuffer<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