pub trait UserDataTrans<T>: Sized {
    type Read<'a>
       where T: 'a;
    type Write<'a>
       where T: 'a;

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

    // Required method
    fn trans(udata: T) -> Self;

    // Provided method
    unsafe fn when_drop(&mut self) { ... }
}

Required Associated Types§

source

type Read<'a> where T: 'a

source

type Write<'a> where T: 'a

Provided Associated Constants§

source

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

Required Methods§

source

fn trans(udata: T) -> Self

Provided Methods§

source

unsafe fn when_drop(&mut self)

Implementations on Foreign Types§

source§

impl<T> UserDataTrans<T> for RefCell<T>

§

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

§

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

source§

fn trans(udata: T) -> Self

Implementors§

source§

impl<T> UserDataTrans<T> for MaybePointer<T>

§

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

§

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

source§

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

source§

impl<T> UserDataTrans<T> for T

§

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

§

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