Struct pr47::util::serializer::CoroutineContext[][src]

pub struct CoroutineContext<SerializedData: 'static + Send> {
    pub serializer: Serializer<(CoroutineSharedData, SerializedData)>,
    pub task_id: u32,
    // some fields omitted
}
Expand description

Context of one coroutine/task

Fields

serializer: Serializer<(CoroutineSharedData, SerializedData)>

Data shared by all tasks in the same serialization group.

task_id: u32

Task ID of the current task. 0 implies main task, while other values are used for children tasks.

Implementations

Creates a new, main coroutine context with given shared_data

Given the fact that the permit is held, and there’s not another mutable reference to the shared data, retrieve the shared data.

Interrupt current task, allowing other task to run.

Interrupt current task, await for given fut. During this time other tasks may run.

Spawn a new task managed by the current serialization group

Called on main task exit, wait for all other tasks to finish.

Trait Implementations

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.

Performs the conversion.

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.