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
yield
keyword.It is not recommended to call this function directly, use the
yield
keyword 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
true
if the generator was cancelled andfalse
otherwise.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_start
as we still want to use the C runtime for invoking the static constructors.It converts the
argc
andargv
arguments to a slice of strings, initializes the main thread associated data (if threading is enabled) and then invokes the user-definedmain
function.
Macros
Consts
-
const STACK_ARGS_MAX: usize = /* ... */