Skip to main content

NoteSink

Trait NoteSink 

Source
pub trait NoteSink<N> {
    // Required method
    fn note(&mut self, note: N);
}
Expand description

Receives the decisions a protocol narrates.

Separate from EffectSink, and deliberately. An effect is deferred: it describes something the driver will do on the protocol’s behalf. A note describes something that has already happened, at a point inside the handler — so it is recorded at the moment of the call, in the handler’s own text, for the same reason crate::Store is not an effect either.

Nothing a protocol can observe reveals whether anything is listening, so no behaviour can depend on it: a run is identical whether or not it was read.

Required Methods§

Source

fn note(&mut self, note: N)

Dyn Compatibility§

This trait is dyn compatible.

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

Implementations on Foreign Types§

Source§

impl<N> NoteSink<N> for Vec<N>

Source§

fn note(&mut self, note: N)

Implementors§

Source§

impl<N> NoteSink<N> for NoNotes