Skip to main content

declare_adapter_controls

Function declare_adapter_controls 

Source
pub fn declare_adapter_controls(
    adapters: &HashMap<String, Arc<dyn DriverAdapter>>,
    component: &Arc<RwLock<Component>>,
)
Expand description

Invoke DriverAdapter::declare_controls for each unique adapter instance against the given parent component, deduping by Arc-pointer identity. The same adapter Arc may be entered into the map under multiple alias keys; this guarantees each physical instance gets exactly one declaration call per invocation of this helper.

Called from two sites:

  1. The phase executor at component-attach time, so dryrun=controls walks a populated tree before any cycles run.
  2. Activity::run_with_adapters at run start, so adapters that only ever materialize at run time still get declared.

Adapter implementations are expected to be idempotent — calling this helper twice against the same parent must not produce duplicate subcomponents or duplicate-name control declarations.