Skip to main content

StackDynTaskInputs

Trait StackDynTaskInputs 

Source
pub trait StackDynTaskInputs {
    // Required methods
    fn as_ref(&self) -> &dyn DynTaskInputs;
    fn take_box(&mut self) -> Box<dyn DynTaskInputs>;
    fn as_any_mut(&mut self) -> &mut dyn Any;
}
Expand description

A trait for task arguments that may reside on the stack.

This enables deferred boxing: on the cache-hit path (~85%), we only borrow the argument via as_ref for hash/equality lookups, avoiding any heap allocation. On cache miss, take_box moves the value into a Box with zero clones.

Required Methods§

Source

fn as_ref(&self) -> &dyn DynTaskInputs

Borrow the argument as a type-erased reference (for cache lookup).

Source

fn take_box(&mut self) -> Box<dyn DynTaskInputs>

Move the argument out into a heap-allocated Box (panics if already taken).

Source

fn as_any_mut(&mut self) -> &mut dyn Any

Downcast to &mut dyn Any for concrete type recovery without boxing.

Implementors§