Struct term_grid::Grid [] [src]

pub struct Grid {
    // some fields omitted
}

Everything needed to format the cells with the grid options.

For more information, see the module-level documentation.

Methods

impl Grid
[src]

fn new(options: GridOptions) -> Grid

Creates a new grid view with the given options.

fn reserve(&mut self, additional: usize)

Reserves space in the vector for the given number of additional cells to be added. (See vec#reserve)

fn add(&mut self, cell: Cell)

Adds another cell onto the vector.

fn fit_into_width(&self, maximum_width: Width) -> Option<Display>

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.

fn fit_into_columns(&self, num_columns: usize) -> Display

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

Trait Implementations

impl Debug for Grid
[src]

fn fmt(&self, __arg_0: &mut Formatter) -> Result

Formats the value using the given formatter.

impl PartialEq for Grid
[src]

fn eq(&self, __arg_0: &Grid) -> bool

This method tests for self and other values to be equal, and is used by ==. Read more

fn ne(&self, __arg_0: &Grid) -> bool

This method tests for !=.