Skip to documentation
SLOP

tiny.mprompt.promptEnter

Reference 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.

Called byCallstiny.mpromptprompttest sourcelib.mprompt.src.prompttest: completed prompts reuse cached ...private sourcelib.mprompt.src.promptpromptIsActiveprivate sourcelib.mprompt.src.promptpromptResumetiny.mpromptpromptEnter
Static calls · unresolved targets: 0 · external targets: 0.

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

Definitions1
Public names1
Members0
Version26.7.0
Revisiondaab053ee433