[−][src]Trait ffi_utils::callback::Callback
This trait allows us to treat callbacks with different number and type of arguments uniformly.
Associated Types
type Args: CallbackArgs
Arguments for the callback. Should be a tuple.
Required methods
fn call(
&self,
user_data: *mut c_void,
error: *const FfiResult,
args: Self::Args
)
&self,
user_data: *mut c_void,
error: *const FfiResult,
args: Self::Args
)
Call the callback, passing the user data pointer, error code and any additional arguments.
Implementations on Foreign Types
impl Callback for extern "C" fn(user_data: *mut c_void, result: *const FfiResult)
[src]
type Args = ()
fn call(
&self,
user_data: *mut c_void,
error: *const FfiResult,
_args: Self::Args
)
[src]
&self,
user_data: *mut c_void,
error: *const FfiResult,
_args: Self::Args
)
impl<T: CallbackArgs> Callback for extern "C" fn(user_data: *mut c_void, result: *const FfiResult, a: T)
[src]
type Args = T
fn call(
&self,
user_data: *mut c_void,
error: *const FfiResult,
args: Self::Args
)
[src]
&self,
user_data: *mut c_void,
error: *const FfiResult,
args: Self::Args
)
impl<T: CallbackArgs> Callback for unsafe extern "C" fn(user_data: *mut c_void, result: *const FfiResult, a: T)
[src]
type Args = T
fn call(
&self,
user_data: *mut c_void,
error: *const FfiResult,
args: Self::Args
)
[src]
&self,
user_data: *mut c_void,
error: *const FfiResult,
args: Self::Args
)
impl<T0: CallbackArgs, T1: CallbackArgs> Callback for extern "C" fn(user_data: *mut c_void, result: *const FfiResult, a0: T0, a1: T1)
[src]
type Args = (T0, T1)
fn call(
&self,
user_data: *mut c_void,
error: *const FfiResult,
args: Self::Args
)
[src]
&self,
user_data: *mut c_void,
error: *const FfiResult,
args: Self::Args
)
impl<T0: CallbackArgs, T1: CallbackArgs, T2: CallbackArgs> Callback for extern "C" fn(user_data: *mut c_void, result: *const FfiResult, a0: T0, a1: T1, a2: T2)
[src]
type Args = (T0, T1, T2)
fn call(
&self,
user_data: *mut c_void,
error: *const FfiResult,
args: Self::Args
)
[src]
&self,
user_data: *mut c_void,
error: *const FfiResult,
args: Self::Args
)