pub struct LayoutFingerprint {
pub wire_hash: [u8; 8],
pub semantic_hash: [u8; 8],
}Expand description
Extended layout fingerprint combining wire-level and semantic identity.
The wire hash matches the 8-byte layout_id stored in the account header
and captures the raw byte layout (field sizes, offsets, types).
The semantic hash additionally folds in field intents, enabling detection
of semantic changes that don’t alter the wire format (e.g. reinterpreting a
u64 from Balance to Timestamp).
Fields§
§wire_hash: [u8; 8]Wire-layout hash (matches the header layout_id).
semantic_hash: [u8; 8]Semantic hash incorporating field intents, names, and roles.
Implementations§
Source§impl LayoutFingerprint
impl LayoutFingerprint
Sourcepub const fn from_manifest(manifest: &LayoutManifest) -> Self
pub const fn from_manifest(manifest: &LayoutManifest) -> Self
Compute a fingerprint from a layout manifest.
wire_hash is taken directly from manifest.layout_id.
semantic_hash is a deterministic FNV-1a-64 over field names, types,
sizes, offsets, and intents.
Sourcepub const fn is_identical(&self, other: &Self) -> bool
pub const fn is_identical(&self, other: &Self) -> bool
Whether both wire and semantic fingerprints match.
Sourcepub const fn wire_matches_but_semantics_differ(&self, other: &Self) -> bool
pub const fn wire_matches_but_semantics_differ(&self, other: &Self) -> bool
Whether wire layout matches but semantics differ.
This detects reinterpretation: same bytes on the wire, different meaning.
Trait Implementations§
Source§impl Clone for LayoutFingerprint
impl Clone for LayoutFingerprint
Source§fn clone(&self) -> LayoutFingerprint
fn clone(&self) -> LayoutFingerprint
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 LayoutFingerprint
impl Debug for LayoutFingerprint
Source§impl Display for LayoutFingerprint
impl Display for LayoutFingerprint
Source§impl PartialEq for LayoutFingerprint
impl PartialEq for LayoutFingerprint
Source§fn eq(&self, other: &LayoutFingerprint) -> bool
fn eq(&self, other: &LayoutFingerprint) -> bool
self and other values to be equal, and is used by ==.