#[repr(C, align(8))]pub struct ffi_closure {
pub tramp: ffi_trampoline,
pub cif: *mut ffi_cif,
pub fun: Option<unsafe extern "C" fn(arg1: *mut ffi_cif, arg2: *mut c_void, arg3: *mut *mut c_void, arg4: *mut c_void)>,
pub user_data: *mut c_void,
}Expand description
A struct used by libffi to describe and manage closures.
Closures in libffi can be used to create function pointers to functions with arbitrary signatures that can also have some custom data embedded.
ffi_closure should not be created manually. Instead, ffi_closure_alloc
should be invoked to allocate memory for the ffi_closure before its fields
are populated by ffi_prep_closure.
Caution ffi_closure should not be generated or modified manually, but
allocated by ffi_closure_alloc and passed around to libffi functions as a
pointer.
Fields§
§tramp: ffi_trampoline§cif: *mut ffi_cif§fun: Option<unsafe extern "C" fn(arg1: *mut ffi_cif, arg2: *mut c_void, arg3: *mut *mut c_void, arg4: *mut c_void)>§user_data: *mut c_voidTrait Implementations§
Source§impl Clone for ffi_closure
impl Clone for ffi_closure
Source§fn clone(&self) -> ffi_closure
fn clone(&self) -> ffi_closure
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ffi_closure
Implements Debug manually since sometimes FFI_TRAMPOLINE_SIZE is too large
impl Debug for ffi_closure
Implements Debug manually since sometimes FFI_TRAMPOLINE_SIZE is too large
Source§impl Default for ffi_closure
impl Default for ffi_closure
impl Copy for ffi_closure
Auto Trait Implementations§
impl Freeze for ffi_closure
impl RefUnwindSafe for ffi_closure
impl !Send for ffi_closure
impl !Sync for ffi_closure
impl Unpin for ffi_closure
impl UnwindSafe for ffi_closure
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more