pub trait FromLuaMulti<'lua>: Sized {
// Required method
fn from_lua_multi(
values: MultiValue<'lua>,
lua: Context<'lua>,
) -> Result<Self, Error>;
}
Expand description
Trait for types that can be created from an arbitrary number of Lua values.
This is a generalization of FromLua
, allowing an arbitrary number of Lua values to participate
in the conversion. Any type that implements FromLua
will automatically implement this trait.
Required Methods§
Sourcefn from_lua_multi(
values: MultiValue<'lua>,
lua: Context<'lua>,
) -> Result<Self, Error>
fn from_lua_multi( values: MultiValue<'lua>, lua: Context<'lua>, ) -> Result<Self, Error>
Performs the conversion.
In case values
contains more values than needed to perform the conversion, the excess
values should be ignored. This reflects the semantics of Lua when calling a function or
assigning values. Similarly, if not enough values are given, conversions should assume that
any missing values are nil.
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.