Skip to main content

Sink

Trait Sink 

Source
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§

Source

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.

Source

fn flush(&mut self) -> Result<(), SinkError>

Flush any buffered data.

§Errors

Returns an error if the flush operation fails.

Implementors§