pub trait ActivationObserver<T, E> {
// Required method
fn observe(&mut self, path: &str, value: &T) -> Result<(), E>;
// Provided methods
fn routing_control(
&mut self,
_path: &str,
_token_rows: u64,
) -> Result<Option<GroupSelectionControl>, E> { ... }
fn routing_applied(
&mut self,
_path: &str,
_original: Option<RoutingDecision<'_, T>>,
_effective: RoutingDecision<'_, T>,
) -> Result<(), E> { ... }
fn routing_failed(&mut self, _path: &str, _message: &str) { ... }
fn finish(&mut self) -> Result<(), E> { ... }
fn intervene(&mut self, _path: &str, _value: &T) -> Result<Option<T>, E> { ... }
fn observe_routing(
&mut self,
_routing: RoutingObservation<'_, T>,
) -> Result<(), E> { ... }
}Expand description
Statically dispatched activation observation and intervention contract.
Required Methods§
Provided Methods§
Sourcefn routing_control(
&mut self,
_path: &str,
_token_rows: u64,
) -> Result<Option<GroupSelectionControl>, E>
fn routing_control( &mut self, _path: &str, _token_rows: u64, ) -> Result<Option<GroupSelectionControl>, E>
Obtains a validated control before the selector dispatches any experts. The default ordinary path allocates and materializes nothing.
Sourcefn routing_applied(
&mut self,
_path: &str,
_original: Option<RoutingDecision<'_, T>>,
_effective: RoutingDecision<'_, T>,
) -> Result<(), E>
fn routing_applied( &mut self, _path: &str, _original: Option<RoutingDecision<'_, T>>, _effective: RoutingDecision<'_, T>, ) -> Result<(), E>
Receives original/effective decisions before they reach the expert provider.
Sourcefn routing_failed(&mut self, _path: &str, _message: &str)
fn routing_failed(&mut self, _path: &str, _message: &str)
Records a failed control under the enclosing forward pass’s failure owner.
Sourcefn finish(&mut self) -> Result<(), E>
fn finish(&mut self) -> Result<(), E>
Completes an ordinary forward pass under its existing failure owner. Scheduled-but-missing interventions must fail before prediction commitment.
Sourcefn intervene(&mut self, _path: &str, _value: &T) -> Result<Option<T>, E>
fn intervene(&mut self, _path: &str, _value: &T) -> Result<Option<T>, E>
Optionally replaces an activation before it is consumed or returned.
Sourcefn observe_routing(
&mut self,
_routing: RoutingObservation<'_, T>,
) -> Result<(), E>
fn observe_routing( &mut self, _routing: RoutingObservation<'_, T>, ) -> Result<(), E>
Observes normalized routed-expert decisions and contributions.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".