pub trait Sink: Send {
// Required methods
fn write(&mut self, outputs: &mut Vec<Output>) -> Result<(), SinkError>;
fn flush(&mut self) -> Result<(), SinkError>;
}Expand description
Trait for output sinks that consume reactor outputs.
Required Methods§
Sourcefn write(&mut self, outputs: &mut Vec<Output>) -> Result<(), SinkError>
fn write(&mut self, outputs: &mut Vec<Output>) -> Result<(), SinkError>
Write outputs to the sink.
The sink should drain items from the provided vector, leaving it empty but preserving capacity so the caller can reuse the allocation.
§Errors
Returns an error if the sink cannot accept the outputs.