Skip to main content

link

Function link 

Source
pub fn link(
    base: Arc<dyn SpawnerAdapter>,
    layer_hints: &[String],
    engine: &Engine,
) -> Arc<dyn SpawnerAdapter> 
Expand description

Wrap the compiled base SpawnerAdapter with Layers and return the finished value.

  • base: Compiler.compile()’s CompiledBlueprint.router (Arc<CompiledAgentTable>), upcast to Arc<dyn SpawnerAdapter>.
  • layer_hints: Blueprint.spawner_hints.layers — the capability key strings.
  • engine: needed both to look factories up on the LayerRegistry and to run them (each base/hint factory takes &Engine and returns Arc<dyn SpawnerLayer>).

Order: base_factories first (wrapped for every Blueprint), then lookup_hint (the layers this Blueprint declares).