pub trait UserDataTrans<T: UserData>: Sized {
    type Read<'a>: Deref<Target = T>
       where T: 'a,
             Self: 'a;
    type Write<'a>
       where T: 'a;

    const FROM_INNER: fn(_: T) -> Self;
    const INTO_INNER: fn(_: Self) -> T;
    const INIT_USERDATA: Option<fn(_: &State, _: &mut Self)> = None;

    // Required method
    fn read(&self) -> Self::Read<'_>;
}

Required Associated Types§

source

type Read<'a>: Deref<Target = T> where T: 'a, Self: 'a

source

type Write<'a> where T: 'a

Required Associated Constants§

source

const FROM_INNER: fn(_: T) -> Self

source

const INTO_INNER: fn(_: Self) -> T

Provided Associated Constants§

source

const INIT_USERDATA: Option<fn(_: &State, _: &mut Self)> = None

Required Methods§

source

fn read(&self) -> Self::Read<'_>

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl<T: UserData> UserDataTrans<T> for RefCell<T>

§

type Read<'a> = Ref<'a, T> where T: 'a

§

type Write<'a> = RefMut<'a, T> where T: 'a

source§

const FROM_INNER: fn(_: T) -> Self = RefCell::new

source§

const INTO_INNER: fn(_: Self) -> T = RefCell::into_inner

source§

fn read(&self) -> Self::Read<'_>

Implementors§

source§

impl<T: UserData> UserDataTrans<T> for MaybePointer<T>

§

type Read<'a> = MaybePtrRef<'a, T> where T: 'a

§

type Write<'a> = () where T: 'a

source§

const FROM_INNER: fn(_: T) -> Self = _

source§

const INTO_INNER: fn(_: Self) -> T = _

source§

impl<T: UserData> UserDataTrans<T> for T

§

type Read<'a> = &'a T where T: 'a

§

type Write<'a> = &'a mut T where T: 'a

source§

const FROM_INNER: fn(_: T) -> Self = core::convert::identity

source§

const INTO_INNER: fn(_: Self) -> T = core::convert::identity