[][src]Trait metatype::Type

pub trait Type {
    type Meta: 'static;

    const METATYPE: MetaType;

    fn meta(self: *const Self) -> Self::Meta;
fn data(self: *const Self) -> *const ();
fn data_mut(self: *mut Self) -> *mut ();
fn dangling(t: Self::Meta) -> NonNull<Self>;
fn fatten(thin: *mut (), t: Self::Meta) -> *mut Self; fn meta_type(self: *const Self) -> MetaType { ... } }

Implemented on all types, it provides helper methods to determine whether a type is TraitObject, Slice or Concrete, and work with them respectively.

Associated Types

type Meta: 'static

Type of metadata for type.

Loading content...

Associated Constants

const METATYPE: MetaType

Enum describing whether a type is TraitObject, Slice or Concrete.

Loading content...

Required methods

fn meta(self: *const Self) -> Self::Meta

Retrieve TraitObject, Slice or Concrete meta data respectively for a type

fn data(self: *const Self) -> *const ()

Retrieve pointer to the data

fn data_mut(self: *mut Self) -> *mut ()

Retrieve mut pointer to the data

fn dangling(t: Self::Meta) -> NonNull<Self>

Create a dangling non-null *const Self with the provided Self::Meta.

fn fatten(thin: *mut (), t: Self::Meta) -> *mut Self

Create a *mut Self with the provided Self::Meta.

Loading content...

Provided methods

fn meta_type(self: *const Self) -> MetaType

Helper method describing whether a type is TraitObject, Slice or Concrete.

Loading content...

Implementors

impl<T: ?Sized> Type for T[src]

Loading content...