pub unsafe trait StablePayload: Sized + 'static {
const TYPE_NAME: &'static str;
const VARIANT: StablePayloadVariant = StablePayloadVariant::FixedSize;
// Provided methods
fn stable_type_name() -> &'static str { ... }
fn stable_type_detail() -> StableTypeDetail<'static> { ... }
}Expand description
Stable payload identity used by StableContainerPayload<T>.
This phase uses the trait only to build and verify stable-container metadata.
Future borrow/no-zero phases consume the same identity when proving that bytes
may safely be viewed as T.
§Safety
Implementors must choose a stable cross-process type name and only implement the trait for types whose size/alignment and initialized byte representation are suitable for the stable-container contract used by the application.
Required Associated Constants§
Provided Associated Constants§
Sourceconst VARIANT: StablePayloadVariant = StablePayloadVariant::FixedSize
const VARIANT: StablePayloadVariant = StablePayloadVariant::FixedSize
Stable-container variant supported by this type.
Provided Methods§
Sourcefn stable_type_name() -> &'static str
fn stable_type_name() -> &'static str
Returns the stable cross-process type name.
Sourcefn stable_type_detail() -> StableTypeDetail<'static>
fn stable_type_detail() -> StableTypeDetail<'static>
Returns the stable metadata detail for this type.
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.