tokio_childstream/
event.rs

1use bytes::Bytes;
2use std::process::ExitStatus;
3
4/// Represents events from a [ChildStream](crate::ChildStream)
5#[derive(Clone, Debug)]
6pub enum ChildEvent {
7    /// Output read from the child's stdout/stderr
8    Output(OutputSource, Bytes),
9
10    /// The [ExitStatus] of the child
11    ///
12    /// Note: [ChildStream](crate::ChildStream) ensures this is the last event emitted so long as
13    /// there are no [std::io::Error] items yielded.
14    Exit(ExitStatus),
15}
16
17/// Indicate the source of [ChildEvent::Output]
18#[derive(Copy, Clone, Debug)]
19pub enum OutputSource {
20    /// Output read from a child's stdout
21    Stdout,
22    /// Output read from a child's stderr
23    Stderr,
24}