Trait tlua::Push

source ·
pub trait Push<L: AsLua> {
    type Err;

    fn push_to_lua(&self, lua: L) -> Result<PushGuard<L>, (Self::Err, L)>;

    fn push_no_err(&self, lua: L) -> PushGuard<L>
    where
        <Self as Push<L>>::Err: Into<Void>
, { ... } }
Expand description

Types implementing this trait can be pushed onto the Lua stack by reference.

Required Associated Types§

Error that can happen when pushing a value.

Required Methods§

Pushes the value on the top of the stack.

Must return a guard representing the elements that have been pushed.

You can implement this for any type you want by redirecting to call to another implementation (for example 5.push_to_lua) or by calling userdata::push_userdata.

Provided Methods§

Same as push_to_lua but can only succeed and is only available if Err implements Into<Void>.

Implementations on Foreign Types§

Vec

[T]

[T; N]

Implementors§