pub struct CatalogCompositionDispatcher<E: ProducerEffect> { /* private fields */ }Expand description
Default catalog-backed dispatcher.
Consumes a RouteTable (built from a
meerkat_machine_schema::CompositionSchema) plus a map of consumer
surfaces keyed by MachineInstanceId. Every routed effect goes
through the same three steps:
- Look up the input-kind route for
(producer.instance_id, effect.variant). - Project the producer’s field values into the consumer-field bindings.
- Deliver via the consumer surface registered for the target instance.
No step has a silent-drop fallback. Unresolved routes, signal-kind
targets, missing producer fields, and unwired consumers are all typed
DispatchRefusal errors.
Implementations§
Source§impl<E: ProducerEffect> CatalogCompositionDispatcher<E>
impl<E: ProducerEffect> CatalogCompositionDispatcher<E>
Sourcepub fn new(composition: CompositionId, table: RouteTable) -> Self
pub fn new(composition: CompositionId, table: RouteTable) -> Self
Build a new dispatcher for composition, using table as the typed
route index.
Sourcepub fn with_consumer(self, surface: Arc<dyn ConsumerSurface>) -> Self
pub fn with_consumer(self, surface: Arc<dyn ConsumerSurface>) -> Self
Register a consumer surface for a target instance.
Panics are impossible — duplicate registrations replace the prior entry. (Duplicate wiring is a construction bug; the callers in wave-b prove registration happens exactly once per instance in the composition schema.)
Trait Implementations§
Source§impl<E: ProducerEffect> CompositionDispatcher for CatalogCompositionDispatcher<E>
impl<E: ProducerEffect> CompositionDispatcher for CatalogCompositionDispatcher<E>
Source§type Effect = E
type Effect = E
Seam-effect sum this dispatcher handles. Matches the codegen-emitted
{Composition}Effect enum.Source§fn composition(&self) -> &CompositionId
fn composition(&self) -> &CompositionId
Composition id this dispatcher owns. Every
ProducerInstance
passed to CompositionDispatcher::dispatch must match.Source§fn dispatch<'life0, 'async_trait>(
&'life0 self,
producer: ProducerInstance,
effect: EffectPayload<Self::Effect>,
) -> Pin<Box<dyn Future<Output = Result<DispatchOutcome, DispatchRefusal>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn dispatch<'life0, 'async_trait>(
&'life0 self,
producer: ProducerInstance,
effect: EffectPayload<Self::Effect>,
) -> Pin<Box<dyn Future<Output = Result<DispatchOutcome, DispatchRefusal>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Dispatch a routed effect. Returns
DispatchOutcome on success or
a typed DispatchRefusal. There is no silent-drop arm.Auto Trait Implementations§
impl<E> Freeze for CatalogCompositionDispatcher<E>
impl<E> !RefUnwindSafe for CatalogCompositionDispatcher<E>
impl<E> Send for CatalogCompositionDispatcher<E>
impl<E> Sync for CatalogCompositionDispatcher<E>
impl<E> Unpin for CatalogCompositionDispatcher<E>
impl<E> UnsafeUnpin for CatalogCompositionDispatcher<E>
impl<E> !UnwindSafe for CatalogCompositionDispatcher<E>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more