[][src]Trait rel_ptr::MetaData

pub unsafe trait MetaData {
    type Data: Copy + Eq;
    fn data(this: &Self) -> Self::Data;
unsafe fn compose(ptr: Ptr<u8>, data: Self::Data) -> Ptr<Self>; }

A trait to abstract over the sizedness of types, and to access metadata about a type

If Custom DST lands and stablizes, then it will replace MetaData

Associated Types

type Data: Copy + Eq

the type of meta data a type carries

Loading content...

Required methods

fn data(this: &Self) -> Self::Data

decompose a type into a thin pointer and some metadata

unsafe fn compose(ptr: Ptr<u8>, data: Self::Data) -> Ptr<Self>

recompose a type from a thin pointer and some metadata

it is guarenteed that the metadata is

  • ptr == None Self::Data is undefined
  • ptr != None generated from MetaData::data
Loading content...

Implementations on Foreign Types

impl<T> MetaData for [T][src]

type Data = usize

impl MetaData for str[src]

type Data = usize

Loading content...

Implementors

impl<T> MetaData for T[src]

type Data = ()

Loading content...