Struct gnunet_sys::GNUNET_SCHEDULER_Driver[][src]

#[repr(C)]pub struct GNUNET_SCHEDULER_Driver {
    pub cls: *mut c_void,
    pub add: Option<unsafe extern "C" fn(cls: *mut c_void, task: *mut GNUNET_SCHEDULER_Task, fdi: *mut GNUNET_SCHEDULER_FdInfo) -> c_int>,
    pub del: Option<unsafe extern "C" fn(cls: *mut c_void, task: *mut GNUNET_SCHEDULER_Task) -> c_int>,
    pub set_wakeup: Option<unsafe extern "C" fn(cls: *mut c_void, dt: GNUNET_TIME_Absolute)>,
}

API an external event loop has to implement for #GNUNET_SCHEDULER_driver_init.

Fields

cls: *mut c_void

Closure to pass to the functions in this struct.

add: Option<unsafe extern "C" fn(cls: *mut c_void, task: *mut GNUNET_SCHEDULER_Task, fdi: *mut GNUNET_SCHEDULER_FdInfo) -> c_int>

Add a @a task to be run if the conditions specified in the et field of the given @a fdi are satisfied. The et field will be cleared after this call and the driver is expected to set the type of the actual event before passing @a fdi to #GNUNET_SCHEDULER_task_ready.

@param cls closure @param task task to add @param fdi conditions to watch for @return #GNUNET_OK on success, #GNUNET_SYSERR on failure (i.e. @a fdi too high or invalid)

del: Option<unsafe extern "C" fn(cls: *mut c_void, task: *mut GNUNET_SCHEDULER_Task) -> c_int>

Delete a @a task from the set of tasks to be run. A task may comprise multiple FdInfo entries previously added with the add function. The driver is expected to delete them all.

@param cls closure @param task task to delete @return #GNUNET_OK on success, #GNUNET_SYSERR on failure (i.e. @a task does not match prior @e add call)

set_wakeup: Option<unsafe extern "C" fn(cls: *mut c_void, dt: GNUNET_TIME_Absolute)>

Set time at which we definitively want to get a wakeup call.

@param cls closure @param dt time when we want to wake up next

Trait Implementations

impl Clone for GNUNET_SCHEDULER_Driver[src]

impl Copy for GNUNET_SCHEDULER_Driver[src]

impl Debug for GNUNET_SCHEDULER_Driver[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.