Skip to main content

Module task

Module task 

Source

Modules§

clock
labels
Labels are a way to attach an arbitrary set of values with a task, with the only constraint being that at most one value of a given type T can be attached at any time, using get::<T>() to retrieve, and set::<T>(..) to set the value. Labels behave almost identically to Extensions in the http crate.
waker

Structs§

ChildLabelFn
A special label that can be used to set labels for a task when it is spawned.
ParkState
Task
A Task represents a user-level unit of concurrency. Each task has an id that is unique within the execution, and a state reflecting whether the task is runnable (enabled) or not.
TaskId
A TaskId is a unique identifier for a task. TaskIds are never reused within a single execution.
TaskName
A reserved label that is used to assign readable names to tasks for debugging.
TaskSet
A TaskSet is a set of TaskIds but implemented efficiently as a BitVec
TaskSignature
A task signature is an identifier that is intended to be mostly stable across executions and allow for categorization of tasks according to how they were created. It provides two levels of granularity: static (compile-time) spawn location and dynamic (run-time) context where that spawn location was reached. The static spawn location and signature are each represented by a u64 so that the details of how they are computed can be non-breaking changes in the future. Hashes are all pre-computed for fast checking of equality of signatures at runtime.

Enums§

TaskState

Constants§

DEFAULT_INLINE_TASKS

Traits§

TagDeprecated
A Tag is an optional piece of metadata associated with a task (a thread or spawned future) to aid debugging.
TaggableDeprecated
Taggable is a marker trait which types implementing Tag have to implement. It exists since we both want to provide a blanket implementation of as_any, and have users opt in to a type being able to be used as a tag. If we did not have this trait, then Tag would be automatically implemented for most types (as most types are Debug + Any), which opens up for accidentally using a type which was not intended to be used as a tag as a tag.