tiny.mprompt.resumePrompt
Defined in tiny.mprompt.
Switches back into the suspended code so that its yieldPrompt call returns arg, for a yield function or code that kept a resumption to continue the suspended code with a value.
Source
Source: lib/mprompt/src/prompt.zig:582
zig
/// Switches back into the suspended code so that its `yieldPrompt` call returns `arg`, for a yield/// function or code that kept a resumption to continue the suspended code with a value. The call/// returns when that code suspends again, with the yield function's result, or when it finishes,/// with its result. For a one-shot handle, the code continues in place and the handle is used up. A/// one-shot handle with more than one owner, or with nothing suspended, fails an assertion in safe/// builds. For a multi-shot handle, the call gives up one reference and counts one resume. When/// other references remain, the runtime first copies the suspended stack segments to the heap, and/// a later resume copies them back.pub fn resumePrompt(resume_ptr: *Resume, arg: ?*anyopaque) ?*anyopaque { if (resumeIsOnce(resume_ptr)) |p| { @branchHint(.likely); assert(p.refcount == 1); assert(p.resume_point != null); return promptResume(p, arg); } else { @branchHint(.unlikely); return mresume(resumeIsMulti(resume_ptr).?, arg); }}Source: lib/mprompt/src/root.zig:86
zig
pub const resumePrompt = raw.resumePrompt;Audit
| Definitions | 1 |
|---|---|
| Public names | 1 |
| Members | 0 |
| Version | 26.7.0 |
| Revision | daab053ee433 |