tiny.mprompt.PromptOutcome
Defined in zig_api.
Returns a tagged union type with two cases: the body returned, or the body paused.
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
| Definitions | 1 |
|---|---|
| Public names | 2 |
| Members | 0 |
| Version | 26.7.0 |
| Revision | daab053ee433 |