Skip to main content

ToLua

Trait ToLua 

Source
pub trait ToLua {
    // Required method
    fn to_lua(&self, state: &mut State);
}
Expand description

Trait for types that can be pushed onto the stack of a Lua state.

It is important that implementors of this trait ensure that to_lua behaves like one of the lua_push* functions for consistency.

Required Methods§

Source

fn to_lua(&self, state: &mut State)

Pushes a value of type Self onto the stack of a Lua state.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl ToLua for String

Source§

fn to_lua(&self, state: &mut State)

Source§

impl ToLua for bool

Source§

fn to_lua(&self, state: &mut State)

Source§

impl<'a> ToLua for &'a str

Source§

fn to_lua(&self, state: &mut State)

Source§

impl<T: ToLua> ToLua for Option<T>

Source§

fn to_lua(&self, state: &mut State)

Source§

impl<T> ToLua for *mut T

Source§

fn to_lua(&self, state: &mut State)

Implementors§