Skip to main content

Observer

Trait Observer 

Source
pub trait Observer: Send {
    // Provided methods
    fn stop_after_level(&self) -> bool { ... }
    fn init(
        &mut self,
        _id: usize,
        _state: &StateVals,
        _stats: Stats,
    ) -> Result<(), String> { ... }
    fn edge(
        &mut self,
        _from: usize,
        _edge: &Edge,
        _successor: &StateVals,
        _stats: Stats,
    ) -> Result<(), String> { ... }
    fn level_done(
        &mut self,
        _level: u64,
        _graph: &BehaviorGraph,
        _stats: Stats,
    ) -> Result<(), String> { ... }
}
Expand description

Receives committed initialization and completed BFS levels on the coordinator.

All methods are inert by default. Initial events follow successful Init; edge events follow a fully committed level, in source and generator order. A failed or partial level emits no edge or level event. Callback errors stop exploration without a completed graph. These hooks establish no temporal verdict.

Provided Methods§

Source

fn stop_after_level(&self) -> bool

Requests a prefix stop after a successful completed-level callback. Exhausted frontiers cannot stop as prefixes. The default preserves all existing observation behavior.

Source

fn init( &mut self, _id: usize, _state: &StateVals, _stats: Stats, ) -> Result<(), String>

A distinct accepted initial state after every Init check succeeded. Counters describe the complete initialization, including excluded candidates.

§Errors

Return a diagnostic to stop exploration at the initialization boundary.

Source

fn edge( &mut self, _from: usize, _edge: &Edge, _successor: &StateVals, _stats: Stats, ) -> Result<(), String>

An accepted transition or implicit stutter from a completed level. successor is the original concrete state, including seen-state occurrences. Counters include all generated candidates at the completed level.

§Errors

Return a diagnostic to stop exploration at this completed-level boundary.

Source

fn level_done( &mut self, _level: u64, _graph: &BehaviorGraph, _stats: Stats, ) -> Result<(), String>

A fully committed level and its borrowed graph, after frontier append. Unexpanded frontier states have empty outgoing rows. A prefix without a violation does not prove a temporal property; exhaustion is still required.

§Errors

Return a diagnostic to stop exploration at this completed-level boundary.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§