Skip to main content

async_task_t

Type Alias async_task_t 

Source
pub type async_task_t = async_task;
Expand description

Holds context for a task and its handler.

After successfully posting the task, the client is responsible for retaining the structure in memory (and unmodified) until the task’s handler runs, the task is successfully canceled, or the dispatcher shuts down. Thereafter, the task may be posted again or destroyed.

Aliased Type§

#[repr(C)]
pub struct async_task_t { pub state: async_state_t, pub handler: Option<unsafe extern "C" fn(*mut async_dispatcher, *mut async_task, i32)>, pub deadline: i64, }

Fields§

§state: async_state_t

Private state owned by the dispatcher, initialize to zero with |ASYNC_STATE_INIT|.

§handler: Option<unsafe extern "C" fn(*mut async_dispatcher, *mut async_task, i32)>

The task’s handler function.

§deadline: i64

The task’s deadline must be expressed in the time base used by the asynchronous dispatcher (usually |ZX_CLOCK_MONOTONIC| except in unit tests). See |async_now()| for details.