Skip to main content

CommandOutputObserver

Trait CommandOutputObserver 

Source
pub trait CommandOutputObserver: Send + Sync {
    // Required method
    fn on_line(&self, stream: CommandStream, line: &str);
}
Expand description

Observes a contained command’s output one line at a time, AS IT IS WRITTEN.

Self::on_line is called once per complete line on either stream, with the line terminator (\n, or \r\n) already removed and invalid UTF-8 replaced exactly as the completion capture replaces it. A blank line is delivered as an empty string rather than dropped: the observer sees the command’s output with the same shape the capture keeps.

Required Methods§

Source

fn on_line(&self, stream: CommandStream, line: &str)

One complete line arrived on stream.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§