pub trait MapQuery: CompileQuery<Self::Key, Self::Value> + PlanProperties {
type Key: CellValue + Hash + Eq;
type Value: CellValue;
// Provided method
fn materialize(self) -> CellMap<Self::Key, Self::Value, CellImmutable> { ... }
}Expand description
Uncompiled reactive map operation chain.
Map queries are built by chaining pure operators on a source (CellMap
or another MapQuery). They deliberately do not expose subscribe —
call MapQuery::materialize to produce a subscribable CellMap.
§Invariants
materialize(self)consumes the plan and installs one subscription per interned physical root.- Plan-to-plan edges are statically typed; recognized regions fuse without
an intermediate observable
CellMap. - Publication is deterministic, ordered, and synchronously settled.
- User closures follow the module-level purity and invocation contract.
§Sealing
The CompileQuery<K, V> supertrait is pub(crate), which seals
MapQuery so external crates cannot define new query shapes. New plan
shapes are added inside this crate.
§Not Clone
Map queries are deliberately not Clone. Cloning would silently
duplicate join / projection work — each clone’s materialize() would
install independent root subscriptions and run the entire op chain on
every emission. To share work across consumers, materialize once into a
CellMap (which IS Clone — the clone is an Arc bump referencing
the same multicast cache) and then clone the cell map.
Required Associated Types§
Provided Methods§
Sourcefn materialize(self) -> CellMap<Self::Key, Self::Value, CellImmutable>
fn materialize(self) -> CellMap<Self::Key, Self::Value, CellImmutable>
Compile the query into a CellMap and install root subscriptions
running the statically typed incremental runtime.
This is the only way to observe map-query output. Every subscription is on a materialized map, never on a plan. The returned map owns all root guards; dropping it tears the installation down. Publication caused by a source mutation is synchronously settled before that mutation returns.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".