pub struct Checkpoint {
pub origin: String,
pub size: u64,
pub root: Hash,
}Expand description
The tree head a log publishes: origin, size and root.
Fields§
§origin: String§size: u64§root: HashImplementations§
Source§impl Checkpoint
impl Checkpoint
Sourcepub fn text(&self) -> Result<String, LogError>
pub fn text(&self) -> Result<String, LogError>
The note text: exactly three lines, no extension lines.
Sourcepub fn sign(&self, log: &SigningIdentity) -> Result<SignedNote, LogError>
pub fn sign(&self, log: &SigningIdentity) -> Result<SignedNote, LogError>
Signs as the log. The key name is the origin.
Sourcepub fn cosign(
note: &mut SignedNote,
name: &str,
witness: &SigningIdentity,
) -> Result<(), LogError>
pub fn cosign( note: &mut SignedNote, name: &str, witness: &SigningIdentity, ) -> Result<(), LogError>
Adds a witness cosignature to a note that already carries the log’s.
Sourcepub fn verify(
note: &[u8],
origin: &str,
log: &VerifyingIdentity,
) -> Result<Self, LogError>
pub fn verify( note: &[u8], origin: &str, log: &VerifyingIdentity, ) -> Result<Self, LogError>
Parses and verifies a note from the log at origin signed by log.
Sourcepub fn verify_witnessed(
note: &[u8],
origin: &str,
log: &VerifyingIdentity,
witnesses: &[(&str, &VerifyingIdentity)],
threshold: usize,
) -> Result<Self, LogError>
pub fn verify_witnessed( note: &[u8], origin: &str, log: &VerifyingIdentity, witnesses: &[(&str, &VerifyingIdentity)], threshold: usize, ) -> Result<Self, LogError>
As Self::verify, and additionally requires at least threshold
distinct witnesses from witnesses to have cosigned.
Trait Implementations§
Source§impl Clone for Checkpoint
impl Clone for Checkpoint
Source§impl Debug for Checkpoint
impl Debug for Checkpoint
impl Eq for Checkpoint
Source§impl PartialEq for Checkpoint
impl PartialEq for Checkpoint
impl StructuralPartialEq for Checkpoint
Auto Trait Implementations§
impl Forget for Checkpoint
impl Freeze for Checkpoint
impl Move 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