[][src]Trait abi_stable::prefix_type::PrefixTypeTrait

pub unsafe trait PrefixTypeTrait: Sized {
    type PrefixFields;
    type PrefixRef: PrefixRefTrait<Target = WithMetadata_<Self::PrefixFields, Self::PrefixFields>, PrefixFields = Self::PrefixFields>;

    pub const METADATA: PrefixMetadata<Self, Self::PrefixFields>;
    pub const PT_LAYOUT: &'static PTStructLayout;
    pub const PT_FIELD_ACCESSIBILITY: FieldAccessibility;
    pub fn leak_into_prefix(self) -> Self::PrefixRef { ... }
}

For types deriving StableAbi with #[sabi(kind(Prefix(..)))].

Associated Types

type PrefixFields[src]

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>[src]

A pointer to Self::PrefixFields, generally wraps a PrefixRef<Self::PrefixFields>.

Those pointer types are usually named with a _Ref suffix.

Loading content...

Associated Constants

pub const METADATA: PrefixMetadata<Self, Self::PrefixFields>[src]

The metadata of the prefix-type (a FieldAccessibility and a PTStructLayout), for passing to WithMetadata::new, with WithMetadata::new(PrefixTypeTrait::METADATA,value)

pub const PT_LAYOUT: &'static PTStructLayout[src]

Describes the layout of the struct,exclusively for use in error messages.

pub const PT_FIELD_ACCESSIBILITY: FieldAccessibility[src]

A bit array,where each nth bit represents whether the nth field is accessible.

Loading content...

Provided methods

pub fn leak_into_prefix(self) -> Self::PrefixRef[src]

Convers Self to Self::PrefixRef,leaking it in the process.

Warning

You must be careful when calling this function, since this leak is ignored by miri .

Loading content...

Implementors

Loading content...