patch_seq_yield

Function patch_seq_yield 

Source
#[unsafe(no_mangle)]
pub unsafe extern "C" fn patch_seq_yield(stack: Stack) -> Stack
Expand description

Yield a value from within a woven strand

Stack effect: ( WeaveCtx a – WeaveCtx a )

Sends value a to the caller and waits for the next resume value. The WeaveCtx must be passed through - it contains the channels.

§Error Handling

This function never panics (panicking in extern “C” is UB). On error:

  • Type mismatch: eprintln + cleanup + block forever
  • Channel closed: cleanup + block forever

The coroutine is marked as completed before blocking, so the program can still terminate normally.

§Safety

Stack must have a value on top and WeaveCtx below it