Struct sandkiste_lua::v5_3::LuaFunction
source · pub struct LuaFunction<'a, 'b> { /* private fields */ }
Expand description
Lua function
A function inside the Lua machine can be referenced from Rust through a
LuaFunction
. See Function
trait for information on how to use this
type.
Lifetimes
Lifetime argument 'a
corresponds to the lifetime argument 'a
of
LuaMachine
. It is a lower bound for closures passed to the Lua machine.
Lifetime argument 'b
corresponds to the lifetime of the shared reference
to the LuaMachine
being worked with.
Trait Implementations§
source§impl<'a, 'b> Clone for LuaFunction<'a, 'b>
impl<'a, 'b> Clone for LuaFunction<'a, 'b>
source§fn clone(&self) -> LuaFunction<'a, 'b>
fn clone(&self) -> LuaFunction<'a, 'b>
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl<'a, 'b> Debug for LuaFunction<'a, 'b>
impl<'a, 'b> Debug for LuaFunction<'a, 'b>
source§impl<'a, 'b, 'c> From<LuaFunction<'a, 'b>> for LuaDatum<'a, 'b, 'c>
impl<'a, 'b, 'c> From<LuaFunction<'a, 'b>> for LuaDatum<'a, 'b, 'c>
source§fn from(value: LuaFunction<'a, 'b>) -> Self
fn from(value: LuaFunction<'a, 'b>) -> Self
Converts to this type from the input type.
source§impl<'a, 'b> Function for LuaFunction<'a, 'b>
impl<'a, 'b> Function for LuaFunction<'a, 'b>
source§fn chunk_name(&self) -> Option<&str>
fn chunk_name(&self) -> Option<&str>
Chunk name which was used to create function (if known)
source§fn call<'c, A>(
&self,
args: A
) -> Result<Vec<LuaDatum<'a, 'b, 'static>>, MachineError>where
A: IntoIterator<Item = LuaDatum<'a, 'b, 'c>>,
<A as IntoIterator>::IntoIter: ExactSizeIterator,
fn call<'c, A>( &self, args: A ) -> Result<Vec<LuaDatum<'a, 'b, 'static>>, MachineError>where A: IntoIterator<Item = LuaDatum<'a, 'b, 'c>>, <A as IntoIterator>::IntoIter: ExactSizeIterator,
Call the function
source§fn call_expect_retvals<'c, A>(
&self,
count: usize,
args: A
) -> Result<Vec<Self::Datum<'static>, Global>, MachineError>where
A: IntoIterator<Item = Self::Datum<'c>>,
<A as IntoIterator>::IntoIter: ExactSizeIterator,
fn call_expect_retvals<'c, A>( &self, count: usize, args: A ) -> Result<Vec<Self::Datum<'static>, Global>, MachineError>where A: IntoIterator<Item = Self::Datum<'c>>, <A as IntoIterator>::IntoIter: ExactSizeIterator,
Same as
Function::call
but expects a fixed number of return valuessource§fn call_expect_min_retvals<'c, A>(
&self,
count: usize,
args: A
) -> Result<Vec<Self::Datum<'static>, Global>, MachineError>where
A: IntoIterator<Item = Self::Datum<'c>>,
<A as IntoIterator>::IntoIter: ExactSizeIterator,
fn call_expect_min_retvals<'c, A>( &self, count: usize, args: A ) -> Result<Vec<Self::Datum<'static>, Global>, MachineError>where A: IntoIterator<Item = Self::Datum<'c>>, <A as IntoIterator>::IntoIter: ExactSizeIterator,
Same as
Function::call
but expects a minimum number of return valuessource§fn call_1ret<'c, A>(
&self,
args: A
) -> Result<Self::Datum<'static>, MachineError>where
A: IntoIterator<Item = Self::Datum<'c>>,
<A as IntoIterator>::IntoIter: ExactSizeIterator,
fn call_1ret<'c, A>( &self, args: A ) -> Result<Self::Datum<'static>, MachineError>where A: IntoIterator<Item = Self::Datum<'c>>, <A as IntoIterator>::IntoIter: ExactSizeIterator,
Same as
Function::call
but expects exactly one return valuesource§fn call_2ret<'c, A>(
&self,
args: A
) -> Result<(Self::Datum<'static>, Self::Datum<'static>), MachineError>where
A: IntoIterator<Item = Self::Datum<'c>>,
<A as IntoIterator>::IntoIter: ExactSizeIterator,
fn call_2ret<'c, A>( &self, args: A ) -> Result<(Self::Datum<'static>, Self::Datum<'static>), MachineError>where A: IntoIterator<Item = Self::Datum<'c>>, <A as IntoIterator>::IntoIter: ExactSizeIterator,
Same as
Function::call
but expects exactly two return valuessource§fn call_3ret<'c, A>(
&self,
args: A
) -> Result<(Self::Datum<'static>, Self::Datum<'static>, Self::Datum<'static>), MachineError>where
A: IntoIterator<Item = Self::Datum<'c>>,
<A as IntoIterator>::IntoIter: ExactSizeIterator,
fn call_3ret<'c, A>( &self, args: A ) -> Result<(Self::Datum<'static>, Self::Datum<'static>, Self::Datum<'static>), MachineError>where A: IntoIterator<Item = Self::Datum<'c>>, <A as IntoIterator>::IntoIter: ExactSizeIterator,
Same as
Function::call
but expects exactly three return valuessource§impl<'a, 'b> Hash for LuaFunction<'a, 'b>
impl<'a, 'b> Hash for LuaFunction<'a, 'b>
source§impl<'a, 'b> PartialEq<LuaFunction<'a, 'b>> for LuaFunction<'a, 'b>
impl<'a, 'b> PartialEq<LuaFunction<'a, 'b>> for LuaFunction<'a, 'b>
source§fn eq(&self, other: &LuaFunction<'a, 'b>) -> bool
fn eq(&self, other: &LuaFunction<'a, 'b>) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.