[][src]Struct alacritty_terminal::grid::Grid

pub struct Grid<T> {
    pub cursor: Cursor,
    pub saved_cursor: Cursor,
    // some fields omitted
}

Grid based terminal content storage.

┌─────────────────────────┐  <-- max_scroll_limit + lines
│                         │
│      UNINITIALIZED      │
│                         │
├─────────────────────────┤  <-- self.raw.inner.len()
│                         │
│      RESIZE BUFFER      │
│                         │
├─────────────────────────┤  <-- self.history_size() + lines
│                         │
│     SCROLLUP REGION     │
│                         │
├─────────────────────────┤v lines
│                         │|
│     VISIBLE  REGION     │|
│                         │|
├─────────────────────────┤^ <-- display_offset
│                         │
│    SCROLLDOWN REGION    │
│                         │
└─────────────────────────┘  <-- zero
                          ^
                         cols

Fields

cursor: Cursor

Current cursor for writing data.

saved_cursor: Cursor

Last saved cursor.

Implementations

impl<T: GridCell + Default + PartialEq + Copy> Grid<T>[src]

pub fn resize(&mut self, reflow: bool, lines: Line, cols: Column)[src]

Resize the grid's width and/or height.

impl<T: GridCell + Default + PartialEq + Copy> Grid<T>[src]

pub fn new(
    lines: Line,
    cols: Column,
    max_scroll_limit: usize,
    template: T
) -> Grid<T>
[src]

pub fn update_history(&mut self, history_size: usize)[src]

Update the size of the scrollback history.

pub fn scroll_display(&mut self, scroll: Scroll)[src]

pub fn scroll_down(
    &mut self,
    region: &Range<Line>,
    positions: Line,
    template: T
)
[src]

pub fn scroll_up(&mut self, region: &Range<Line>, positions: Line, template: T)[src]

Move lines at the bottom toward the top.

This is the performance-sensitive part of scrolling.

pub fn clear_viewport(&mut self, template: T)[src]

pub fn reset(&mut self, template: T)[src]

Completely reset the grid state.

impl<T> Grid<T>[src]

pub fn clamp_buffer_to_visible(&self, point: Point<usize>) -> Point[src]

Clamp a buffer point to the visible region.

pub fn visible_to_buffer(&self, point: Point) -> Point<usize>[src]

Convert viewport relative point to global buffer indexing.

pub fn display_iter(&self) -> DisplayIter<T>

Important traits for DisplayIter<'a, T>

impl<'a, T: Copy + 'a> Iterator for DisplayIter<'a, T> type Item = Indexed<T>;
[src]

pub fn clear_history(&mut self)[src]

pub fn initialize_all(&mut self, template: T) where
    T: Copy + GridCell
[src]

This is used only for initializing after loading ref-tests.

pub fn truncate(&mut self)[src]

This is used only for truncating before saving ref-tests.

pub fn iter_from(&self, point: Point<usize>) -> GridIterator<T>

Important traits for GridIterator<'a, T>

impl<'a, T> Iterator for GridIterator<'a, T> type Item = &'a T;
[src]

pub fn display_offset(&self) -> usize[src]

pub fn cursor_cell(&mut self) -> &mut T[src]

Trait Implementations

impl<T: Clone> Clone for Grid<T>[src]

impl<T: Debug> Debug for Grid<T>[src]

impl<'de, T> Deserialize<'de> for Grid<T> where
    T: Deserialize<'de>, 
[src]

impl<G> Dimensions for Grid<G>[src]

impl<'point, T> Index<&'point Point<Line>> for Grid<T>[src]

type Output = T

The returned type after indexing.

impl<T> Index<Line> for Grid<T>[src]

Index active region by line.

type Output = Row<T>

The returned type after indexing.

impl<T> Index<Point<usize>> for Grid<T>[src]

type Output = T

The returned type after indexing.

impl<T> Index<usize> for Grid<T>[src]

Index with buffer offset.

type Output = Row<T>

The returned type after indexing.

impl<'point, T> IndexMut<&'point Point<Line>> for Grid<T>[src]

impl<T> IndexMut<Line> for Grid<T>[src]

impl<T> IndexMut<Point<usize>> for Grid<T>[src]

impl<T> IndexMut<usize> for Grid<T>[src]

impl<T> IndexRegion<Range<Line>, T> for Grid<T>[src]

impl<T> IndexRegion<RangeFrom<Line>, T> for Grid<T>[src]

impl<T> IndexRegion<RangeFull, T> for Grid<T>[src]

impl<T> IndexRegion<RangeTo<Line>, T> for Grid<T>[src]

impl<T: PartialEq> PartialEq<Grid<T>> for Grid<T>[src]

impl<T> Serialize for Grid<T> where
    T: Serialize
[src]

Auto Trait Implementations

impl<T> RefUnwindSafe for Grid<T> where
    T: RefUnwindSafe

impl<T> Send for Grid<T> where
    T: Send

impl<T> Sync for Grid<T> where
    T: Sync

impl<T> Unpin for Grid<T> where
    T: Unpin

impl<T> UnwindSafe for Grid<T> where
    T: UnwindSafe

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> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[src]

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

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

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

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.