pub struct LuaFunction { /* private fields */ }Expand description
Handle to a Lua-callable value (Value::Closure or
Value::Native) pinned in the host root pool. Copy-able —
clones share the same HostRootTicket.
Becomes stale (panics on call) after Lua::unpin /
Lua::unpin_all.
Implementations§
Source§impl LuaFunction
impl LuaFunction
Sourcepub fn ticket(self) -> HostRootTicket
pub fn ticket(self) -> HostRootTicket
The underlying HostRootTicket. Facade-author use only.
Sourcepub fn call<A, R>(self, lua: &mut Lua, args: A) -> Result<R, LuaError>where
A: IntoLuaArgs,
R: FromLuaValue,
pub fn call<A, R>(self, lua: &mut Lua, args: A) -> Result<R, LuaError>where
A: IntoLuaArgs,
R: FromLuaValue,
Call this function with the given typed args; decode the
(first) return as R. Use LuaFunction::call_multi for
the full result vector.
Sourcepub fn call_multi<A>(
self,
lua: &mut Lua,
args: A,
) -> Result<Vec<Value>, LuaError>where
A: IntoLuaArgs,
pub fn call_multi<A>(
self,
lua: &mut Lua,
args: A,
) -> Result<Vec<Value>, LuaError>where
A: IntoLuaArgs,
Call this function; return all results.
Trait Implementations§
Source§impl Clone for LuaFunction
impl Clone for LuaFunction
Source§fn clone(&self) -> LuaFunction
fn clone(&self) -> LuaFunction
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for LuaFunction
Source§impl Debug for LuaFunction
impl Debug for LuaFunction
Source§impl IntoValue for LuaFunction
impl IntoValue for LuaFunction
Source§impl PinnedHandle for LuaFunction
impl PinnedHandle for LuaFunction
Source§fn ticket(&self) -> HostRootTicket
fn ticket(&self) -> HostRootTicket
The ticket this handle wraps.
Auto Trait Implementations§
impl Freeze for LuaFunction
impl RefUnwindSafe for LuaFunction
impl Send for LuaFunction
impl Sync for LuaFunction
impl Unpin for LuaFunction
impl UnsafeUnpin for LuaFunction
impl UnwindSafe for LuaFunction
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more