Struct mortal::screen::ScreenWriteGuard
source · [−]pub struct ScreenWriteGuard<'a>(_);
Expand description
Holds an exclusive lock for write operations on a Screen
See Screen
documentation for details on locking.
Implementations
sourceimpl<'a> ScreenWriteGuard<'a>
impl<'a> ScreenWriteGuard<'a>
sourcepub fn set_cursor<C: Into<Cursor>>(&mut self, pos: C)
pub fn set_cursor<C: Into<Cursor>>(&mut self, pos: C)
Moves the cursor to the given column on the next line.
sourcepub fn set_cursor_mode(&mut self, mode: CursorMode) -> Result<()>
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 Unix systems, this setting may have no effect.
sourcepub fn clear_screen(&mut self)
pub fn clear_screen(&mut self)
Adds a set of Style
flags to the current style setting.
sourcepub fn add_style(&mut self, style: Style)
pub fn add_style(&mut self, style: Style)
Removes a set of Style
flags to the current style setting.
Adds a set of Style
flags to the current style setting.
sourcepub fn remove_style(&mut self, style: Style)
pub fn remove_style(&mut self, style: Style)
Sets the current style setting to the given set of flags.
sourcepub fn set_style<S: Into<Option<Style>>>(&mut self, style: S)
pub fn set_style<S: Into<Option<Style>>>(&mut self, style: S)
Sets or removes foreground text color.
sourcepub fn clear_attributes(&mut self)
pub fn clear_attributes(&mut self)
Adds bold to the current style setting.
sourcepub fn bold(&mut self)
pub fn bold(&mut self)
Adds bold to the current style setting.
This is equivalent to self.add_style(Style::BOLD)
.
sourcepub fn italic(&mut self)
pub fn italic(&mut self)
Adds italic to the current style setting.
This is equivalent to self.add_style(Style::ITALIC)
.
sourcepub fn underline(&mut self)
pub fn underline(&mut self)
Adds underline to the current style setting.
This is equivalent to self.add_style(Style::UNDERLINE)
.
sourcepub fn reverse(&mut self)
pub fn reverse(&mut self)
Adds reverse to the current style setting.
This is equivalent to self.add_style(Style::REVERSE)
.
sourcepub fn refresh(&mut self) -> Result<()>
pub fn refresh(&mut self) -> Result<()>
Renders the internal buffer to the terminal screen.
This is called automatically when the ScreenWriteGuard
is dropped.
sourcepub fn write_at<C>(&mut self, position: C, text: &str) where
C: Into<Cursor>,
pub fn write_at<C>(&mut self, position: C, text: &str) where
C: Into<Cursor>,
Writes text at the given position within the screen buffer.
Any non-printable characters, such as escape sequences, will be ignored.
sourcepub fn write_styled<F, B, S>(&mut self, fg: F, bg: B, style: S, text: &str) where
F: Into<Option<Color>>,
B: Into<Option<Color>>,
S: Into<Option<Style>>,
pub fn write_styled<F, B, S>(&mut self, fg: F, bg: B, style: S, text: &str) where
F: Into<Option<Color>>,
B: Into<Option<Color>>,
S: Into<Option<Style>>,
Writes text with the given attributes at the current cursor position.
Any non-printable characters, such as escape sequences, will be ignored.
sourcepub fn write_styled_at<C, F, B, S>(
&mut self,
position: C,
fg: F,
bg: B,
style: S,
text: &str
) where
C: Into<Cursor>,
F: Into<Option<Color>>,
B: Into<Option<Color>>,
S: Into<Option<Style>>,
pub fn write_styled_at<C, F, B, S>(
&mut self,
position: C,
fg: F,
bg: B,
style: S,
text: &str
) where
C: Into<Cursor>,
F: Into<Option<Color>>,
B: Into<Option<Color>>,
S: Into<Option<Style>>,
Writes text with the given attributes at the given position within the screen buffer.
Any non-printable characters, such as escape sequences, will be ignored.
sourcepub fn write_char(&mut self, ch: char)
pub fn write_char(&mut self, ch: char)
Writes a single character at the cursor position using the current style and color settings.
If the character is a non-printable character, it will be ignored.
sourcepub fn write_str(&mut self, s: &str)
pub fn write_str(&mut self, s: &str)
Writes a string at the cursor position using the current style and color settings.
Any non-printable characters, such as escape sequences, will be ignored.
Auto Trait Implementations
impl<'a> RefUnwindSafe for ScreenWriteGuard<'a>
impl<'a> !Send for ScreenWriteGuard<'a>
impl<'a> Sync for ScreenWriteGuard<'a>
impl<'a> Unpin for ScreenWriteGuard<'a>
impl<'a> UnwindSafe for ScreenWriteGuard<'a>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more