#[repr(C)]pub struct async_task {
pub state: async_state_t,
pub handler: async_task_handler_t,
pub deadline: zx_time_t,
}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.
Fields§
§state: async_state_tPrivate state owned by the dispatcher, initialize to zero with |ASYNC_STATE_INIT|.
handler: async_task_handler_tThe task’s handler function.
deadline: zx_time_tThe 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.
Trait Implementations§
Source§impl Debug for async_task
impl Debug for async_task
Auto Trait Implementations§
impl Freeze for async_task
impl RefUnwindSafe for async_task
impl Send for async_task
impl Sync for async_task
impl Unpin for async_task
impl UnsafeUnpin for async_task
impl UnwindSafe for async_task
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more