Skip to main content

ResumeKind

Enum ResumeKind 

Source
pub enum ResumeKind {
    Nothing,
    Spawn {
        func: FuncIdx,
        args: Vec<RtPayload>,
        priority: u8,
        is_main: bool,
    },
    Payload(RtPayload),
    Select {
        arm: usize,
        payload: RtPayload,
    },
    NewChan(ChanId),
    SpawnedHandle(TaskId),
}
Expand description

How a worker should (re)enter a task body on its next poll. Every variant is Send (FuncIdx is u16, RtPayload is Send, ids are Copy).

Variants§

§

Nothing

First entry / a block that yields no value (Send/Close/Yield/Sleep).

§

Spawn

Fresh spawn: build the body from this function + materialised args. is_main distinguishes the program’s root task (whose body is the top-level program, not a spawned function) so the builder positions it correctly.

Fields

§func: FuncIdx
§priority: u8
§is_main: bool
§

Payload(RtPayload)

Resume a pinned continuation with a delivered value (Recv/TryRecv/Await).

§

Select

Resume a Select winner: the winning arm index + its (recv) payload.

Fields

§arm: usize
§payload: RtPayload
§

NewChan(ChanId)

Resume after NewChan with the freshly-created channel id.

§

SpawnedHandle(TaskId)

Resume after a handle-bearing spawn with the child’s task id.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.