[−][src]Struct mortal::screen::ScreenWriteGuard
Holds an exclusive lock for write operations on a Screen
See Screen
documentation for details on locking.
Methods
impl<'a> ScreenWriteGuard<'a>
[src]
pub fn size(&self) -> Size
[src]
Returns the current size of the terminal screen.
pub fn cursor(&self) -> Cursor
[src]
Sets the cursor position.
pub fn set_cursor<C: Into<Cursor>>(&mut self, pos: C)
[src]
Moves the cursor to the given column on the next line.
pub fn next_line(&mut self, column: usize)
[src]
Set the current cursor mode.
pub fn set_cursor_mode(&mut self, mode: CursorMode) -> Result<()>
[src]
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.
pub fn clear_screen(&mut self)
[src]
Adds a set of Style
flags to the current style setting.
pub fn add_style(&mut self, style: Style)
[src]
Removes a set of Style
flags to the current style setting.
Adds a set of Style
flags to the current style setting.
pub fn remove_style(&mut self, style: Style)
[src]
Sets the current style setting to the given set of flags.
pub fn set_style<S: Into<Option<Style>>>(&mut self, style: S)
[src]
Sets or removes foreground text color.
pub fn set_fg<C: Into<Option<Color>>>(&mut self, fg: C)
[src]
Sets or removes background text color.
pub fn set_bg<C: Into<Option<Color>>>(&mut self, bg: C)
[src]
Removes color and style attributes.
pub fn set_theme(&mut self, theme: Theme)
[src]
Sets all attributes for the screen.
pub fn clear_attributes(&mut self)
[src]
Adds bold to the current style setting.
pub fn bold(&mut self)
[src]
Adds bold to the current style setting.
This is equivalent to self.add_style(Style::BOLD)
.
pub fn italic(&mut self)
[src]
Adds italic to the current style setting.
This is equivalent to self.add_style(Style::ITALIC)
.
pub fn underline(&mut self)
[src]
Adds underline to the current style setting.
This is equivalent to self.add_style(Style::UNDERLINE)
.
pub fn reverse(&mut self)
[src]
Adds reverse to the current style setting.
This is equivalent to self.add_style(Style::REVERSE)
.
pub fn refresh(&mut self) -> Result<()>
[src]
Renders the internal buffer to the terminal screen.
This is called automatically when the ScreenWriteGuard
is dropped.
pub fn write_at<C>(&mut self, position: C, text: &str) where
C: Into<Cursor>,
[src]
C: Into<Cursor>,
Writes text at the given position within the screen buffer.
Any non-printable characters, such as escape sequences, will be ignored.
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>>,
[src]
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.
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>>,
[src]
&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.
pub fn write_char(&mut self, ch: char)
[src]
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.
pub fn write_str(&mut self, s: &str)
[src]
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.
pub fn write_fmt(&mut self, args: Arguments)
[src]
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
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,