Struct Function

Source
pub struct Function<F, P, R> { /* private fields */ }
Expand description

Opaque type containing a Rust function or closure.

Trait Implementations§

Source§

impl<Z, R> FunctionExt<()> for Function<Z, (), R>
where Z: FnMut() -> R,

Source§

type Output = R

Source§

fn call_mut(&mut self, _: ()) -> Self::Output

Source§

impl<Z, R, A> FunctionExt<(A,)> for Function<Z, (A,), R>
where Z: FnMut(A) -> R,

Source§

type Output = R

Source§

fn call_mut(&mut self, params: (A,)) -> Self::Output

Source§

impl<Z, R, A, B> FunctionExt<(A, B)> for Function<Z, (A, B), R>
where Z: FnMut(A, B) -> R,

Source§

type Output = R

Source§

fn call_mut(&mut self, params: (A, B)) -> Self::Output

Source§

impl<Z, R, A, B, C> FunctionExt<(A, B, C)> for Function<Z, (A, B, C), R>
where Z: FnMut(A, B, C) -> R,

Source§

type Output = R

Source§

fn call_mut(&mut self, params: (A, B, C)) -> Self::Output

Source§

impl<Z, R, A, B, C, D> FunctionExt<(A, B, C, D)> for Function<Z, (A, B, C, D), R>
where Z: FnMut(A, B, C, D) -> R,

Source§

type Output = R

Source§

fn call_mut(&mut self, params: (A, B, C, D)) -> Self::Output

Source§

impl<Z, R, A, B, C, D, E> FunctionExt<(A, B, C, D, E)> for Function<Z, (A, B, C, D, E), R>
where Z: FnMut(A, B, C, D, E) -> R,

Source§

type Output = R

Source§

fn call_mut(&mut self, params: (A, B, C, D, E)) -> Self::Output

Source§

impl<Z, R, A, B, C, D, E, F> FunctionExt<(A, B, C, D, E, F)> for Function<Z, (A, B, C, D, E, F), R>
where Z: FnMut(A, B, C, D, E, F) -> R,

Source§

type Output = R

Source§

fn call_mut(&mut self, params: (A, B, C, D, E, F)) -> Self::Output

Source§

impl<Z, R, A, B, C, D, E, F, G> FunctionExt<(A, B, C, D, E, F, G)> for Function<Z, (A, B, C, D, E, F, G), R>
where Z: FnMut(A, B, C, D, E, F, G) -> R,

Source§

type Output = R

Source§

fn call_mut(&mut self, params: (A, B, C, D, E, F, G)) -> Self::Output

Source§

impl<Z, R, A, B, C, D, E, F, G, H> FunctionExt<(A, B, C, D, E, F, G, H)> for Function<Z, (A, B, C, D, E, F, G, H), R>
where Z: FnMut(A, B, C, D, E, F, G, H) -> R,

Source§

type Output = R

Source§

fn call_mut(&mut self, params: (A, B, C, D, E, F, G, H)) -> Self::Output

Source§

impl<Z, R, A, B, C, D, E, F, G, H, I> FunctionExt<(A, B, C, D, E, F, G, H, I)> for Function<Z, (A, B, C, D, E, F, G, H, I), R>
where Z: FnMut(A, B, C, D, E, F, G, H, I) -> R,

Source§

type Output = R

Source§

fn call_mut(&mut self, params: (A, B, C, D, E, F, G, H, I)) -> Self::Output

Source§

impl<Z, R, A, B, C, D, E, F, G, H, I, J> FunctionExt<(A, B, C, D, E, F, G, H, I, J)> for Function<Z, (A, B, C, D, E, F, G, H, I, J), R>
where Z: FnMut(A, B, C, D, E, F, G, H, I, J) -> R,

Source§

impl<Z, R> LuaPush for Function<Z, (), R>
where Z: FnMut() -> R, R: LuaPush + 'static,

Source§

fn push_to_lua(self, lua: *mut lua_State) -> i32

Pushes the value on the top of the stack. Read more
Source§

impl<Z, R, A: 'static> LuaPush for Function<Z, (A,), R>
where Z: FnMut(A) -> R, (A,): LuaRead, R: LuaPush + 'static,

Source§

fn push_to_lua(self, lua: *mut lua_State) -> i32

Pushes the value on the top of the stack. Read more
Source§

impl<Z, R, A: 'static, B: 'static> LuaPush for Function<Z, (A, B), R>
where Z: FnMut(A, B) -> R, (A, B): LuaRead, R: LuaPush + 'static,

Source§

