Trait FromLua

Source
pub trait FromLua: Sized {
    // Required method
    fn from_lua(state: &mut State, index: Index) -> Option<Self>;
}
Expand description

Trait for types that can be taken from the Lua stack.

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

Required Methods§

Source

fn from_lua(state: &mut State, index: Index) -> Option<Self>

Converts the value on top of the stack of a Lua state to a value of type Option<Self>.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl FromLua for bool

Source§

fn from_lua(state: &mut State, index: Index) -> Option<bool>

Source§

impl FromLua for String

Source§

fn from_lua(state: &mut State, index: Index) -> Option<String>

Implementors§