LIBMTP_progressfunc_t

Type Alias LIBMTP_progressfunc_t 

Source
pub type LIBMTP_progressfunc_t = Option<unsafe extern "C" fn(sent: u64, total: u64, data: *const c_void) -> c_int>;
Expand description

The callback type definition. Notice that a progress percentage ratio is easy to calculate by dividing sent by total. @param sent the number of bytes sent so far @param total the total number of bytes to send @param data a user-defined dereferencable pointer @return if anything else than 0 is returned, the current transfer will be interrupted / cancelled.

Aliased Type§

pub enum LIBMTP_progressfunc_t {
    None,
    Some(unsafe extern "C" fn(u64, u64, *const c_void) -> i32),
}

Variants§

§1.0.0

None

No value.

§1.0.0

Some(unsafe extern "C" fn(u64, u64, *const c_void) -> i32)

Some value of type T.