Exitable

public protocol Exitable

A type that a @main function may return: it knows how to produce a process exit code.

The compiler synthesizes C main as a wrapper that calls report() on the value @main returns. report() is consuming so move-only conformers (e.g. Result) can move out their payload.

Methods

consuming func report() -> ExitCode

Produce the process exit code for this value.

Defined in lang/std/os/exitable.ks