Skip to main content

GraphSink

Trait GraphSink 

Source
pub trait GraphSink {
    // Required methods
    fn max_expansion_units(&self) -> usize;
    fn max_successors_per_unit(&self) -> u64;
    fn emitted(
        &mut self,
        generated: u64,
        ordinal: Option<u64>,
    ) -> Result<(), Stopped>;
    fn state(&mut self, heap: &mut Heap, step: Step<'_>) -> Result<(), Stopped>;
    fn stutter(&mut self, source: u64) -> Result<(), Stopped>;
    fn level_done(&mut self, level: u64, stats: Stats) -> Result<bool, Stopped>;

    // Provided method
    fn source_row(
        &mut self,
        _heap: &mut Heap,
        _row: SourceRow<'_>,
    ) -> Result<(), Stopped> { ... }
}
Expand description

Receives the behavior graph of a run.

Required Methods§

Source

fn max_expansion_units(&self) -> usize

Maximum source states buffered by a parallel capture wave. This uses the collector’s existing source-wave bound, independently of workers.

Source

fn max_successors_per_unit(&self) -> u64

Maximum emitted successors of one source, before retaining values. Self::emitted must refuse an ordinal at or above this bound, so speculative admission is reported in the ordinary commit order.

Source

fn emitted( &mut self, generated: u64, ordinal: Option<u64>, ) -> Result<(), Stopped>

The generated-th generated state, the ordinal-th of its source (None for an initial state), before its checks.

§Errors

Stopped ends the search.

Source

fn state(&mut self, heap: &mut Heap, step: Step<'_>) -> Result<(), Stopped>

An accepted state inside the model. heap reads its values. A sink retaining handles must also keep heap.store() alive; the borrowed slices themselves last only for this call.

§Errors

Stopped ends the search.

Source

fn stutter(&mut self, source: u64) -> Result<(), Stopped>

The fully expanded source source: its implicit stutter.

§Errors

Stopped ends the search.

Source

fn level_done(&mut self, level: u64, stats: Stats) -> Result<bool, Stopped>

The level level was expanded and committed (the initial states are level 1); stats.left_on_queue is the next level’s size. Returns whether the search stops here.

§Errors

Stopped ends the search.

Provided Methods§

Source

fn source_row( &mut self, _heap: &mut Heap, _row: SourceRow<'_>, ) -> Result<(), Stopped>

Receives an actual successful or terminal source boundary. The default observer does no work. A generator failure reaches this before stutter; successful generation reaches it after stutter and deadlock checks.

§Errors

Stopped ends the search with its original source diagnostic word.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§