Struct glommio::task::Task[][src]

pub struct Task { /* fields omitted */ }
Expand description

A task reference that runs its future.

At any moment in time, there is at most one Task reference associated with a particular task. Running consumes the Task reference and polls its internal future. If the future is still pending after getting polled, the Task reference simply won’t exist until a Waker notifies the task. If the future completes, its result becomes available to the JoinHandle.

When a task is woken up, its Task reference is recreated and passed to the schedule function. In most executors, scheduling simply pushes the Task reference into a queue of runnable tasks.

If the Task reference is dropped without getting run, the task is automatically canceled. When canceled, the task won’t be scheduled again even if a Waker wakes it. It is possible for the JoinHandle to cancel while the Task reference exists, in which case an attempt to run the task won’t do anything.

Trait Implementations

Formats the value using the given formatter. Read more

Executes the destructor for this type. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Performs the conversion.

The alignment of pointer.

The type for initializers.

Initializes a with the given initializer. Read more

Dereferences the given pointer. Read more

Mutably dereferences the given pointer. Read more

Drops the object pointed to by the given pointer. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more