pub struct Attestation { /* private fields */ }Expand description
Length-sealed 64-byte attestation signature wrapper.
Constructed only via Attestation::from_bytes (which takes a
[u8; 64] literal — length statically enforced by the Rust type
system). The wire format is a postcard length-prefixed byte
sequence (Vec<u8>-equivalent) with a strict 64-byte length check
on deserialize. This combination produces a length-sealed type:
- Constructor side: any caller producing an
Attestationdoes so via the[u8; 64]constructor — the type system rejects any other byte width at compile time. - Deserialize side: any wire bytes whose payload length is
not exactly 64 produce a
serde::de::Error, never a panic.
Why a custom serde impl (rather than #[derive] over [u8; 64]):
serde’s stock array deserializer caps at 32 bytes — the L0
WalRecord.signature workaround uses Vec<u8> with length
validation at the application layer. Attestation lifts the
length invariant from convention to the type itself: any value of
type Attestation that exists has 64 bytes, and the Deserialize
impl is the exhaustive admission check.
Used by ReplicaIdAllocation::registry_attestation and
AuditReceiptKeyPolicy::attestation.
Implementations§
Source§impl Attestation
impl Attestation
Sourcepub fn from_bytes(bytes: [u8; 64]) -> Self
pub fn from_bytes(bytes: [u8; 64]) -> Self
Construct an Attestation from a fixed 64-byte signature.
The [u8; 64] parameter type makes the length invariant
statically enforced by the Rust type system — any caller
passing a non-64-byte input is rejected at compile time.
Trait Implementations§
Source§impl Clone for Attestation
impl Clone for Attestation
Source§fn clone(&self) -> Attestation
fn clone(&self) -> Attestation
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for Attestation
impl Debug for Attestation
Source§impl<'de> Deserialize<'de> for Attestation
impl<'de> Deserialize<'de> for Attestation
Source§fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
Deserializes from a Vec<u8> and rejects (with serde::de::Error,
never a panic) any payload whose length is not exactly 64. This
makes Attestation the single admission check for the 64-byte
invariant on the wire side.
Source§impl PartialEq for Attestation
impl PartialEq for Attestation
Source§fn eq(&self, other: &Attestation) -> bool
fn eq(&self, other: &Attestation) -> bool
self and other values to be equal, and is used by ==.