[−][src]Struct alacritty_terminal::grid::Grid
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]
lines: Line,
cols: Column,
max_scroll_limit: usize,
template: T
) -> Grid<T>
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]
&mut self,
region: &Range<Line>,
positions: Line,
template: T
)
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]
Important traits for DisplayIter<'a, T>
impl<'a, T: Copy + 'a> Iterator for DisplayIter<'a, T> type Item = Indexed<T>;
pub fn clear_history(&mut self)
[src]
pub fn initialize_all(&mut self, template: T) where
T: Copy + GridCell,
[src]
T: Copy + GridCell,
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]
Important traits for GridIterator<'a, T>
impl<'a, T> Iterator for GridIterator<'a, T> type Item = &'a T;
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]
T: Deserialize<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]
__D: Deserializer<'de>,
impl<G> Dimensions for Grid<G>
[src]
fn total_lines(&self) -> usize
[src]
fn screen_lines(&self) -> Line
[src]
fn cols(&self) -> Column
[src]
fn history_size(&self) -> usize
[src]
impl<'point, T> Index<&'point Point<Line>> for Grid<T>
[src]
type Output = T
The returned type after indexing.
fn index<'a>(&'a self, point: &Point) -> &'a T
[src]
impl<T> Index<Line> for Grid<T>
[src]
Index active region by line.
impl<T> Index<Point<usize>> for Grid<T>
[src]
impl<T> Index<usize> for Grid<T>
[src]
Index with buffer offset.
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]
fn region(&self, index: Range<Line>) -> Region<T>
[src]
fn region_mut(&mut self, index: Range<Line>) -> RegionMut<T>
[src]
impl<T> IndexRegion<RangeFrom<Line>, T> for Grid<T>
[src]
fn region(&self, index: RangeFrom<Line>) -> Region<T>
[src]
fn region_mut(&mut self, index: RangeFrom<Line>) -> RegionMut<T>
[src]
impl<T> IndexRegion<RangeFull, T> for Grid<T>
[src]
fn region(&self, _: RangeFull) -> Region<T>
[src]
fn region_mut(&mut self, _: RangeFull) -> RegionMut<T>
[src]
impl<T> IndexRegion<RangeTo<Line>, T> for Grid<T>
[src]
fn region(&self, index: RangeTo<Line>) -> Region<T>
[src]
fn region_mut(&mut self, index: RangeTo<Line>) -> RegionMut<T>
[src]
impl<T: PartialEq> PartialEq<Grid<T>> for Grid<T>
[src]
impl<T> Serialize for Grid<T> where
T: Serialize,
[src]
T: Serialize,
Auto Trait Implementations
impl<T> RefUnwindSafe for Grid<T> where
T: RefUnwindSafe,
T: RefUnwindSafe,
impl<T> Send for Grid<T> where
T: Send,
T: Send,
impl<T> Sync for Grid<T> where
T: Sync,
T: Sync,
impl<T> Unpin for Grid<T> where
T: Unpin,
T: Unpin,
impl<T> UnwindSafe for Grid<T> where
T: UnwindSafe,
T: UnwindSafe,
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> DeserializeOwned for T where
T: for<'de> Deserialize<'de>,
[src]
T: for<'de> Deserialize<'de>,
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
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>,