pub struct StatusReporter<W> { /* private fields */ }Expand description
A status-line reporter over an injected writer, palette, and glyph set.
Implementations§
Source§impl StatusReporter<Stderr>
impl StatusReporter<Stderr>
Sourcepub fn from_env(color: ColorChoice) -> Self
pub fn from_env(color: ColorChoice) -> Self
Source§impl<W: Write> StatusReporter<W>
impl<W: Write> StatusReporter<W>
Sourcepub const fn new(writer: W, palette: Palette, glyphs: Glyphs) -> Self
pub const fn new(writer: W, palette: Palette, glyphs: Glyphs) -> Self
Build a reporter from explicit parts.
Sourcepub fn success(&mut self, message: &str) -> AppResult<()>
pub fn success(&mut self, message: &str) -> AppResult<()>
Emit a success line: a green check glyph followed by message.
§Errors
Returns an error when the underlying writer fails.
Sourcepub fn error(&mut self, message: &str) -> AppResult<()>
pub fn error(&mut self, message: &str) -> AppResult<()>
Emit an error line: a red cross glyph followed by message.
§Errors
Returns an error when the underlying writer fails.
Sourcepub fn warn(&mut self, message: &str) -> AppResult<()>
pub fn warn(&mut self, message: &str) -> AppResult<()>
Emit a warning line: a yellow warning glyph followed by message.
§Errors
Returns an error when the underlying writer fails.
Sourcepub fn info(&mut self, message: &str) -> AppResult<()>
pub fn info(&mut self, message: &str) -> AppResult<()>
Emit an informational line: a cyan info glyph followed by message.
§Errors
Returns an error when the underlying writer fails.
Sourcepub fn bullet(&mut self, message: &str) -> AppResult<()>
pub fn bullet(&mut self, message: &str) -> AppResult<()>
Emit an indented bullet line: a dimmed bullet glyph followed by message.
§Errors
Returns an error when the underlying writer fails.
Auto Trait Implementations§
impl<W> Freeze for StatusReporter<W>where
W: Freeze,
impl<W> RefUnwindSafe for StatusReporter<W>where
W: RefUnwindSafe,
impl<W> Send for StatusReporter<W>where
W: Send,
impl<W> Sync for StatusReporter<W>where
W: Sync,
impl<W> Unpin for StatusReporter<W>where
W: Unpin,
impl<W> UnsafeUnpin for StatusReporter<W>where
W: UnsafeUnpin,
impl<W> UnwindSafe for StatusReporter<W>where
W: UnwindSafe,
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