pub struct Rev(u64);Tuple Fields§
§0: u64Implementations§
Source§impl Rev
impl Rev
Sourcepub const ZERO: Rev
pub const ZERO: Rev
The empty document: no commit accepted yet. Real revs start at 1, so ZERO sorts below every accepted write.
Sourcepub(crate) const fn new(n: u64) -> Self
pub(crate) const fn new(n: u64) -> Self
Test fixtures only: production revs enter a process exclusively via
Document::try_apply (next).
pub const fn get(self) -> u64
pub const fn next(self) -> Self
Sourcepub const fn forward(self, n: u64) -> Self
pub const fn forward(self, n: u64) -> Self
n positions on from this one — the same arithmetic
Self::next is, for a caller counting a run of them out.
Sourcepub const fn prev(self) -> Option<Self>
pub const fn prev(self) -> Option<Self>
The position before this one, or None at Self::ZERO. Inert
like Self::next: a rev outside the fold names a position, and
the log’s positions are contiguous by construction.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Rev
impl<'de> Deserialize<'de> for Rev
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Ord for Rev
impl Ord for Rev
Source§impl PartialOrd for Rev
impl PartialOrd for Rev
impl Copy for Rev
impl Eq for Rev
impl StructuralPartialEq for Rev
Auto Trait Implementations§
impl Freeze for Rev
impl RefUnwindSafe for Rev
impl Send for Rev
impl Sync for Rev
impl Unpin for Rev
impl UnsafeUnpin for Rev
impl UnwindSafe for Rev
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