pub struct RegistryCheckpoint {
pub schema: String,
pub checkpoint_id: String,
pub hub_id: String,
pub sequence: u64,
pub entry_count: u64,
pub registry_root: String,
pub previous_checkpoint: Option<String>,
pub signer_pubkey: String,
pub signature: String,
pub created_at: String,
}Fields§
§schema: String§checkpoint_id: String§hub_id: String§sequence: u64§entry_count: u64§registry_root: String§previous_checkpoint: Option<String>§signer_pubkey: String§signature: String§created_at: StringImplementations§
Source§impl RegistryCheckpoint
impl RegistryCheckpoint
Sourcepub fn build(
registry: &Registry,
draft: CheckpointDraft,
signing_key: &SigningKey,
) -> Result<Self, String>
pub fn build( registry: &Registry, draft: CheckpointDraft, signing_key: &SigningKey, ) -> Result<Self, String>
Build a checkpoint over a registry, signing it with the
supplied hub-operator key. The signature covers the
canonical preimage of the checkpoint body with
signature and checkpoint_id zeroed; the
checkpoint_id is then derived from the signed preimage
(so two checkpoints with identical body + signature share
the same id, and a tampered signature surfaces as a hash
mismatch).
Sourcepub fn preimage_bytes(&self) -> Result<Vec<u8>, String>
pub fn preimage_bytes(&self) -> Result<Vec<u8>, String>
Canonical preimage bytes for the signature. Excludes
signature and checkpoint_id so the preimage is
derivable from the rest of the body alone.
Trait Implementations§
Source§impl Clone for RegistryCheckpoint
impl Clone for RegistryCheckpoint
Source§fn clone(&self) -> RegistryCheckpoint
fn clone(&self) -> RegistryCheckpoint
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 RegistryCheckpoint
impl Debug for RegistryCheckpoint
Source§impl<'de> Deserialize<'de> for RegistryCheckpoint
impl<'de> Deserialize<'de> for RegistryCheckpoint
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 RegistryCheckpoint
impl PartialEq for RegistryCheckpoint
Source§fn eq(&self, other: &RegistryCheckpoint) -> bool
fn eq(&self, other: &RegistryCheckpoint) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for RegistryCheckpoint
impl Serialize for RegistryCheckpoint
impl Eq for RegistryCheckpoint
impl StructuralPartialEq for RegistryCheckpoint
Auto Trait Implementations§
impl Freeze for RegistryCheckpoint
impl RefUnwindSafe for RegistryCheckpoint
impl Send for RegistryCheckpoint
impl Sync for RegistryCheckpoint
impl Unpin for RegistryCheckpoint
impl UnsafeUnpin for RegistryCheckpoint
impl UnwindSafe for RegistryCheckpoint
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.