pub struct Function<A, R> { /* private fields */ }Expand description
A wrapper around a Lua reference to a function stored in the Lua registry.
Implementations§
source§impl<A, R> Function<A, R>
impl<A, R> Function<A, R>
pub fn from_fn<F, E>(fun: F) -> Selfwhere F: Fn(A) -> Result<R, E> + 'static, A: Poppable, R: Pushable, E: StdError + 'static,
pub fn from_fn_mut<F, E>(fun: F) -> Selfwhere F: FnMut(A) -> Result<R, E> + 'static, A: Poppable, R: Pushable, E: StdError + 'static,
pub fn from_fn_once<F, E>(fun: F) -> Selfwhere F: FnOnce(A) -> Result<R, E> + 'static, A: Poppable, R: Pushable, E: StdError + 'static,
pub fn call(&self, args: A) -> Result<R, Error>where A: Pushable, R: Poppable,
Trait Implementations§
source§impl<A, R, F, E> From<F> for Function<A, R>where
F: FnMut(A) -> Result<R, E> + 'static,
A: Poppable,
R: Pushable,
E: StdError + 'static,
impl<A, R, F, E> From<F> for Function<A, R>where F: FnMut(A) -> Result<R, E> + 'static, A: Poppable, R: Pushable, E: StdError + 'static,
source§impl<A, R> FromObject for Function<A, R>
impl<A, R> FromObject for Function<A, R>
source§impl<A: PartialEq, R: PartialEq> PartialEq<Function<A, R>> for Function<A, R>
impl<A: PartialEq, R: PartialEq> PartialEq<Function<A, R>> for Function<A, R>
impl<A: Eq, R: Eq> Eq for Function<A, R>
impl<A, R> StructuralEq for Function<A, R>
impl<A, R> StructuralPartialEq for Function<A, R>
Auto Trait Implementations§
impl<A, R> RefUnwindSafe for Function<A, R>where A: RefUnwindSafe, R: RefUnwindSafe,
impl<A, R> Send for Function<A, R>where A: Send, R: Send,
impl<A, R> Sync for Function<A, R>where A: Sync, R: Sync,
impl<A, R> Unpin for Function<A, R>where A: Unpin, R: Unpin,
impl<A, R> UnwindSafe for Function<A, R>where A: UnwindSafe, R: UnwindSafe,
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