Skip to main content

FromLuaValue

Trait FromLuaValue 

Source
pub trait FromLuaValue: Sized {
    // Required method
    fn from_lua_value(v: Value) -> Result<Self, LuaError>;
}
Expand description

Decode a Value into a typed Rust value. Strict — no implicit coercions beyond what Lua itself does (an exactly-integral float can stand in for an integer).

Required Methods§

Source

fn from_lua_value(v: Value) -> Result<Self, LuaError>

Decode a single Lua Value into Self. Returns a LuaError("type mismatch …") if the value’s type does not match.

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementations on Foreign Types§

Source§

impl FromLuaValue for String

Source§

impl FromLuaValue for Vec<u8>

Source§

impl FromLuaValue for bool

Source§

impl FromLuaValue for f64

Source§

impl FromLuaValue for i64

Source§

impl<T> FromLuaValue for Option<T>
where T: FromLuaValue,

Implementors§