Struct libffi::high::arity2::Closure2
[−]
[src]
pub struct Closure2<'a, A, B, R> { /* fields omitted */ }
An immutable, typed closure with the given argument and result types.
Methods
impl<'a, A: CType, B: CType, R: CType> Closure2<'a, A, B, R>
[src]
fn new<Callback>(callback: &'a Callback) -> Self where Callback: Fn(A, B) -> R + 'a
Constructs a typed closure callable from C from a Rust closure.
impl<'a, A, B, R> Closure2<'a, A, B, R>
[src]
fn code_ptr(&self) -> &extern fn(_: A, _: B) -> R
Gets the C code pointer that is used to invoke the closure.
fn from_parts<U>(cif: Cif2<A, B, R>,
callback: Callback2<U, A, B, R>,
userdata: &'a U)
-> Self
callback: Callback2<U, A, B, 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, R> Closure2<'a, A, B, R>
[src]
fn new_with_cif<Callback>(cif: Cif2<A, B, R>, callback: &'a Callback) -> Self where Callback: Fn(A, B) -> 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.