CoroutineState in std::ops - Rust (original) (raw)

Enum CoroutineState

Source

pub enum CoroutineState<Y, R> {
    Yielded(Y),
    Complete(R),
}

🔬This is a nightly-only experimental API. (coroutine_trait #43122)

Expand description

The result of a coroutine resumption.

This enum is returned from the Coroutine::resume method and indicates the possible return values of a coroutine. Currently this corresponds to either a suspension point (Yielded) or a termination point (Complete).

§

🔬This is a nightly-only experimental API. (coroutine_trait #43122)

The coroutine suspended with a value.

This state indicates that a coroutine has been suspended, and typically corresponds to a yield statement. The value provided in this variant corresponds to the expression passed to yield and allows coroutines to provide a value each time they yield.

§

🔬This is a nightly-only experimental API. (coroutine_trait #43122)

The coroutine completed with a return value.

This state indicates that a coroutine has finished execution with the provided value. Once a coroutine has returned Complete it is considered a programmer error to call resume again.

Source§

Source§

Source§

Source§

Source§

Source§

Tests for self and other values to be equal, and is used by ==.

1.0.0 · Source§

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.

Source§

Source§

This method returns an ordering between self and other values if one exists. Read more

1.0.0 · Source§

Tests less than (for self and other) and is used by the < operator. Read more

1.0.0 · Source§

Tests less than or equal to (for self and other) and is used by the<= operator. Read more

1.0.0 · Source§

Tests greater than (for self and other) and is used by the >operator. Read more

1.0.0 · Source§

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more

Source§

Source§

Source§