pub trait EffectSink<M, I> {
// Required method
fn emit(&mut self, effect: Effect<M, I>);
}Expand description
Receives the effects a protocol emits.
The core deliberately has no opinion about how effects are stored. A driver that wants
amortised allocation passes a Vec and reuses it across events; a no_std or
latency-sensitive driver passes a fixed-capacity sink; a test passes one that merely counts.
Protocol code is identical in every case, because a protocol only ever calls
Cx::send and friends.
Required Methods§
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".