Struct cargo::core::shell::Shell [−][src]
pub struct Shell { /* fields omitted */ }
Expand description
An abstraction around console output that remembers preferences for output verbosity and color.
Implementations
Creates a new shell (color choice and verbosity), defaulting to ‘auto’ color and verbose output.
Creates a shell from a plain writable object, with no color, and max verbosity.
Sets whether the next print should clear the current line.
Returns true
if the needs_clear
flag is unset.
Returns true
if stderr is a tty.
Erase from cursor to end of line.
Shortcut to right-align and color green a status message.
pub fn status_with_color<T, U>(
&mut self,
status: T,
message: U,
color: Color
) -> CargoResult<()> where
T: Display,
U: Display,
[src]
pub fn status_with_color<T, U>(
&mut self,
status: T,
message: U,
color: Color
) -> CargoResult<()> where
T: Display,
U: Display,
[src]Shortcut to right-align a status message.
pub fn verbose<F>(&mut self, callback: F) -> CargoResult<()> where
F: FnMut(&mut Shell) -> CargoResult<()>,
[src]
pub fn verbose<F>(&mut self, callback: F) -> CargoResult<()> where
F: FnMut(&mut Shell) -> CargoResult<()>,
[src]Runs the callback only if we are in verbose mode.
pub fn concise<F>(&mut self, callback: F) -> CargoResult<()> where
F: FnMut(&mut Shell) -> CargoResult<()>,
[src]
pub fn concise<F>(&mut self, callback: F) -> CargoResult<()> where
F: FnMut(&mut Shell) -> CargoResult<()>,
[src]Runs the callback if we are not in verbose mode.
Prints a red ‘error’ message.
Prints an amber ‘warning’ message.
Prints a cyan ‘note’ message.
Updates the verbosity of the shell.
Updates the color choice (always, never, or auto) from a string..
Gets the current color choice.
If we are not using a color stream, this will always return Never
, even if the color
choice has been set to something else.
Whether the shell supports color.
Prints a message and translates ANSI escape code into console colors.
Trait Implementations
Auto Trait Implementations
impl !RefUnwindSafe for Shell
impl !UnwindSafe for Shell