Trait abi_stable::prefix_type::PrefixTypeTrait [−][src]
pub unsafe trait PrefixTypeTrait: Sized {
type PrefixFields;
type PrefixRef: PrefixRefTrait<Target = WithMetadata_<Self::PrefixFields, Self::PrefixFields>, PrefixFields = Self::PrefixFields>;
const METADATA: PrefixMetadata<Self, Self::PrefixFields>;
const PT_LAYOUT: &'static PTStructLayout;
const PT_FIELD_ACCESSIBILITY: FieldAccessibility;
fn leak_into_prefix(self) -> Self::PrefixRef { ... }
}
Expand description
For types deriving StableAbi
with #[sabi(kind(Prefix(..)))]
.
Associated Types
type PrefixFields
type PrefixFields
A struct that contains all the fields up to the field annotated with
#[sabi(last_prefix_field)]
inclusive.
Those structs are usually named with a _Prefix
suffix.
type PrefixRef: PrefixRefTrait<Target = WithMetadata_<Self::PrefixFields, Self::PrefixFields>, PrefixFields = Self::PrefixFields>
type PrefixRef: PrefixRefTrait<Target = WithMetadata_<Self::PrefixFields, Self::PrefixFields>, PrefixFields = Self::PrefixFields>
A pointer to Self::PrefixFields
,
generally wraps a PrefixRef<Self::PrefixFields>
.
Those pointer types are usually named with a _Ref
suffix.
Associated Constants
const METADATA: PrefixMetadata<Self, Self::PrefixFields>
const METADATA: PrefixMetadata<Self, Self::PrefixFields>
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
const PT_LAYOUT: &'static PTStructLayout
Describes the layout of the struct,exclusively for use in error messages.
A bit array,where each nth bit represents whether the nth field is accessible.