pub unsafe trait ByteBackedStablePayload: StablePayload {
const SUPPORTS_BYTE_BACKED_UNINIT: bool = true;
}Expand description
Stronger stable payload proof for byte-backed stable-container paths.
StablePayload proves stable type identity, representation eligibility, and
receive-side metadata compatibility. ByteBackedStablePayload additionally
proves that the type has no implicit inter-field or trailing padding and that
every field is recursively byte-backed.
Prefer #[derive(StablePayload, ByteBackedStablePayload)] for hand-written
payload types. Manual implementations are reserved for externally audited FFI
or code-generated layouts with an equivalent whole-object initialization
proof.
§Safety
Implementors must guarantee that copying or initializing exactly
size_of::<Self>() bytes is a sound representation of one valid Self for
stable-container paths. That requires stable layout, no implicit padding, no
drop glue, interior mutability, and recursively byte-backed fields.
Provided Associated Constants§
Sourceconst SUPPORTS_BYTE_BACKED_UNINIT: bool = true
const SUPPORTS_BYTE_BACKED_UNINIT: bool = true
Whether this type’s full object representation can be used by byte-backed stable-container paths.
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.