[][src]Struct term_grid::Grid

pub struct Grid { /* fields omitted */ }

Everything needed to format the cells with the grid options.

For more information, see the term_grid crate documentation.

Methods

impl Grid[src]

pub fn new(options: GridOptions) -> Self[src]

Creates a new grid view with the given options.

pub fn reserve(&mut self, additional: usize)[src]

Reserves space in the vector for the given number of additional cells to be added. (See the Vec::reserve function.)

pub fn add(&mut self, cell: Cell)[src]

Adds another cell onto the vector.

pub fn fit_into_width(&self, maximum_width: Width) -> Option<Display>[src]

Returns a displayable grid that’s been packed to fit into the given width in the fewest number of rows.

Returns None if any of the cells has a width greater than the maximum width.

pub fn fit_into_columns(&self, num_columns: usize) -> Display[src]

Returns a displayable grid with the given number of columns, and no maximum width.

Trait Implementations

impl Debug for Grid[src]

impl PartialEq<Grid> for Grid[src]

impl StructuralPartialEq for Grid[src]

Auto Trait Implementations

impl RefUnwindSafe for Grid

impl Send for Grid

impl Sync for Grid

impl Unpin for Grid

impl UnwindSafe for Grid

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> From<T> for T[src]

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

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.