[−][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,
with access to the fields of Self at and before #[sabi(last_prefix_field)]
.
The fields after the #[sabi(last_prefix_field)]
attribute are
only accessible through <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>
Just the metadata of Self,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_COUNT: usize
The ammount of fields in the struct
Provided methods
fn into_with_metadata(self) -> WithMetadata<Self>
Converts self
to a WithMetadata<Self>
,.
fn leak_into_prefix<'a>(self) -> &'a Self::Prefix where
Self: 'a,
Self::Prefix: 'a,
Self: 'a,
Self::Prefix: 'a,
Convers Self
to its WithMetadata<Self>
,
then leaks it and casts it to &'a Self::Prefix
.