Skip to documentation
SLOP

tiny.mprompt.PromptOutcome

Reference tiny.mprompt PromptOutcome

Defined in zig_api.

Returns a tagged union type with two cases: the body returned, or the body paused.

Called byCallszig_apiSuspendedPromptzig_apiSuspendedRunprivate sourcelib.mprompt.src.apioutcomeFromRawzig_apiSuspendedPromptzig_apiPromptOutcome
Static calls · unresolved targets: 1 · external targets: 0.

Source

Source: lib/mprompt/src/api.zig:57

zig
/// Returns a tagged union type with two cases: the body returned, or the body paused. A caller/// switches on it after starting or continuing a paused run, to learn whether the body finished or/// paused again. `SuspendedRun.start` and `SuspendedPrompt.continueWith` return it. `ResumeValue`/// is the type a caller passes to continue the body. `Result` is the type the body returns. An/// error union passes through `Result` unchanged, so a failing body comes back as an error inside/// the returned case.pub fn PromptOutcome(comptime ResumeValue: type, comptime Result: type) type {    return union(enum) {        /// Holds the value the body returned. By the time this case comes back, the runtime has        /// released the body's stacklet, so no handle remains to drop.        returned: Result,        /// Holds the handle to the paused body. The caller either continues the handle with a value        /// or drops it, and a one-shot handle is used once.        suspended: SuspendedPrompt(ResumeValue, Result),    };}

Source: lib/mprompt/src/root.zig:59

zig
pub const PromptOutcome = zig_api.PromptOutcome;

Audit

Definitions1
Public names2
Members0
Version26.7.0
Revisiondaab053ee433