Struct table_print::Table [−][src]
Fields
headers: Vec<String>
These are the table headings. For example, if counting days of the week, this may be `[“Monday”, “Tuesday”, “Wednesday”, “Thursday”, “Friday”]
content: Vec<Vec<String>>
This is the main content of the table. This goes below the heading.
The unnested vec is the X, the nested is the Y.
Implementations
impl Table
[src]
pub fn new(headers: Vec<String>) -> Self
[src]
Creates a new TablePrint.
pub fn with_content(headers: Vec<String>, content: Vec<Vec<String>>) -> Self
[src]
Creates a TablePrint with content
pub fn insert_row(&mut self, row: Vec<String>)
[src]
Inserts a row into the table.
pub fn get_row(&self, row: usize) -> Option<Vec<&str>>
[src]
Retrieves a row from the table, this is given as a reference.
If you need mutability have a look at Self::get_row_mut
pub fn get_row_mut(&mut self, row: usize) -> Option<Vec<&mut str>>
[src]
Retrieves a mutable row from the table, this is given as a reference.
pub fn get_column_count(&self) -> usize
[src]
Retrieves the column count, not including the header.
pub fn get_row_count(&self) -> usize
[src]
Retrieves the count of rows, not including the header.
pub fn get_csv(&self) -> String
[src]
Turns this into a CSV string.
pub fn get_html(&self, embeded_css: Option<&str>) -> String
[src]
Turns this into a HTML table. This function generates a complete
HTML document. If only a singal element is required than have a
look at Self::get_html_element
pub fn get_html_element(&self) -> String
[src]
Turns this into a single HTML element.
pub fn get_pretty(&self, width: usize) -> Result<String, PrettyError>
[src]
Gets a pretty version of this. Width is the max width this can take up and should probably just be the terminal width.
Trait Implementations
impl Clone for Table
[src]
impl Debug for Table
[src]
impl Default for Table
[src]
impl Eq for Table
[src]
impl Hash for Table
[src]
fn hash<__H: Hasher>(&self, state: &mut __H)
[src]
pub fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl Ord for Table
[src]
fn cmp(&self, other: &Table) -> Ordering
[src]
#[must_use]pub fn max(self, other: Self) -> Self
1.21.0[src]
#[must_use]pub fn min(self, other: Self) -> Self
1.21.0[src]
#[must_use]pub fn clamp(self, min: Self, max: Self) -> Self
1.50.0[src]
impl PartialEq<Table> for Table
[src]
impl PartialOrd<Table> for Table
[src]
fn partial_cmp(&self, other: &Table) -> Option<Ordering>
[src]
#[must_use]pub fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
impl StructuralEq for Table
[src]
impl StructuralPartialEq for Table
[src]
Auto Trait Implementations
impl RefUnwindSafe for Table
impl Send for Table
impl Sync for Table
impl Unpin for Table
impl UnwindSafe for Table
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,