pub struct Checkpoint {
pub origin: LogOrigin,
pub size: u64,
pub root: MerkleHash,
pub timestamp: DateTime<Utc>,
}Expand description
An unsigned transparency log checkpoint.
Args:
origin— Log origin string (e.g., “auths.dev/log”).size— Number of entries in the log at this checkpoint.root— Merkle root hash of the log at this size.timestamp— When the checkpoint was created.
Usage:
ⓘ
let cp = Checkpoint {
origin: LogOrigin::new("auths.dev/log")?,
size: 42,
root: merkle_root,
timestamp: Utc::now(),
};Fields§
§origin: LogOrigin§size: u64§root: MerkleHash§timestamp: DateTime<Utc>Implementations§
Source§impl Checkpoint
impl Checkpoint
Sourcepub fn to_note_body(&self) -> String
pub fn to_note_body(&self) -> String
Serialize to the C2SP checkpoint body format (three lines: origin, size, base64 hash).
Sourcepub fn from_note_body(
body: &str,
timestamp: DateTime<Utc>,
) -> Result<Self, TransparencyError>
pub fn from_note_body( body: &str, timestamp: DateTime<Utc>, ) -> Result<Self, TransparencyError>
Parse from C2SP checkpoint body lines.
Trait Implementations§
Source§impl Clone for Checkpoint
impl Clone for Checkpoint
Source§fn clone(&self) -> Checkpoint
fn clone(&self) -> Checkpoint
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for Checkpoint
impl Debug for Checkpoint
Source§impl<'de> Deserialize<'de> for Checkpoint
impl<'de> Deserialize<'de> for Checkpoint
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 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 ==.Source§impl Serialize for Checkpoint
impl Serialize for Checkpoint
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