pub enum DisplayAction {
    Delete {
        screen_start: ScreenPoint,
        num_units: usize,
        scrollback_start: ScrollbackBufferPoint,
    },
    Erase {
        screen_start: ScreenPoint,
        screen_end: ScreenPoint,
    },
    Overwrite {
        scrollback_start: ScrollbackBufferPoint,
        scrollback_end: ScrollbackBufferPoint,
        screen_start: ScreenPoint,
        width_difference: i32,
    },
    Insert {
        scrollback_start: ScrollbackBufferPoint,
        scrollback_end: ScrollbackBufferPoint,
        screen_start: ScreenPoint,
    },
}
Expand description

A pending action to display content from the terminal’s scrollback buffer on the screen.

See the TerminalBackend::display() for more information on how this type is used.

Variants§

§

Delete

Fields

§screen_start: ScreenPoint
§num_units: usize
§scrollback_start: ScrollbackBufferPoint

Remove the given number of units from the screen starting at the given screen coordinate.

After the delete operation, all other units coming after that point in the current Line are left-shifted by num_units. At that point, the Units starting at the given scrollback_start point in the scrollback buffer should be displayed at the given screen_start coordinate on screen.

For simplicity, this only supports a “forward” delete operation, in which the screen cursor position does not change because only the units at or after that screen cursor position are removed. A “backwards” delete operation can be achieved by moving the cursor backwards by a few units and then issuing a regular forward delete operation.

§

Erase

Fields

§screen_start: ScreenPoint
§screen_end: ScreenPoint

Erases the contents displayed on the screen in the given range of on-screen coordinates, setting those units to blank space without changing their display style.

The screen_start bound is inclusive; the screen_end bound is exclusive.

§

Overwrite

Fields

§scrollback_start: ScrollbackBufferPoint
§scrollback_end: ScrollbackBufferPoint
§screen_start: ScreenPoint
§width_difference: i32

Replace the contents displayed on the screen starting at the given on-screen coordinate with the contents of the scrollback buffer.

The scrollback_start bound is inclusive; the scrollback_end bound is exclusive; the screen_start bound is also inclusive.

The width_difference represents the difference in the displayable width of the new unit(s) vs. the old unit(s) that existed in the scrollback buffer and were previously displayed at screen_start. This is effectively new_unit_width - old_unit_width.

  • If 0, the units are the same width.
  • If positive, the new unit is wider than the old unit.
  • If negative, the old unit is wider than the new unit.
§

Insert

Fields

§scrollback_start: ScrollbackBufferPoint
§scrollback_end: ScrollbackBufferPoint
§screen_start: ScreenPoint

Inserts the content from the given range in the scrollback buffer into the screen, starting at the given on-screen coordinate. After the content from the scrollback buffer is inserted, all other content currently on the screen will be shifted to the right and reflowed such that nothing else is lost.

The scrollback_start bound is inclusive; the scrollback_end bound is exclusive; the screen_start bound is also inclusive.

Trait Implementations§

source§

impl Debug for DisplayAction

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

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

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.