pub trait Type {
type Meta: 'static;
const METATYPE: MetaType;
// Required methods
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;
// Provided method
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.
Required Associated Constants§
Required Associated Types§
Required Methods§
Sourcefn meta(self: *const Self) -> Self::Meta
fn meta(self: *const Self) -> Self::Meta
Retrieve TraitObject, Slice or Concrete meta data respectively for a type
Provided Methods§
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.