Struct Cell

Source
pub struct Cell {
    pub content: String,
    pub col_span: Option<usize>,
    pub h_align: Option<HAlign>,
    pub v_align: Option<VAlign>,
    pub blank_char: Option<char>,
}
Expand description

Data type that represents options for a cell and its content.

Fields§

§content: String

The content of the cell. It can be a multi line string or even a nested Grid.

§col_span: Option<usize>

Number of columns that this cell will be spreads out into. If None specified, the value col_span of the grid will be used. If col_span of the grid also is None, value 1 will be used.

§Panics

Panics if 0 is specified.

§h_align: Option<HAlign>

Align content of the cell horizontally. If None specified, the value h_align of the grid will be used. If h_align of the grid also is None, HAlign::Left will be used.

§v_align: Option<VAlign>

Align content of the cell vertically. If None specified, the value v_align of the grid will be used. If v_align of the grid also is None, VAlign::Top will be used.

§blank_char: Option<char>

Fill cell padding spaces by this char value. If None specified, the value blank_char of the grid will be used. If blank_char of the grid also is None, white space char ('\x20') will be used.

Implementations§

Source§

impl Cell

Source

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

Create a new Cell by its content and col_span properties. To specify other properties, use the builder method instead.

Source

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

Creates a Cell with the specified col_span. The entire width of the cell will be filled by repeating the content.

Source

pub fn new_empty(col_span: usize) -> Self

Creates an empty Cell with the specified col_span. To specify other properties, use the builder method instead.

Source

pub fn builder(content: String, col_span: usize) -> CellBuilder

Creates a CellBuilder initiated with content and col_span properties. To build the final CellBuilder call the build method.

Auto Trait Implementations§

§

impl Freeze for Cell

§

impl RefUnwindSafe for Cell

§

impl Send for Cell

§

impl Sync for Cell

§

impl Unpin for Cell

§

impl UnwindSafe for Cell

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, 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.