Continuations
Type members
Types
A marker for a given boundary
. Use break
or suspend
to suspend the
continuation up to the specified boundary
. This value MUST NOT escape
the boundary
that created it.
A marker for a given boundary
. Use break
or suspend
to suspend the
continuation up to the specified boundary
. This value MUST NOT escape
the boundary
that created it.
Value members
Concrete methods
Marks the given body as suspendable with a BoundaryLabel
that suspend
can refer to. Forwards the return value of body
, or the return value of
the suspend
call, if it happens during the execution of f
.
Marks the given body as suspendable with a BoundaryLabel
that suspend
can refer to. Forwards the return value of body
, or the return value of
the suspend
call, if it happens during the execution of f
.
Safety: the passed-in BoundaryLabel
cannot be used outside of the
scope of the body. Suspending to a BoundaryLabel
not created by a
boundary
call higher on the same call stack is undefined behaviour.
Transformed version of the boundary body, to be passed to cont_boundary. Takes:
Transformed version of the boundary body, to be passed to cont_boundary. Takes:
label
: the boundary labelarg
: The boundary body as BoundaryLabel ?=> Ptr[?] (the returned object, cast to a pointer)
Returns Ptr[?] / void*.
Immediately return to the boundary
, returning the given value.
Immediately return to the boundary
, returning the given value.
Suspends the current running stack up to the corresponding boundary
into
a continuation cont: R => T
and passes it into f
. The return value of
f(cont)
is returned to boundary
.
Suspends the current running stack up to the corresponding boundary
into
a continuation cont: R => T
and passes it into f
. The return value of
f(cont)
is returned to boundary
.
Same as suspendCont
, but hides the fact that the passed in function is a
continuation.
Same as suspend
where the continuation expects no parameters.
Same as suspend
where the continuation expects no parameters.
Transformed version of the suspend lambda, to be passed to cont_suspend. Takes:
Transformed version of the suspend lambda, to be passed to cont_suspend. Takes:
continuation
: the reified continuationonSuspend
: The suspend lambda as Continuation => Ptr[?] (the returned object, cast to a pointer)
Returns Ptr[?] / void*.