pub trait IO<PI: Clone> {
// Required method
fn push(&mut self, event: impl Into<OutEvent<PI>>);
// Provided method
fn push_from_iter(
&mut self,
iter: impl IntoIterator<Item = impl Into<OutEvent<PI>>>,
) { ... }
}
Expand description
A trait for a concrete type to push OutEvent
s to.
The implementation is generic over this trait, which allows the upper layer to supply a
container of their choice for OutEvent
s emitted from the protocol state.
Required Methods§
Provided Methods§
Sourcefn push_from_iter(
&mut self,
iter: impl IntoIterator<Item = impl Into<OutEvent<PI>>>,
)
fn push_from_iter( &mut self, iter: impl IntoIterator<Item = impl Into<OutEvent<PI>>>, )
Push all events from an iterator into the IO container
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.