tiny.mprompt.promptEnter
Defined in tiny.mprompt.
Switches to p's stacklet and calls fun(p, arg) there, so a caller runs fun on a prompt created earlier with promptCreate.
Source
Source: lib/mprompt/src/prompt.zig:517
zig
/// Switches to `p`'s stacklet and calls `fun(p, arg)` there, so a caller runs `fun` on a prompt/// created earlier with `promptCreate`. While `fun` runs, `p` is the calling thread's innermost/// active prompt. The call returns what `fun` returns when it finishes, and the runtime then/// releases `p`. The call returns what the yield function returns when the code suspends to `p`./// `p` must be new: an active or suspended prompt fails an assertion in safe builds.pub fn promptEnter(p: *Prompt, fun: StartFn, arg: ?*anyopaque) ?*anyopaque { assert(!promptIsActive(p)); assert(p.resume_point == null); var env: EntryEnv = .{ .prompt = p, .fun = fun, .arg = arg, }; return promptResume(p, &env);}Source: lib/mprompt/src/root.zig:82
zig
pub const promptEnter = raw.promptEnter;Audit
| Definitions | 1 |
|---|---|
| Public names | 1 |
| Members | 0 |
| Version | 26.7.0 |
| Revision | daab053ee433 |