Struct mortal::terminal::TerminalWriteGuard [−][src]
pub struct TerminalWriteGuard<'a>(_);
Holds an exclusive lock for write operations on a Terminal
See Terminal
documentation for details on locking.
Methods
impl<'a> TerminalWriteGuard<'a>
[src]
impl<'a> TerminalWriteGuard<'a>
pub fn flush(&mut self) -> Result<()>
[src]
pub fn flush(&mut self) -> Result<()>
Flush all output to the terminal device.
This is called automatically when the TerminalWriteGuard
is dropped.
pub fn size(&self) -> Result<Size>
[src]
pub fn size(&self) -> Result<Size>
Returns the size of the terminal.
pub fn clear_screen(&mut self) -> Result<()>
[src]
pub fn clear_screen(&mut self) -> Result<()>
Clears the terminal screen, placing the cursor at the first line and column.
If the terminal contains a scrolling window over a buffer, the window will be scrolled downward, preserving as much of the existing buffer as possible.
pub fn clear_to_line_end(&mut self) -> Result<()>
[src]
pub fn clear_to_line_end(&mut self) -> Result<()>
Clears the current line, starting at cursor position.
pub fn clear_to_screen_end(&mut self) -> Result<()>
[src]
pub fn clear_to_screen_end(&mut self) -> Result<()>
Clears the screen, starting at cursor position.
pub fn move_up(&mut self, n: usize) -> Result<()>
[src]
pub fn move_up(&mut self, n: usize) -> Result<()>
Moves the cursor up n
lines.
pub fn move_down(&mut self, n: usize) -> Result<()>
[src]
pub fn move_down(&mut self, n: usize) -> Result<()>
Moves the cursor down n
lines.
pub fn move_left(&mut self, n: usize) -> Result<()>
[src]
pub fn move_left(&mut self, n: usize) -> Result<()>
Moves the cursor left n
columns.
pub fn move_right(&mut self, n: usize) -> Result<()>
[src]
pub fn move_right(&mut self, n: usize) -> Result<()>
Moves the cursor right n
columns.
pub fn move_to_first_column(&mut self) -> Result<()>
[src]
pub fn move_to_first_column(&mut self) -> Result<()>
Moves the cursor to the first column of the current line
pub fn set_cursor_mode(&mut self, mode: CursorMode) -> Result<()>
[src]
pub fn set_cursor_mode(&mut self, mode: CursorMode) -> Result<()>
Set the current cursor mode.
This setting is a visible hint to the user. It produces no change in behavior.
Notes
On some systems, this setting may have no effect.
pub fn add_style(&mut self, style: Style) -> Result<()>
[src]
pub fn add_style(&mut self, style: Style) -> Result<()>
Adds a set of Style
flags to the current style setting.
pub fn remove_style(&mut self, style: Style) -> Result<()>
[src]
pub fn remove_style(&mut self, style: Style) -> Result<()>
Removes a set of Style
flags from the current style setting.
pub fn set_style(&mut self, style: Style) -> Result<()>
[src]
pub fn set_style(&mut self, style: Style) -> Result<()>
Sets the current style to the given set of flags.
pub fn set_fg<C: Into<Option<Color>>>(&mut self, fg: C) -> Result<()>
[src]
pub fn set_fg<C: Into<Option<Color>>>(&mut self, fg: C) -> Result<()>
Sets the background text color.
pub fn set_bg<C: Into<Option<Color>>>(&mut self, bg: C) -> Result<()>
[src]
pub fn set_bg<C: Into<Option<Color>>>(&mut self, bg: C) -> Result<()>
Removes color and style attributes.
pub fn clear_attributes(&mut self) -> Result<()>
[src]
pub fn clear_attributes(&mut self) -> Result<()>
Adds bold to the current style setting.
pub fn bold(&mut self) -> Result<()>
[src]
pub fn bold(&mut self) -> Result<()>
Adds bold to the current style setting.
This is equivalent to self.add_style(Style::BOLD)
.
pub fn italic(&mut self) -> Result<()>
[src]
pub fn italic(&mut self) -> Result<()>
Adds italic to the current style setting.
This is equivalent to self.add_style(Style::ITALIC)
.
pub fn underline(&mut self) -> Result<()>
[src]
pub fn underline(&mut self) -> Result<()>
Adds underline to the current style setting.
This is equivalent to self.add_style(Style::UNDERLINE)
.
pub fn reverse(&mut self) -> Result<()>
[src]
pub fn reverse(&mut self) -> Result<()>
Adds reverse to the current style setting.
This is equivalent to self.add_style(Style::REVERSE)
.
pub fn write_styled<F, B, S>(
&mut self,
fg: F,
bg: B,
style: S,
s: &str
) -> Result<()> where
F: Into<Option<Color>>,
B: Into<Option<Color>>,
S: Into<Option<Style>>,
[src]
pub fn write_styled<F, B, S>(
&mut self,
fg: F,
bg: B,
style: S,
s: &str
) -> Result<()> where
F: Into<Option<Color>>,
B: Into<Option<Color>>,
S: Into<Option<Style>>,
Writes output to the terminal with the given color and style added.
All attributes are removed after the given text is written.
pub fn write_char(&mut self, ch: char) -> Result<()>
[src]
pub fn write_char(&mut self, ch: char) -> Result<()>
Writes a single character to the terminal using the current style and color settings.
pub fn write_str(&mut self, s: &str) -> Result<()>
[src]
pub fn write_str(&mut self, s: &str) -> Result<()>
Writes a string to the terminal using the current style and color settings.
pub fn write_fmt(&mut self, args: Arguments) -> Result<()>
[src]
pub fn write_fmt(&mut self, args: Arguments) -> Result<()>
Auto Trait Implementations
impl<'a> !Send for TerminalWriteGuard<'a>
impl<'a> !Send for TerminalWriteGuard<'a>
impl<'a> !Sync for TerminalWriteGuard<'a>
impl<'a> !Sync for TerminalWriteGuard<'a>