Struct libffi::high::arity4::Closure4
[−]
[src]
pub struct Closure4<'a, A, B, C, D, R> { /* fields omitted */ }
An immutable, typed closure with the given argument and result types.
Methods
impl<'a, A: CType, B: CType, C: CType, D: CType, R: CType> Closure4<'a, A, B, C, D, R>
[src]
pub fn new<Callback>(callback: &'a Callback) -> Self where
Callback: Fn(A, B, C, D) -> R + 'a,
[src]
Callback: Fn(A, B, C, D) -> R + 'a,
Constructs a typed closure callable from C from a Rust closure.
impl<'a, A, B, C, D, R> Closure4<'a, A, B, C, D, R>
[src]
pub fn code_ptr(&self) -> &extern "C" fn(_: A, _: B, _: C, _: D) -> R
[src]
Gets the C code pointer that is used to invoke the closure.
pub fn from_parts<U>(
cif: Cif4<A, B, C, D, R>,
callback: Callback4<U, A, B, C, D, R>,
userdata: &'a U
) -> Self
[src]
cif: Cif4<A, B, C, D, R>,
callback: Callback4<U, A, B, C, D, R>,
userdata: &'a U
) -> Self
Constructs a typed closure callable from C from a CIF describing the calling convention for the resulting function, a callback for the function to call, and userdata to pass to the callback.
impl<'a, A: Copy, B: Copy, C: Copy, D: Copy, R> Closure4<'a, A, B, C, D, R>
[src]
pub fn new_with_cif<Callback>(
cif: Cif4<A, B, C, D, R>,
callback: &'a Callback
) -> Self where
Callback: Fn(A, B, C, D) -> R + 'a,
[src]
cif: Cif4<A, B, C, D, R>,
callback: &'a Callback
) -> Self where
Callback: Fn(A, B, C, D) -> R + 'a,
Constructs a typed closure callable from C from a CIF describing the calling convention for the resulting function and the Rust closure to call.