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
sourceimpl<'a, 'b> Clone for LuaFunction<'a, 'b>
impl<'a, 'b> Clone for LuaFunction<'a, 'b>
sourcefn clone(&self) -> LuaFunction<'a, 'b>
fn clone(&self) -> LuaFunction<'a, 'b>
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl<'a, 'b> Debug for LuaFunction<'a, 'b>
impl<'a, 'b> Debug for LuaFunction<'a, 'b>
sourceimpl<'a, 'b> Function for LuaFunction<'a, 'b>
impl<'a, 'b> Function for LuaFunction<'a, 'b>
sourcefn chunk_name(&self) -> Option<&str>
fn chunk_name(&self) -> Option<&str>
Chunk name which was used to create function (if known)
sourcefn 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
sourcefn 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 values
sourcefn 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 values
sourcefn 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 value
sourcefn 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 values
sourcefn 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 values
sourceimpl<'a, 'b> Hash for LuaFunction<'a, 'b>
impl<'a, 'b> Hash for LuaFunction<'a, 'b>
sourceimpl<'a, 'b> PartialEq<LuaFunction<'a, 'b>> for LuaFunction<'a, 'b>
impl<'a, 'b> PartialEq<LuaFunction<'a, 'b>> for LuaFunction<'a, 'b>
sourcefn 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 ==
. Read more
sourcefn ne(&self, other: &LuaFunction<'a, 'b>) -> bool
fn ne(&self, other: &LuaFunction<'a, 'b>) -> bool
This method tests for !=
.
impl<'a, 'b> Eq for LuaFunction<'a, 'b>
impl<'a, 'b> StructuralEq for LuaFunction<'a, 'b>
impl<'a, 'b> StructuralPartialEq for LuaFunction<'a, 'b>
Auto Trait Implementations
impl<'a, 'b> RefUnwindSafe for LuaFunction<'a, 'b>
impl<'a, 'b> !Send for LuaFunction<'a, 'b>
impl<'a, 'b> !Sync for LuaFunction<'a, 'b>
impl<'a, 'b> Unpin for LuaFunction<'a, 'b>
impl<'a, 'b> UnwindSafe for LuaFunction<'a, 'b>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more