[−][src]Trait abi_stable::prefix_type::PrefixTypeTrait
For types deriving StableAbi
with #[sabi(kind(Prefix(..)))]
.
Associated Types
type Prefix
A type only accessible through a shared reference.
The fields after the #[sabi(last_prefix_field)]
attribute are
only potentially accessible in their <field_name>
methods,
since their existence has to be checked at runtime.
This is because multiple versions of the library may be loaded,
where in some of them those fields don't exist.
Associated Constants
const METADATA: WithMetadataFor<Self, Self::Prefix>
The metadata of the prefix-type (a FieldAccessibility and a PTStructLayout),
for passing to WithMetadata::new
,
with WithMetadata::new(PrefixTypeTrait::METADATA,value)
const PT_LAYOUT: &'static PTStructLayout
Describes the layout of the struct,exclusively for use in error messages.
const PT_FIELD_ACCESSIBILITY: FieldAccessibility
A bit array,where the bit at the field index represents whether that field is accessible.
Provided methods
fn into_with_metadata(self) -> WithMetadata<Self>
Converts self
to a WithMetadata<Self>
,
which is itself convertible to a reference to Self::Prefix
with
the as_prefix
methods.
fn leak_into_prefix<'a>(self) -> &'a Self::Prefix where
Self: 'a,
Self::Prefix: 'a,
Self: 'a,
Self::Prefix: 'a,
Convers Self
to &'a Self::Prefix
,leaking it in the process.