#[non_exhaustive]pub enum Probe {
Redirected,
#[non_exhaustive] Terminal {
columns: Option<u16>,
},
}Expand description
What the operating system says about one stream: redirected away from a terminal, or a terminal of some width.
Terminal::from_probe turns a probe into a
decision without touching the process, so a test chooses the probe to
use.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Redirected
A pipe, a file, or a closed stream: anything but a terminal.
#[non_exhaustive]Terminal
A terminal. Build it with Probe::terminal.
Fields
This variant is marked as non-exhaustive
Non-exhaustive enum variants could have additional fields added in future. Therefore, non-exhaustive enum variants cannot be constructed in external crates and cannot be matched against.
Implementations§
Source§impl Probe
impl Probe
Sourcepub const fn terminal(columns: Option<u16>) -> Self
pub const fn terminal(columns: Option<u16>) -> Self
A terminal whose window is columns cells wide, or whose width the
system does not report, for None. A width of 0 counts as not reported.
Sourcepub fn of(stream: Stream) -> Self
Available on crate feature detect only.
pub fn of(stream: Stream) -> Self
detect only.What the system says about stream right now. Needs the detect
feature.
Sourcepub fn is_terminal(self) -> bool
pub fn is_terminal(self) -> bool
Whether the stream is a terminal, whether or not it reports a width.
Trait Implementations§
impl Copy for Probe
impl Eq for Probe
impl StructuralPartialEq for Probe
Auto Trait Implementations§
impl Forget for Probe
impl Freeze for Probe
impl Move for Probe
impl RefUnwindSafe for Probe
impl Send for Probe
impl Sync for Probe
impl Unpin for Probe
impl UnsafeUnpin for Probe
impl UnwindSafe for Probe
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