pub trait CanonicalDigest<const N: usize>: Copy {
// Required methods
fn to_canonical(self) -> [u8; N];
fn from_canonical(bytes: [u8; N]) -> Self;
}Expand description
A digest a checkpoint stores as its canonical N bytes.
The raw bytes, or a CredentialDigest
that wraps 32 of them (PROTO-007 R1). Either encodes to the same bytes, so
the capsule format is unchanged.
Required Methods§
Sourcefn to_canonical(self) -> [u8; N]
fn to_canonical(self) -> [u8; N]
The canonical bytes.
Sourcefn from_canonical(bytes: [u8; N]) -> Self
fn from_canonical(bytes: [u8; N]) -> Self
The digest the canonical bytes name.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".