pub trait Environment {
type Event;
type Effect;
type Error;
// Required methods
fn next(&mut self) -> impl Future<Output = Option<Self::Event>> + Send;
fn interpret(
&mut self,
effect: Self::Effect,
) -> impl Future<Output = Result<(), Self::Error>> + Send;
fn retire(&mut self) -> impl Future<Output = ()> + Send;
}Expand description
Gives a process protocol its live or simulated meaning.
Unlike narrower ingress ports, an environment also owns effect interpretation and the ordering between input and effects.
Required Associated Types§
Required Methods§
Sourcefn next(&mut self) -> impl Future<Output = Option<Self::Event>> + Send
fn next(&mut self) -> impl Future<Output = Option<Self::Event>> + Send
Produce the next event, or None when the source is closed.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".