pub trait Executor {
type Args: Arguments;
// Required method
fn run_with<S, F, O>(&mut self, stream: &mut S, collect: F) -> Result<()>
where S: Stream<Self::Args, Output = O>,
O: 'static,
F: FnMut(O) -> Result<()>;
// Provided method
fn run<S>(&mut self, stream: &mut S) -> Result<Vec<S::Output>>
where S: Stream<Self::Args> { ... }
}Expand description
Required Associated Types§
Required Methods§
Sourcefn run_with<S, F, O>(&mut self, stream: &mut S, collect: F) -> Result<()>
fn run_with<S, F, O>(&mut self, stream: &mut S, collect: F) -> Result<()>
Execute a series of operations on stream. As outputs are produced, they will be
passed to collect for aggregation.
Since dynamic execution may be long-running, this allows implementations of collect
to perform operations like status updates or partial saving of results as they are
generated.
See also: Executor::run.
Provided Methods§
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.