pub trait AccountLayout: WireLayout {
const DISC: u8;
const VERSION: u8;
const WIRE_FINGERPRINT: u64;
const TYPE_OFFSET: usize;
const SCHEMA_EPOCH: u32 = 1;
// Provided method
fn required_len() -> usize { ... }
}Expand description
Hopper account layout identity, the top of the unified trait stack.
This is the audit-blessed trait: its member list matches the PDF’s “proposed trait model” section exactly, so Hopper’s long-term ABI story is anchored in the vocabulary the audit uses.
WIRE_FINGERPRINT is the first 8 bytes of the canonical SHA-256
wire descriptor (see hopper_macros_proc::state::layout_id_bytes)
reinterpreted as a little-endian u64, so the runtime can compare
against the on-account header byte-for-byte.
SCHEMA_EPOCH defaults to 1; programs that publish later epochs
via their on-chain manifest bump it to signal a version transition.
Required Associated Constants§
Sourceconst WIRE_FINGERPRINT: u64
const WIRE_FINGERPRINT: u64
Canonical wire fingerprint (header bytes 4..12, little-endian).
Sourceconst TYPE_OFFSET: usize
const TYPE_OFFSET: usize
Offset at which Self starts inside the account buffer.
0 for header-inclusive layouts, HEADER_LEN for body-only.
Provided Associated Constants§
Sourceconst SCHEMA_EPOCH: u32 = 1
const SCHEMA_EPOCH: u32 = 1
Schema-evolution epoch (header bytes 12..16).
Provided Methods§
Sourcefn required_len() -> usize
fn required_len() -> usize
Total data length an account must carry to hold Self.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.