pub enum StreamEvent {
Chunk(Chunk),
Gap,
Eof,
ReadError(StreamReadError),
}Expand description
Event emitted by an output stream backend.
Stream backends send these events to communicate raw process output, deliberate loss of output when a bounded buffer cannot keep up, and the terminal end-of-stream marker.
Variants§
Chunk(Chunk)
Bytes read from the underlying stdout or stderr stream.
Gap
Marker indicating that one or more chunks were skipped.
This can be emitted when a lossy backend drops buffered output for a slow consumer. Line parsers use it to discard any partially accumulated line so data from before and after the gap is not joined into a line that never existed in the source stream.
Eof
End of the underlying stdout or stderr stream.
This is the terminal event for the stream. After it is emitted, no more events are expected.
ReadError(StreamReadError)
The underlying stdout or stderr stream failed while being read.
This is terminal, but distinct from EOF because the stream did not end cleanly.
Implementations§
Source§impl StreamEvent
impl StreamEvent
Sourcepub fn chunk(chunk: impl Into<Chunk>) -> Self
pub fn chunk(chunk: impl Into<Chunk>) -> Self
Convenience constructor for StreamEvent::Chunk.
Trait Implementations§
Source§impl Clone for StreamEvent
impl Clone for StreamEvent
Source§fn clone(&self) -> StreamEvent
fn clone(&self) -> StreamEvent
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more