zigar.function.GeneratorArgOf(function) - chung-leong/zigar GitHub Wiki

Return the first generator type in the argument list of function.

Example:

const std = @import("std");
const zigar = @import("zigar");

fn world(generator: zigar.function.Generator(?bool)) void {
    generator.end();
}

comptime {
    std.debug.assert(zigar.function.GeneratorArgOf(world) == zigar.function.Generator(?bool));
}

Arguments:

  • function: anytype
    A function or a function type.

Return value:

Generator(T)


Generator(T) | GeneratorOf(function)