Struct prettytable::TableSlice [] [src]

pub struct TableSlice<'a> {
    // some fields omitted
}

A borrowed immutable Table slice A TableSlice is obtained by slicing a Table with the Slice::slice method.

Examples

use prettytable::{Table, Slice};
let table = table![[1, 2, 3], [4, 5, 6], [7, 8, 9]];
let slice = table.slice(1..);
slice.printstd(); // Prints only rows 1 and 2

//Also supports other syntax :
table.slice(..);
table.slice(..2);
table.slice(1..3);

Methods

impl<'a> TableSlice<'a>
[src]

fn get_column_num(&self) -> usize

Compute and return the number of column

fn len(&self) -> usize

Get the number of rows

fn get_row(&self, row: usize) -> Option<&Row>

Get an immutable reference to a row

fn column_iter(&self, column: usize) -> ColumnIter

Return an iterator over the immutable cells of the column specified by column

fn print<T: Write + ?Sized>(&self, out: &mut T) -> Result<()Error>

Print the table to out

fn print_term<T: Terminal + ?Sized>(&self, out: &mut T) -> Result<()Error>

Print the table to terminal out, applying styles when needed

fn printstd(&self)

Print the table to standard output

Panic

Panic if writing to standard output fails

Trait Implementations

impl<'a> Debug for TableSlice<'a>
[src]

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

Formats the value using the given formatter.

impl<'a> Clone for TableSlice<'a>
[src]

fn clone(&self) -> TableSlice<'a>

Returns a copy of the value. Read more

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

Performs copy-assignment from source. Read more

impl<'a> Index<usize> for TableSlice<'a>
[src]

type Output = Row

The returned type after indexing

fn index(&self, idx: usize) -> &Self::Output

The method for the indexing (Foo[Bar]) operation

impl<'a> Display for TableSlice<'a>
[src]

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

Formats the value using the given formatter.

impl<'a> AsRef<TableSlice<'a>> for TableSlice<'a>
[src]

fn as_ref(&self) -> &TableSlice<'a>

Performs the conversion.