Trait tlua::AsCData

source ·
pub unsafe trait AsCData: Sized + 'static {
    // Required method
    fn ctypeid() -> CTypeID;
}
Expand description

AsCData Types implementing this trait can be represented as luajit’s cdata.

Safety

The implementor must make sure that the type can actually be used as cdata, for example the CTypeID must be correct and the size of the type must be the same as ffi.sizeof(<typeid>)

Required Methods§

source

fn ctypeid() -> CTypeID

This function will be called every time the ctypeid is needed, so implement your own caching if it’s required.

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl AsCData for bool

source§

impl AsCData for f32

source§

impl AsCData for f64

source§

impl AsCData for i8

source§

impl AsCData for i16

source§

impl AsCData for i32

source§

impl AsCData for i64

source§

impl AsCData for isize

source§

impl AsCData for *const c_char

source§

impl AsCData for *const c_void

source§

impl AsCData for *mut c_void

source§

impl AsCData for u8

source§

impl AsCData for u16

source§

impl AsCData for u32

source§

impl AsCData for u64

source§

impl AsCData for usize

Implementors§