Skip to main content

GridSlice

Struct GridSlice 

Source
pub struct GridSlice<'a> { /* private fields */ }

Implementations§

Source§

impl<'a> GridSlice<'a>

Source

pub fn width(&self) -> u16

Source

pub fn height(&self) -> u16

Source

pub fn grid_rect(&self) -> Rect

Absolute rect this slice covers in the underlying grid.

Source

pub fn to_grid_rect(&self, rect: Rect) -> Rect

Source

pub fn to_local_rect(&self, rect: Rect) -> Rect

Source

pub fn slice_mut(&mut self, area: Rect) -> GridSlice<'_>

Source

pub fn set(&mut self, x: u16, y: u16, symbol: char, style: Style)

Source

pub fn cell(&self, x: u16, y: u16) -> Cell

Read a cell at slice-local coords; returns default Cell when out of bounds.

Source

pub fn cell_mut(&mut self, x: u16, y: u16) -> Option<&mut Cell>

Mutable cell access at slice-local coords. See Grid::cell_mut for caveats.

Source

pub fn put_str(&mut self, x: u16, y: u16, text: &str, style: Style) -> u16

Source

pub fn put_padded( &mut self, x: u16, y: u16, width: u16, text: &str, style: Style, ) -> u16

Source

pub fn put_str_aligned( &mut self, x: u16, y: u16, width: u16, text: &str, align: TextAlign, style: Style, ) -> u16

Source

pub fn fill_row(&mut self, y: u16, style: Style)

Source

pub fn rule_h(&mut self, y: u16, style: Style)

Source

pub fn rule_v(&mut self, x: u16, style: Style)

Source

pub fn rule_h_range(&mut self, x: u16, y: u16, width: u16, style: Style)

Source

pub fn rule_v_range(&mut self, x: u16, y: u16, height: u16, style: Style)

Source

pub fn put_char(&mut self, x: u16, y: u16, symbol: char, fg: Color)

Slice-local Grid::put_char: overwrites symbol + fg, preserves bg and attrs.

Source

pub fn put_line(&mut self, x: u16, y: u16, line: &Line<'_>) -> u16

Slice-local Grid::put_line: paint spans left-to-right, clipping at the slice edge.

Source

pub fn put_str_fg(&mut self, x: u16, y: u16, text: &str, fg: Color) -> u16

Slice-local Grid::put_str_fg: overwrites symbol + fg per char, preserves bg and attrs.

Source

pub fn fill(&mut self, area: Rect, symbol: char, style: Style)

Source

pub fn clear(&mut self)

Auto Trait Implementations§

§

impl<'a> !UnwindSafe for GridSlice<'a>

§

impl<'a> Freeze for GridSlice<'a>

§

impl<'a> RefUnwindSafe for GridSlice<'a>

§

impl<'a> Send for GridSlice<'a>

§

impl<'a> Sync for GridSlice<'a>

§

impl<'a> Unpin for GridSlice<'a>

§

impl<'a> UnsafeUnpin for GridSlice<'a>

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> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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, 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.