pub struct Checkpoint { /* private fields */ }Expand description
A Checkpoint is a tree head to be formatted according to c2sp.org/checkpoint.
Implementations§
Source§impl Checkpoint
impl Checkpoint
Sourcepub fn new(
origin: &str,
size: u64,
hash: Hash,
extension: &str,
) -> Result<Self, MalformedCheckpointError>
pub fn new( origin: &str, size: u64, hash: Hash, extension: &str, ) -> Result<Self, MalformedCheckpointError>
Return a new checkpoint with the given arguments.
§Errors
Returns a MalformedCheckpointError if the arguments do not comply with
the C2SP tlog-checkpoint specification.
Sourcepub fn from_bytes(text: &[u8]) -> Result<Self, MalformedCheckpointError>
pub fn from_bytes(text: &[u8]) -> Result<Self, MalformedCheckpointError>
Sourcepub fn from_reader<R: BufRead>(
reader: &mut R,
strict: bool,
) -> Result<Self, MalformedCheckpointError>
pub fn from_reader<R: BufRead>( reader: &mut R, strict: bool, ) -> Result<Self, MalformedCheckpointError>
Parse a checkpoint from encoded bytes reader.
If strict is set to true, the reader should exactly match a checkpoint.
Otherwise, read until we encounter a blank line (only a newline).
§Errors
Returns an error if the checkpoint is malformed.
Trait Implementations§
Source§impl Debug for Checkpoint
impl Debug for Checkpoint
Source§impl PartialEq for Checkpoint
impl PartialEq for Checkpoint
Source§fn eq(&self, other: &Checkpoint) -> bool
fn eq(&self, other: &Checkpoint) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for Checkpoint
Auto Trait Implementations§
impl Freeze for Checkpoint
impl RefUnwindSafe for Checkpoint
impl Send for Checkpoint
impl Sync for Checkpoint
impl Unpin for Checkpoint
impl UnsafeUnpin for Checkpoint
impl UnwindSafe for Checkpoint
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