Struct Row

Source
pub struct Row {
    pub default_options: Options,
    pub column_width: Option<usize>,
    pub padding_size: Option<usize>,
    pub cells: Vec<Cell>,
}
Expand description

Data type for creating a Row for the grid.

Fields§

§default_options: Options

These options will be used if the equivalent is not provided by the underlying Cell type.

§column_width: Option<usize>

Width in chars for each column of the Row.

§padding_size: Option<usize>

Number of char spaces for each padding space between row columns.

§cells: Vec<Cell>

Collection of cells that this Row contains.

Implementations§

Source§

impl Row

Source

pub fn new(cells: Vec<Cell>) -> Self

Creates a new Row by its cells.

Source

pub fn new_empty(col_span: usize) -> Self

Create a new empty row with a specific column span.

Source

pub fn new_fill(content: String, col_span: usize) -> Self

Create a new row with a specified column span filled by the repeated content.

Source

pub fn builder(cells: Vec<Cell>) -> RowBuilder

Creates a RowBuilder initiated with cells. To build the final RowBuilder call the build method.

Source

pub fn render( &self, f: &mut Formatter<'_>, default_options: &Options, column_width: Option<usize>, padding_size: Option<usize>, ) -> Result

Formats the Row into a string.

Trait Implementations§

Source§

impl Display for Row

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl Freeze for Row

§

impl RefUnwindSafe for Row

§

impl Send for Row

§

impl Sync for Row

§

impl Unpin for Row

§

impl UnwindSafe for Row

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.