Struct mlua::MultiValue

source ·
pub struct MultiValue<'lua> { /* private fields */ }
Expand description

Multiple Lua values used for both argument passing and also for multiple return values.

Implementations§

source§

impl<'lua> MultiValue<'lua>

source

pub const fn new() -> MultiValue<'lua>

Creates an empty MultiValue containing no values.

source§

impl<'lua> MultiValue<'lua>

source

pub fn from_vec(vec: Vec<Value<'lua>>) -> MultiValue<'lua>

source

pub fn into_vec(self) -> Vec<Value<'lua>>

source

pub fn get(&self, index: usize) -> Option<&Value<'lua>>

source

pub fn pop_front(&mut self) -> Option<Value<'lua>>

source

pub fn push_front(&mut self, value: Value<'lua>)

source

pub fn clear(&mut self)

source

pub fn len(&self) -> usize

source

pub fn is_empty(&self) -> bool

source

pub fn iter(&self) -> Rev<Iter<'_, Value<'lua>>>

Trait Implementations§

source§

impl<'lua> Clone for MultiValue<'lua>

source§

fn clone(&self) -> MultiValue<'lua>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<'lua> Debug for MultiValue<'lua>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<'lua> Default for MultiValue<'lua>

source§

fn default() -> MultiValue<'lua>

Returns the “default value” for a type. Read more
source§

impl Drop for MultiValue<'_>

source§

fn drop(&mut self)

Executes the destructor for this type. Read more
source§

impl<'lua> FromIterator<Value<'lua>> for MultiValue<'lua>

source§

fn from_iter<I: IntoIterator<Item = Value<'lua>>>(iter: I) -> Self

Creates a value from an iterator. Read more
source§

impl<'lua> FromLuaMulti<'lua> for MultiValue<'lua>

source§

fn from_lua_multi(values: MultiValue<'lua>, _: &'lua Lua) -> Result<Self>

Performs the conversion. Read more
source§

impl<'lua> Index<usize> for MultiValue<'lua>

§

type Output = Value<'lua>

The returned type after indexing.
source§

fn index(&self, index: usize) -> &Self::Output

Performs the indexing (container[index]) operation. Read more
source§

impl<'a, 'lua> IntoIterator for &'a MultiValue<'lua>

§

type Item = &'a Value<'lua>

The type of the elements being iterated over.
§

type IntoIter = Rev<Iter<'a, Value<'lua>>>

Which kind of iterator are we turning this into?
source§

fn into_iter(self) -> Self::IntoIter

Creates an iterator from a value. Read more
source§

impl<'lua> IntoIterator for MultiValue<'lua>

§

type Item = Value<'lua>

The type of the elements being iterated over.
§

type IntoIter = Rev<IntoIter<Value<'lua>>>

Which kind of iterator are we turning this into?
source§

fn into_iter(self) -> Self::IntoIter

Creates an iterator from a value. Read more
source§

impl<'lua> IntoLuaMulti<'lua> for MultiValue<'lua>

source§

fn into_lua_multi(self, _: &'lua Lua) -> Result<MultiValue<'lua>>

Performs the conversion.

Auto Trait Implementations§

§

impl<'lua> Freeze for MultiValue<'lua>

§

impl<'lua> !RefUnwindSafe for MultiValue<'lua>

§

impl<'lua> !Send for MultiValue<'lua>

§

impl<'lua> !Sync for MultiValue<'lua>

§

impl<'lua> Unpin for MultiValue<'lua>

§

impl<'lua> !UnwindSafe for MultiValue<'lua>

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.