pub struct Writer<'a, 'b: 'a, Term: 'b + Terminal> { /* private fields */ }
Expand description
Provides an interface to write line-by-line output to the terminal device.
Holds a lock on terminal write operations.
See Interface
for more information about concurrent operations.
An instance of this type can be constructed using either the
Interface::lock_writer_append
or the Interface::lock_writer_erase
method.
Implementations
sourceimpl<'a, 'b: 'a, Term: 'b + Terminal> Writer<'a, 'b, Term>
impl<'a, 'b: 'a, Term: 'b + Terminal> Writer<'a, 'b, Term>
sourcepub fn history(&self) -> HistoryIter<'_>ⓘNotable traits for HistoryIter<'a>impl<'a> Iterator for HistoryIter<'a> type Item = &'a str;
pub fn history(&self) -> HistoryIter<'_>ⓘNotable traits for HistoryIter<'a>impl<'a> Iterator for HistoryIter<'a> type Item = &'a str;
Returns an iterator over history entries.
sourcepub fn write_str(&mut self, s: &str) -> Result<()>
pub fn write_str(&mut self, s: &str) -> Result<()>
Writes some text to the terminal device.
Before the Writer
is dropped, any output written should be followed
by a newline. A newline is automatically written if the writeln!
macro is used.
sourcepub fn write_fmt(&mut self, args: Arguments<'_>) -> Result<()>
pub fn write_fmt(&mut self, args: Arguments<'_>) -> Result<()>
Writes formatted text to the terminal display.
This method enables Interface
to be used as the receiver to
the writeln!
macro.
If the text contains any unprintable characters (e.g. escape sequences), those characters will be escaped before printing.