Functions
-
fn coroutine_new<Func, Args, YieldT, RecvT>(args: Args) -> Coroutine<YieldT, RecvT>
Func: NamedFunctionArgs: TupleGlue code for creating a generator.
Calls to this function are generated by the compiler when a generator function is called. Not meant to be called directly.
-
fn coroutine_yield<YieldT, RecvT>(val: &YieldT, out: &mut RecvT) -> bool
Implementation of the
yieldkeyword.It is not recommended to call this function directly, use the
yieldkeyword instead, but it can be used to yield from a function that is not a generator, but has a generator in its call stack.Returns
trueif the generator was cancelled andfalseotherwise.Calling this function outside of a generator or yielding a different type than the generator expects is undefined behavior.
-
fn entrypoint<UserMain>(argc: c_int, argv: &&c_char) -> c_int
UserMain: NamedFunctionProgram entrypoint glue.
This is equivalent to C's
main, not_startas we still want to use the C runtime for invoking the static constructors.It converts the
argcandargvarguments to a slice of strings, initializes the main thread associated data (if threading is enabled) and then invokes the user-definedmainfunction.
Macros
Consts
-
const STACK_ARGS_MAX: usize = /* ... */