pub struct Journal { /* private fields */ }Expand description
Deltas for versions tail + 1 ..= head.
Implementations§
Source§impl Journal
impl Journal
Sourcepub fn push(&mut self, ops: Vec<PlannedOp>) -> u64
pub fn push(&mut self, ops: Vec<PlannedOp>) -> u64
Append a delta, returning the version it became.
Evicts from the front past DEPTH, which is the only thing that moves
the tail.
Sourcepub fn replay(
&self,
from: u64,
to: u64,
) -> Result<Vec<&PlannedOp>, TooFarBehind>
pub fn replay( &self, from: u64, to: u64, ) -> Result<Vec<&PlannedOp>, TooFarBehind>
Every operation in versions from + 1 ..= to, in order.
§Errors
TooFarBehind when from is below the tail. A to above the head, or
a to below from, yields nothing: both mean the caller is already up to
date or ahead, which is not an error a connection can act on.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Journal
impl RefUnwindSafe for Journal
impl Send for Journal
impl Sync for Journal
impl Unpin for Journal
impl UnwindSafe for Journal
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