Struct libffi::high::arity2::ClosureMut2
source · pub struct ClosureMut2<'a, A, B, R> { /* private fields */ }
Expand description
A mutable, typed closure with the given argument and result types.
Implementations§
source§impl<'a, A: CType, B: CType, R: CType> ClosureMut2<'a, A, B, R>
impl<'a, A: CType, B: CType, R: CType> ClosureMut2<'a, A, B, R>
sourcepub fn new<Callback>(callback: &'a mut Callback) -> Selfwhere
Callback: FnMut(A, B) -> R + 'a,
pub fn new<Callback>(callback: &'a mut Callback) -> Selfwhere Callback: FnMut(A, B) -> R + 'a,
Constructs a typed closure callable from C from a Rust closure.
source§impl<'a, A, B, R: CType> ClosureMut2<'a, A, B, R>
impl<'a, A, B, R: CType> ClosureMut2<'a, A, B, R>
sourcepub fn code_ptr(&self) -> &FnPtr2<'a, A, B, R>
pub fn code_ptr(&self) -> &FnPtr2<'a, A, B, R>
Gets the C code pointer that is used to invoke the closure.
sourcepub fn from_parts<U>(
cif: Cif2<A, B, R>,
callback: CallbackMut2<U, A, B, R::RetType>,
userdata: &'a mut U
) -> Self
pub fn from_parts<U>( cif: Cif2<A, B, R>, callback: CallbackMut2<U, A, B, R::RetType>, userdata: &'a mut 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. Note that the return type of the callback must follow the libffi implicit extension rules.
source§impl<'a, A: Copy, B: Copy, R: CType> ClosureMut2<'a, A, B, R>
impl<'a, A: Copy, B: Copy, R: CType> ClosureMut2<'a, A, B, R>
sourcepub fn new_with_cif<Callback>(
cif: Cif2<A, B, R>,
callback: &'a mut Callback
) -> Selfwhere
Callback: FnMut(A, B) -> R + 'a,
pub fn new_with_cif<Callback>( cif: Cif2<A, B, R>, callback: &'a mut Callback ) -> Selfwhere Callback: FnMut(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.