[][src]Trait abi_stable::prefix_type::PrefixRefTrait

pub unsafe trait PrefixRefTrait: Sized + ImmutableRef {
    type PrefixFields: GetWithMetadata<ForSelf = Self::Target>;

    pub const PREFIX_FIELDS: PointsToPrefixFields<Self, Self::PrefixFields>;
    pub fn from_prefix_ref(this: PrefixRef<Self::PrefixFields>) -> Self { ... }
pub fn to_prefix_ref(self) -> PrefixRef<Self::PrefixFields> { ... } }

Marker trait for pointers to prefix field structs.

Generally prefix field structs are named with a _Prefix suffix, and have all the fields of some other struct up to the one with a #[sabi(last_prefix_field)] attribute.

Safety

Self must either be PrefixRef<Self::PrefixFields>, or a #[repr(transparent)] wrapper around one.

Associated Types

type PrefixFields: GetWithMetadata<ForSelf = Self::Target>[src]

A struct that contains all the fields of some other struct up to the field annotated with #[sabi(last_prefix_field)] inclusive.

Those structs are usually named with a _Prefix suffix.

Loading content...

Associated Constants

pub const PREFIX_FIELDS: PointsToPrefixFields<Self, Self::PrefixFields>[src]

A type used to prove that the This type parameter in PointsToPrefixFields<This, PF> implements PrefixRefTrait<PrefixFields = PF>.

Loading content...

Provided methods

pub fn from_prefix_ref(this: PrefixRef<Self::PrefixFields>) -> Self[src]

Converts a PrefixRef to Self

pub fn to_prefix_ref(self) -> PrefixRef<Self::PrefixFields>[src]

Converts Self to a PrefixRef

Loading content...

Implementors

impl PrefixRefTrait for Module_Ref[src]

impl<P> PrefixRefTrait for PrefixRef<P>[src]

type PrefixFields = P

Loading content...