[−][src]Function ffi_utils::test_utils::call_vec_with_custom
pub unsafe fn call_vec_with_custom<F, E, T, U>(
ud: &mut UserData,
f: F
) -> Result<Vec<T>, i32> where
F: FnOnce(*mut c_void, extern "C" fn(user_data: *mut c_void, result: *const FfiResult, _: T::C, _: usize)),
E: Debug,
T: ReprC<C = *const U, Error = E>,
Call a FFI function and block until its callback gets called, then copy
the array argument which was passed to Vec<T>
and return the result.
Use this if the callback accepts *const T
and usize
(length) arguments in addition
to user_data
and error_code
.
This version of the function takes a UserData
with custom inner data.