Skip to main content

Grid

Struct Grid 

Source
pub struct Grid {
    pub cursor_pos: Option<Pos>,
    pub cursor_style: CursorStyle,
    /* private fields */
}

Fields§

§cursor_pos: Option<Pos>§cursor_style: CursorStyle

Implementations§

Source§

impl Grid

Source

pub fn new(size: Size, scrollback_len: usize) -> Grid

Available on crate feature termtui only.
Source

pub fn get_selected_text( &self, low_x: i32, low_y: i32, high_x: i32, high_y: i32, ) -> String

Available on crate feature termtui only.
Source

pub fn clear(&mut self)

Available on crate feature termtui only.
Source

pub fn size(&self) -> Size

Available on crate feature termtui only.
Source

pub fn set_size(&mut self, size: Size)

Available on crate feature termtui only.
Source

pub fn pos(&self) -> Pos

Available on crate feature termtui only.
Source

pub fn set_pos(&mut self, pos: Pos)

Available on crate feature termtui only.
Source

pub fn save_cursor(&mut self)

Available on crate feature termtui only.
Source

pub fn restore_cursor(&mut self)

Available on crate feature termtui only.
Source

pub fn visible_rows(&self) -> impl Iterator<Item = &Row>

Available on crate feature termtui only.
Source

pub fn drawing_rows(&self) -> impl Iterator<Item = &Row>

Available on crate feature termtui only.
Source

pub fn drawing_rows_mut(&mut self) -> impl Iterator<Item = &mut Row>

Available on crate feature termtui only.
Source

pub fn visible_row(&self, row: u16) -> Option<&Row>

Available on crate feature termtui only.
Source

pub fn drawing_row(&self, row: u16) -> Option<&Row>

Available on crate feature termtui only.
Source

pub fn drawing_row_mut(&mut self, row: u16) -> Option<&mut Row>

Available on crate feature termtui only.
Source

pub fn current_row_mut(&mut self) -> &mut Row

Available on crate feature termtui only.
Source

pub fn visible_cell(&self, pos: Pos) -> Option<&Cell>

Available on crate feature termtui only.
Source

pub fn drawing_cell(&self, pos: Pos) -> Option<&Cell>

Available on crate feature termtui only.
Source

pub fn drawing_cell_mut(&mut self, pos: Pos) -> Option<&mut Cell>

Available on crate feature termtui only.
Source

pub fn scrollback_len(&self) -> usize

Available on crate feature termtui only.
Source

pub fn scrollback(&self) -> usize

Available on crate feature termtui only.
Source

pub fn set_scrollback(&mut self, rows: usize)

Available on crate feature termtui only.
Source

pub fn erase_all(&mut self, attrs: Attrs)

Available on crate feature termtui only.
Source

pub fn erase_all_forward(&mut self, attrs: Attrs)

Available on crate feature termtui only.
Source

pub fn erase_all_backward(&mut self, attrs: Attrs)

Available on crate feature termtui only.
Source

pub fn erase_row(&mut self, attrs: Attrs)

Available on crate feature termtui only.
Source

pub fn erase_row_forward(&mut self, attrs: Attrs)

Available on crate feature termtui only.
Source

pub fn erase_row_backward(&mut self, attrs: Attrs)

Available on crate feature termtui only.
Source

pub fn insert_cells(&mut self, count: u16)

Available on crate feature termtui only.
Source

pub fn delete_cells(&mut self, count: u16)

Available on crate feature termtui only.
Source

pub fn erase_cells(&mut self, count: u16, attrs: Attrs)

Available on crate feature termtui only.
Source

pub fn insert_lines(&mut self, count: u16)

Available on crate feature termtui only.
Source

pub fn delete_lines(&mut self, count: u16, blank_attrs: Attrs)

Available on crate feature termtui only.
Source

pub fn scroll_up(&mut self, count: u16)

Available on crate feature termtui only.
Source

pub fn scroll_down(&mut self, count: u16)

Available on crate feature termtui only.
Source

pub fn set_scroll_region(&mut self, top: u16, bottom: u16)

Available on crate feature termtui only.
Source

pub fn set_origin_mode(&mut self, mode: bool)

Available on crate feature termtui only.
Source

pub fn row_inc_clamp(&mut self, count: u16)

Available on crate feature termtui only.
Source

pub fn row_inc_scroll(&mut self, count: u16) -> u16

Available on crate feature termtui only.
Source

pub fn row_dec_clamp(&mut self, count: u16)

Available on crate feature termtui only.
Source

pub fn row_dec_scroll(&mut self, count: u16)

Available on crate feature termtui only.
Source

pub fn row_set(&mut self, i: u16)

Available on crate feature termtui only.
Source

pub fn col_inc(&mut self, count: u16)

Available on crate feature termtui only.
Source

pub fn col_inc_clamp(&mut self, count: u16)

Available on crate feature termtui only.
Source

pub fn col_dec(&mut self, count: u16)

Available on crate feature termtui only.
Source

pub fn col_tab(&mut self)

Available on crate feature termtui only.
Source

pub fn col_set(&mut self, i: u16)

Available on crate feature termtui only.
Source

pub fn col_wrap(&mut self, width: u16, wrap: bool)

Available on crate feature termtui only.
Source§

impl Grid

Source

pub fn area(&self) -> Rect

Available on crate feature termtui only.
Source

pub fn draw_block(&mut self, area: Rect, type_: BorderType, attrs: Attrs)

Available on crate feature termtui only.
Source

pub fn draw_text(&mut self, area: Rect, text: &str, attrs: Attrs) -> Rect

Available on crate feature termtui only.
Source

pub fn fill_area(&mut self, area: Rect, c: char, attrs: Attrs)

Available on crate feature termtui only.

Trait Implementations§

Source§

impl BufferView for Grid

Source§

impl Clone for Grid

Source§

fn clone(&self) -> Grid

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Grid

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl Freeze for Grid

§

impl RefUnwindSafe for Grid

§

impl Send for Grid

§

impl Sync for Grid

§

impl Unpin for Grid

§

impl UnsafeUnpin for Grid

§

impl UnwindSafe for Grid

Blanket Implementations§

Source§

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

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

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

Source§

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

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where 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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

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

Source§

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 T
where U: TryFrom<T>,

Source§

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.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more