pub struct Barrier(/* private fields */);Expand description
A monotonic ordering point, handed out by a SyncJournal on every
successful sync.
It is a sequence number, not a clock: it says what happened before what, which is all a crash model needs, and it never goes backwards when the system clock does.
let journal = SyncJournal::complete();
let first = journal.record("a.db", SyncKind::File, None);
let second = journal.record("b.db", SyncKind::File, None);
assert!(first < second);
assert_eq!(Barrier::new(0), Barrier::new(0));Implementations§
Source§impl Barrier
impl Barrier
Sourcepub const fn new(seq: u64) -> Self
pub const fn new(seq: u64) -> Self
Build a barrier from a raw sequence number.
You need this only when implementing DurabilityWitness by hand;
SyncJournal hands out its own.
assert_eq!(Barrier::new(7).seq(), 7);Trait Implementations§
impl Copy for Barrier
impl Eq for Barrier
Source§impl Ord for Barrier
impl Ord for Barrier
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 PartialOrd for Barrier
impl PartialOrd for Barrier
impl StructuralPartialEq for Barrier
Auto Trait Implementations§
impl Freeze for Barrier
impl RefUnwindSafe for Barrier
impl Send for Barrier
impl Sync for Barrier
impl Unpin for Barrier
impl UnsafeUnpin for Barrier
impl UnwindSafe for Barrier
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