pub struct ComponentRegistry { /* private fields */ }Expand description
A registry that maps component types to their semantic domains.
This is a critical internal part of the World. It provides a single source
of truth for determining which semantic group a component’s data belongs to,
enabling the World to correctly store and retrieve component data from pages.
Implementations§
Source§impl ComponentRegistry
impl ComponentRegistry
Sourcepub fn get_domain(&self, type_id: TypeId) -> Option<SemanticDomain>
pub fn get_domain(&self, type_id: TypeId) -> Option<SemanticDomain>
Looks up the SemanticDomain for a given TypeId.
Sourcepub fn layout_of(&self, type_id: TypeId) -> Option<LayoutPolicy>
pub fn layout_of(&self, type_id: TypeId) -> Option<LayoutPolicy>
Returns the LayoutPolicy a component is currently stored with.
Sourcepub fn set_layout(&mut self, type_id: TypeId, layout: LayoutPolicy)
pub fn set_layout(&mut self, type_id: TypeId, layout: LayoutPolicy)
Sets the intended LayoutPolicy for a component. The actual repack of
stored columns is performed by the layout-adaptation pass; this only
records the target.
Sourcepub fn record_access(&self, type_ids: &[TypeId], rows: u64)
pub fn record_access(&self, type_ids: &[TypeId], rows: u64)
Records one access: increments the query count and adds rows to the
scanned total for every component in type_ids. Lock-free, called once
per query — never per element.
Sourcepub fn access_stats(&self, type_id: TypeId) -> Option<(u64, u64)>
pub fn access_stats(&self, type_id: TypeId) -> Option<(u64, u64)>
Returns (query_count, rows_scanned) for a component, if registered.
Sourcepub fn size_of(&self, type_id: TypeId) -> Option<usize>
pub fn size_of(&self, type_id: TypeId) -> Option<usize>
size_of for a registered component type, or None if unregistered.
Sourcepub fn access_snapshot(&self) -> Vec<(TypeId, usize, u64, u64)>
pub fn access_snapshot(&self) -> Vec<(TypeId, usize, u64, u64)>
Snapshot of every registered component’s (type_id, size_bytes, query_count, rows_scanned) — the input the DCC’s layout advisor reads
(read-only; observation tunnel). Allocates a small Vec (one entry per
component type), so it is cheap enough to sample off the hot path.