IMPORTANT: To view this page as Markdown, append `.md` to the URL (e.g. /docs/manual/basics.md). For the complete Mojo documentation index, see llms.txt.
Skip to main content
Version: 1.0.0
For the complete Mojo documentation index, see llms.txt. Markdown versions of all pages are available by appending .md to any URL (e.g. /docs/manual/basics.md).

RaisingCoroutine

struct RaisingCoroutine[type: AnyType, origins: OriginSet]

Represents a coroutine that can raise.

Coroutines can pause execution saving the state of the program (including values of local variables and the location of the next instruction to be executed). When the coroutine is resumed, execution continues from where it left off, with the saved state restored.

Parameters​

  • ​type (AnyType): Type of value returned upon completion of the coroutine.
  • ​origins (OriginSet): The origin set of the coroutine's captures.

Implemented traits​

AnyType, Movable, RegisterPassable

Methods​

__init__​

@implicit def __init__(handle: AnyCoroutine) -> Self

Construct a coroutine object from a handle.

Args:

__await__​

def __await__(var self, out result: type)

Suspends the current coroutine until the coroutine is complete.

Returns:

type: The result value from the completed coroutine.

Raises:

If the coroutine execution encounters an error.