Module ffi_utils::test_utils [] [src]

Test utilities.

Functions

call_0

Call a FFI function and block until its callback gets called. Use this if the callback accepts no arguments in addition to user_data and error_code.

call_1

Call an FFI function and block until its callback gets called, then return the argument which were passed to that callback. Use this if the callback accepts one argument in addition to user_data and error_code.

call_2

Call a FFI function and block until its callback gets called, then return the argument which were passed to that callback. Use this if the callback accepts two arguments in addition to user_data and error_code.

call_vec

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.

call_vec_u8

Call a FFI function and block until its callback gets called, then copy the byte array argument which was passed to Vec<u8> and return the result.

send_via_user_data

Send through a mpsc::Sender pointed to by the user data pointer.

sender_as_user_data

Convert a mpsc::Sender<T> to a void ptr which can be passed as user data to ffi functions