pub struct Function<A, R> { /* private fields */ }Expand description
A wrapper around a Lua reference to a function stored in the Lua registry.
Implementations
sourceimpl<A, R> Function<A, R>
impl<A, R> Function<A, R>
pub fn from_fn<F, E>(fun: F) -> Function<A, R>where
F: 'static + Fn(A) -> Result<R, E>,
A: Poppable,
R: Pushable,
E: 'static + Error,
pub fn from_fn_mut<F, E>(fun: F) -> Function<A, R>where
F: 'static + FnMut(A) -> Result<R, E>,
A: Poppable,
R: Pushable,
E: 'static + Error,
pub fn from_fn_once<F, E>(fun: F) -> Function<A, R>where
F: 'static + FnOnce(A) -> Result<R, E>,
A: Poppable,
R: Pushable,
E: 'static + Error,
pub fn call(&self, args: A) -> Result<R, Error>where
A: Pushable,
R: Poppable,
Trait Implementations
sourceimpl<'de, A, R> Deserialize<'de> for Function<A, R>
impl<'de, A, R> Deserialize<'de> for Function<A, R>
sourcefn deserialize<D>(
deserializer: D
) -> Result<Function<A, R>, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
fn deserialize<D>(
deserializer: D
) -> Result<Function<A, R>, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
sourceimpl<A, R, F, E> From<F> for Function<A, R>where
F: 'static + FnMut(A) -> Result<R, E>,
A: Poppable,
R: Pushable,
E: 'static + Error,
impl<A, R, F, E> From<F> for Function<A, R>where
F: 'static + FnMut(A) -> Result<R, E>,
A: Poppable,
R: Pushable,
E: 'static + Error,
sourceimpl<A, R> FromObject for Function<A, R>
impl<A, R> FromObject for Function<A, R>
sourceimpl<A, R> PartialEq<Function<A, R>> for Function<A, R>where
A: PartialEq<A>,
R: PartialEq<R>,
impl<A, R> PartialEq<Function<A, R>> for Function<A, R>where
A: PartialEq<A>,
R: PartialEq<R>,
sourceimpl<A, R> Serialize for Function<A, R>
impl<A, R> Serialize for Function<A, R>
sourcefn serialize<S>(
&self,
serializer: S
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where
S: Serializer,
fn serialize<S>(
&self,
serializer: S
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where
S: Serializer,
Serialize this value into the given Serde serializer. Read more
impl<A, R> Eq for Function<A, R>where
A: Eq,
R: Eq,
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
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
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