Sign in

    peter-jerry-ye/codex/generator does not have a README file

    Return

    pub suberror Return

    Error indicating that the async generator has returned normally.

    Running

    pub suberror Running

    Error indicating that the async generator is already running and cannot accept new operations.

    AsyncGenerator

    type AsyncGenerator[T]

    Asynchronous generator producing values of type T.

    Similar to JavaScript's async generators, but with explicit handling of return and throw.

    The generator must be drained to completion to avoid resource leaks.

    AsyncGenerator::new

    fn[T] AsyncGenerator::new(f : async (async (T) -> Unit) -> Unit) -> AsyncGenerator[T]

    Creates a new AsyncGenerator from an async function that takes a yield function. The yield function is used to produce values asynchronously. The generator must be fully consumed to avoid resource leaks.

    AsyncGenerator::next

    async fn[T] AsyncGenerator::next(self : AsyncGenerator[T]) -> T?

    AsyncGenerator::returns

    async fn[T] AsyncGenerator::returns(self : AsyncGenerator[T]) -> T?

    Signals the async generator to return, indicating normal completion. Returns the next value or None if the generator completes.

    AsyncGenerator::throws

    async fn[T] AsyncGenerator::throws(self : AsyncGenerator[T], e : Error) -> T?

    Throws an error into the async generator, allowing it to handle exceptions. Returns the next value or None if the generator completes.

    Source Files

    Powered by MoonBit

    Site sourceReport issuePackagesBuild queueSkillsStatistics

    © 2026 mooncakes.io