fn push_to_lua(self, lua: *mut lua_State) -> i32

Pushes the value on the top of the stack. Read more
Source§

impl<Z, R, A: 'static, B: 'static, C: 'static> LuaPush for Function<Z, (A, B, C), R>
where Z: FnMut(A, B, C) -> R, (A, B, C): LuaRead, R: LuaPush + 'static,

Source§

fn push_to_lua(self, lua: *mut lua_State) -> i32

Pushes the value on the top of the stack. Read more
Source§

impl<Z, R, A: 'static, B: 'static, C: 'static, D: 'static> LuaPush for Function<Z, (A, B, C, D), R>
where Z: FnMut(A, B, C, D) -> R, (A, B, C, D): LuaRead, R: LuaPush + 'static,

Source§

fn push_to_lua(self, lua: *mut lua_State) -> i32

Pushes the value on the top of the stack. Read more
Source§

impl<Z, R, A: 'static, B: 'static, C: 'static, D: 'static, E: 'static> LuaPush for Function<Z, (A, B, C, D, E), R>
where Z: FnMut(A, B, C, D, E) -> R, (A, B, C, D, E): LuaRead, R: LuaPush + 'static,

Source§

fn push_to_lua(self, lua: *mut lua_State) -> i32

Pushes the value on the top of the stack. Read more
Source§

impl<Z, R, A: 'static, B: 'static, C: 'static, D: 'static, E: 'static, F: 'static> LuaPush for Function<Z, (A, B, C, D, E, F), R>
where Z: FnMut(A, B, C, D, E, F) -> R, (A, B, C, D, E, F): LuaRead, R: LuaPush + 'static,

Source§

fn push_to_lua(self, lua: *mut lua_State) -> i32

Pushes the value on the top of the stack. Read more
Source§

impl<Z, R, A: 'static, B: 'static, C: 'static, D: 'static, E: 'static, F: 'static, G: 'static> LuaPush for Function<Z, (A, B, C, D, E, F, G), R>
where Z: FnMut(A, B, C, D, E, F, G) -> R, (A, B, C, D, E, F, G): LuaRead, R: LuaPush + 'static,

Source§

fn push_to_lua(self, lua: *mut lua_State) -> i32

Pushes the value on the top of the stack. Read more
Source§

impl<Z, R, A: 'static, B: 'static, C: 'static, D: 'static, E: 'static, F: 'static, G: 'static, H: 'static> LuaPush for Function<Z, (A, B, C, D, E, F, G, H), R>
where Z: FnMut(A, B, C, D, E, F, G, H) -> R, (A, B, C, D, E, F, G, H): LuaRead, R: LuaPush + 'static,

Source§

fn push_to_lua(self, lua: *mut lua_State) -> i32

Pushes the value on the top of the stack. Read more
Source§

impl<Z, R, A: 'static, B: 'static, C: 'static, D: 'static, E: 'static, F: 'static, G: 'static, H: 'static, I: 'static> LuaPush for Function<Z, (A, B, C, D, E, F, G, H, I), R>
where Z: FnMut(A, B, C, D, E, F, G, H, I) -> R, (A, B, C, D, E, F, G, H, I): LuaRead, R: LuaPush + 'static,

Source§

fn push_to_lua(self, lua: *mut lua_State) -> i32

Pushes the value on the top of the stack. Read more
Source§

impl<Z, R, A: 'static, B: 'static, C: 'static, D: 'static, E: 'static, F: 'static, G: 'static, H: 'static, I: 'static, J: 'static> LuaPush for Function<Z, (A, B, C, D, E, F, G, H, I, J), R>
where Z: FnMut(A, B, C, D, E, F, G, H, I, J) -> R, (A, B, C, D, E, F, G, H, I, J): LuaRead, R: LuaPush + 'static,

Source§

fn push_to_lua(self, lua: *mut lua_State) -> i32

Pushes the value on the top of the stack. Read more

Auto Trait Implementations§

§

impl<F, P, R> Freeze for Function<F, P, R>
where F: Freeze,

§

impl<F, P, R> RefUnwindSafe for Function<F, P, R>

§

impl<F, P, R> Send for Function<F, P, R>
where F: Send, P: Send, R: Send,

§

impl<F, P, R> Sync for Function<F, P, R>
where F: Sync, P: Sync, R: Sync,

§

impl<F, P, R> Unpin for Function<F, P, R>
where F: Unpin, P: Unpin, R: Unpin,

§

impl<F, P, R> UnwindSafe for Function<F, P, R>
where F: UnwindSafe, P: UnwindSafe, R: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.