pub struct RouteTable { /* private fields */ }Expand description
Typed route index.
Two indices: one for Input-kind routes (consulted by the dispatcher)
and one for Signal-kind routes (reserved for the signal surface; the
dispatcher refuses these with a typed error).
Implementations§
Source§impl RouteTable
impl RouteTable
Sourcepub fn from_schema(schema: &CompositionSchema) -> Result<Self, RouteTableError>
pub fn from_schema(schema: &CompositionSchema) -> Result<Self, RouteTableError>
Build a typed route table from a composition schema.
Returns RouteTableError::DuplicateInputRoute if the schema
declares two input-kind routes for the same
(producer_instance, effect_variant) pair. Signal-kind routes are
indexed but never trigger duplicate-input collisions (they live on
a separate map).
Sourcepub fn resolve(
&self,
instance_id: &MachineInstanceId,
effect_variant: &EffectVariantId,
) -> Option<&RoutedInputDescriptor>
pub fn resolve( &self, instance_id: &MachineInstanceId, effect_variant: &EffectVariantId, ) -> Option<&RoutedInputDescriptor>
Resolve a producer (instance_id, effect_variant) to the typed
input descriptor. Returns None if no input-kind route exists for
the pair — the caller then returns
super::DispatchRefusal::UnresolvedRoute.
Sourcepub fn resolve_signal(
&self,
instance_id: &MachineInstanceId,
effect_variant: &EffectVariantId,
) -> Option<&RoutedSignalDescriptor>
pub fn resolve_signal( &self, instance_id: &MachineInstanceId, effect_variant: &EffectVariantId, ) -> Option<&RoutedSignalDescriptor>
Resolve a producer (instance_id, effect_variant) to the typed
signal descriptor. Returns None if no signal-kind route exists
for the pair.
Sourcepub fn signal_route_count(&self) -> usize
pub fn signal_route_count(&self) -> usize
Number of signal-kind routes this table is aware of.
Trait Implementations§
Source§impl Clone for RouteTable
impl Clone for RouteTable
Source§fn clone(&self) -> RouteTable
fn clone(&self) -> RouteTable
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more