Expand description
Substrate-level Pod marker.
Every zero-copy access path, including the native substrate, requires a Pod
bound rather than the loose T: Copy. This module is that marker.
§Hopper-owned safety
Zeroable and Pod are Hopper-owned marker traits. Hopper macros
emit field-level proof blocks that require every field to already
implement Hopper Pod before the containing layout receives its own
impl. That gives the same useful rejection points users got from the
old dependency-backed path while keeping the proof surface inside the
framework:
bool,char, references, not all bit patterns valid- padded
#[repr(C)]structs, padding bytes aren’t accounted for - non-alignment-1 primitives when alignment-1 was claimed
- enums with niches and non-zero variants
Hopper’s #[hopper::pod] derive and #[hopper::state] macro emit these
field-level proofs, so layouts can use the Hopper-owned marker directly.
See hopper_runtime::pod::Pod (downstream re-export) for the
runtime-side view.
Traits§
- Pod
- Marker for types that can be safely overlaid as
&T/&mut Ton raw account bytes at any offset. - Value
Pod - Marker for
Copy + Sizedscalars/arrays that may be read by value from raw bytes withread_unaligned_value(alignment-independent). - Zeroable
- Marker for
Copy + Sizedvalues that are valid for every bit pattern.
Functions§
- read_
unaligned_ value - Read a
ValuePodscalar/array out ofbytesatoffsetby value, tolerating any alignment (usescore::ptr::read_unaligned).