CoroutineKind in rustc_ast::ast - Rust (original) (raw)

pub enum CoroutineKind {
    Async {
        span: Span,
        closure_id: NodeId,
        return_impl_trait_id: NodeId,
    },
    Gen {
        span: Span,
        closure_id: NodeId,
        return_impl_trait_id: NodeId,
    },
    AsyncGen {
        span: Span,
        closure_id: NodeId,
        return_impl_trait_id: NodeId,
    },
}

Expand description

Describes what kind of coroutine markers, if any, a function has.

Coroutine markers are things that cause the function to generate a coroutine, such as async, which makes the function return impl Future, or gen, which makes the function return impl Iterator.

§

async, which returns an impl Future.

Fields

§

gen, which returns an impl Iterator.

Fields

§

async gen, which returns an impl AsyncIterator.

Fields

§

§

§

§

§

§

§

§

Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...) attributes. Please see the Rust Reference's “Type Layout” chapter for details on type layout guarantees.

Size: 20 bytes

Size for each variant: