[][src]Struct mortal::screen::ScreenWriteGuard

pub struct ScreenWriteGuard<'a>(_);

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]

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]

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]

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]

Writes formatted text at the cursor position using the current style and color settings.

This method enables ScreenWriteGuard to be used as the receiver to the write! and writeln! macros.

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

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.