pub trait StepObserver {
// Required methods
fn implementation(&self) -> &Digest;
fn observe(
&mut self,
context: &StepContext,
state: &[f32],
) -> Result<ControlFlow, String>;
}Expand description
One synchronous observer at an exact post-step committed-state boundary.
Required Methods§
Sourcefn implementation(&self) -> &Digest
fn implementation(&self) -> &Digest
Returns the caller-defined implementation identity.
Sourcefn observe(
&mut self,
context: &StepContext,
state: &[f32],
) -> Result<ControlFlow, String>
fn observe( &mut self, context: &StepContext, state: &[f32], ) -> Result<ControlFlow, String>
Observes immutable committed state and may request a cooperative stop.
§Errors
Returns an error when the observer cannot record the step. The error is contained before it can cross the native callback boundary.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".