Skip to main content

StepObserver

Trait StepObserver 

Source
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§

Source

fn implementation(&self) -> &Digest

Returns the caller-defined implementation identity.

Source

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".

Implementors§