pub struct DenyAllEffects;Expand description
A handler that fails any effect call. Useful as a default for pure-only runs.
Trait Implementations§
Source§impl EffectHandler for DenyAllEffects
impl EffectHandler for DenyAllEffects
fn dispatch( &mut self, kind: &str, op: &str, _args: Vec<Value>, ) -> Result<Value, String>
Source§fn note_call_budget(&mut self, _budget_cost: u64) -> Result<(), String>
fn note_call_budget(&mut self, _budget_cost: u64) -> Result<(), String>
Hook called by the VM at every function call so handlers can
enforce per-call budget consumption (#225). The argument is
the sum of
[budget(N)] declared on the callee’s signature;
the handler returns Err to refuse the call (the VM converts
to VmError::Effect). Default impl is a no-op so legacy
handlers and pure-only runs are unaffected.Source§fn enter_request_scope(&mut self) -> u64
fn enter_request_scope(&mut self) -> u64
Enter a per-request allocation scope (#463 scaffolding).
Called by the runtime layer (e.g.
net.serve_fn’s request
loop) immediately before invoking the user handler closure
for one request. Implementations push a fresh arena onto
their internal stack and return its identifier; the matching
exit_request_scope call drops it. Read moreSource§fn exit_request_scope(&mut self, _scope_id: u64)
fn exit_request_scope(&mut self, _scope_id: u64)
Exit a per-request allocation scope opened by
enter_request_scope. Implementations drop the arena
associated with scope_id. Calling exit with a scope_id
that wasn’t returned by a prior enter is implementation-
defined behavior — DefaultHandler treats it as a no-op so
mismatched pairs don’t panic.Source§fn spawn_for_worker(&self) -> Option<Box<dyn EffectHandler + Send>>
fn spawn_for_worker(&self) -> Option<Box<dyn EffectHandler + Send>>
list.par_map worker-handler factory (#305 slice 2). Read moreAuto Trait Implementations§
impl Freeze for DenyAllEffects
impl RefUnwindSafe for DenyAllEffects
impl Send for DenyAllEffects
impl Sync for DenyAllEffects
impl Unpin for DenyAllEffects
impl UnsafeUnpin for DenyAllEffects
impl UnwindSafe for DenyAllEffects
Blanket Implementations§
impl<T> Allocation for T
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more