pub struct Line { /* private fields */ }Expand description
One line of the output of a command
A line carries the text that the command wrote and the stream that wrote
it. The text holds neither the \n nor the \r\n that ended the line, so
a caller can put the line into a log, a report, or an event of its own
without a trim.
The last line of a stream can end with no such characters at all, when the command ends after its last byte. That line reaches the caller as well.
§Examples
use kawauso_process::run::Line;
use kawauso_process::run::Stream;
let line = Line::new(Stream::StandardError, "no such file");
assert_eq!(line.text().get(), "no such file");Implementations§
Source§impl Line
impl Line
Sourcepub fn new(stream: Stream, text: impl Into<Text>) -> Line
pub fn new(stream: Stream, text: impl Into<Text>) -> Line
Creates one line of the output of a command
A run builds this value, and a caller builds one where a test stands in for a command that no one starts.
Trait Implementations§
Source§impl Display for Line
Shows the line for a reader
impl Display for Line
Shows the line for a reader
The text is the line alone, without the name of the stream, because a caller that wants the name has the stream and chooses how to show it.
impl Eq for Line
Source§impl Ord for Line
impl Ord for Line
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the minimum of two values. Read more
Source§impl PartialOrd for Line
impl PartialOrd for Line
impl StructuralPartialEq for Line
Auto Trait Implementations§
impl Freeze for Line
impl RefUnwindSafe for Line
impl Send for Line
impl Sync for Line
impl Unpin for Line
impl UnsafeUnpin for Line
impl UnwindSafe for Line
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more