Skip to main content

SyncCallbackSession

Trait SyncCallbackSession 

Source
pub trait SyncCallbackSession {
    // Required methods
    fn call_owned(&mut self, args: &mut [Value]) -> Result<Value, SemaError>;
    fn should_yield(&self) -> bool;
}
Expand description

One accepted synchronous HOF run: per-element direct calls of the proven non-suspending callback on a scratch VM, no scheduler involvement.

Required Methods§

Source

fn call_owned(&mut self, args: &mut [Value]) -> Result<Value, SemaError>

Call the callback once. args is an owned buffer the caller will not reuse — values are moved into the callee frame (nils left behind), so a uniquely-owned fold accumulator stays uniquely owned across the call.

Source

fn should_yield(&self) -> bool

True once this drive quantum’s instruction budget is exhausted; the driver must then hand its remaining elements back to the cooperative path (typically as the HOF’s ordinary mid-chain continuation).

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§