pub struct CellMap { /* private fields */ }Expand description
Resolve-or-create map from a coordinate to the child component that
represents it. Interior-mutable so it is reachable through a read guard on
the parent, mirroring Component::controls.
Implementations§
Source§impl CellMap
impl CellMap
pub fn new() -> Self
Sourcepub fn resolve(
&self,
parent: &Arc<RwLock<Component>>,
coord: &Labels,
) -> Arc<RwLock<Component>> ⓘ
pub fn resolve( &self, parent: &Arc<RwLock<Component>>, coord: &Labels, ) -> Arc<RwLock<Component>> ⓘ
The cell for coord under parent, creating and attaching it on first
sight. Idempotent: the same coordinate yields the same component for as
long as the parent lives, so a caller may resolve per cycle and get a
registry write only once.
coord carries only the dimension labels this cell adds. Inherited
labels come from the parent via crate::component::attach, which also
enforces that no ancestor already owns these names.
Sourcepub fn len(&self) -> usize
pub fn len(&self) -> usize
Number of distinct coordinates materialised so far. For diagnostics and tests — there is deliberately no cap: how many series a dimension has is a modelling decision, and silently dropping data would be worse than having many.