Trait metatype::Type [−][src]
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 { ... } }
Expand description
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
Associated Constants
Required methods
fn meta(self: *const Self) -> Self::Meta
fn meta(self: *const Self) -> Self::Meta
Retrieve TraitObject
, Slice
or Concrete
meta data respectively for a type
fn data(self: *const Self) -> *const ()
fn data(self: *const Self) -> *const ()
Retrieve pointer to the data
Create a dangling non-null *const Self
with the provided Self::Meta
.
Provided methods
fn meta_type(self: *const Self) -> MetaType
fn meta_type(self: *const Self) -> MetaType
Helper method describing whether a type is TraitObject
, Slice
or Concrete
.