abi_stable::abi_stability::stable_abi_trait

Trait PrefixStableAbi

Source
pub unsafe trait PrefixStableAbi: GetStaticEquivalent_ {
    type IsNonZeroType: Boolean;

    const LAYOUT: &'static TypeLayout;
    const ABI_CONSTS: AbiConsts = _;
}
Expand description

A type that only has a stable layout when a PrefixRef to it is used.

Types that implement this trait usually have a _Prefix suffix.

§Safety

This trait can only be implemented by the StableAbi derive on types that also use the #[sabi(kind(Prefix))] attribute, implementing the trait for a macro generated type.

Required Associated Constants§

Source

const LAYOUT: &'static TypeLayout

The layout of the type, provided by implementors.

Provided Associated Constants§

Source

const ABI_CONSTS: AbiConsts = _

const-equivalents of the associated types.

Required Associated Types§

Source

type IsNonZeroType: Boolean

Whether this type has a single invalid bit-pattern.

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.

Implementors§