Struct prettytable::TableSlice [] [src]

pub struct TableSlice<'a> { /* 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]

[src]

Compute and return the number of column

[src]

Get the number of rows

[src]

Check if the table slice is empty

[src]

Get an immutable reference to a row

Important traits for ColumnIter<'a>
[src]

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

Important traits for Iter<'a, T>
[src]

Returns an iterator over immutable rows

[src]

Print the table to out

[src]

Print the table to terminal out, applying styles when needed

[src]

Print the table to standard output. Colors won't be displayed unless stdout is a tty terminal, or force_colorize is set to true. In ANSI terminals, colors are displayed using ANSI escape characters. When for example the output is redirected to a file, or piped to another program, the output is considered as not beeing tty, and ANSI escape characters won't be displayed unless force colorize is set to true.

Panic

Panic if writing to standard output fails

[src]

Print the table to standard output. Colors won't be displayed unless stdout is a tty terminal. This means that if stdout is redirected to a file, or piped to another program, no color will be displayed. To force colors rendering, use print_tty() method. Calling printstd() is equivalent to calling print_tty(false)

Panic

Panic if writing to standard output fails

[src]

Write the table to the specified writer.

[src]

Write the table to the specified writer.

This allows for format customisation.

Trait Implementations

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

[src]

Returns a copy of the value. Read more

1.0.0
[src]

Performs copy-assignment from source. Read more

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

[src]

Formats the value using the given formatter. Read more

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

[src]

Feeds this value into the given [Hasher]. Read more

1.3.0
[src]

Feeds a slice of this type into the given [Hasher]. Read more

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

[src]

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

[src]

This method tests for !=.

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

impl<'a> IntoIterator for &'a TableSlice<'a>
[src]

The type of the elements being iterated over.

Which kind of iterator are we turning this into?

[src]

Creates an iterator from a value. Read more

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

The returned type after indexing.

[src]

Performs the indexing (container[index]) operation.

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

[src]

Formats the value using the given formatter. Read more

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

[src]

Performs the conversion.

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

[src]

Performs the conversion.

Auto Trait Implementations

impl<'a> Send for TableSlice<'a>

impl<'a> Sync for TableSlice<'a>