impl_task_adapter

Macro impl_task_adapter 

Source
macro_rules! impl_task_adapter {
    ($(
        $task:ident {
            output: $output:ty,
            adapter: $adapter:ty,
            input: $input_kind:ident,
            constructor: $constructor:ident,
            conversion: $conversion:ident,
            name: $name:literal,
            doc: $doc:literal,
        }
    ),* $(,)?) => { ... };
    (@execute image, $adapter:ident, $input:ident, $task:ident) => { ... };
}
Expand description

Generates the TaskAdapter enum and its DynModelAdapter implementation.

All adapters are uniformly boxed to enable macro generation. The boxing overhead is negligible since:

  • Adapter creation happens once at build time
  • Adapters are long-lived
  • Inference time dominates any pointer overhead
  • Most adapter internals are already indirect (Arc, Vec, etc.)