tabled

Struct Padding

Source
pub struct Padding(/* private fields */);
Expand description

Padding is responsible for a left/right/top/bottom inner indent of a particular cell.

let table = Table::new(&data).with(Modify::new(Rows::single(0)).with(Padding::new(0, 0, 1, 1).set_fill('>', '<', '^', 'V')));

Implementations§

Source§

impl Padding

Source

pub fn new(left: usize, right: usize, top: usize, bottom: usize) -> Self

Construct’s an Padding object.

It uses space(’ ’) as a default fill character. To set a custom character you can use Self::set_fill function.

Source

pub fn zero() -> Self

Construct’s an Padding object with all sides set to 0.

It uses space(’ ’) as a default fill character. To set a custom character you can use Self::set_fill function.

Source

pub fn set_fill(self, left: char, right: char, top: char, bottom: char) -> Self

The function, sets a characters for the padding on an each side.

Trait Implementations§

Source§

impl<R> CellOption<R> for Padding

Source§

fn change_cell(&mut self, table: &mut Table<R>, entity: Entity)

Modification function of a single cell.
Source§

impl Debug for Padding

Source§

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

Formats the value using the given formatter. Read more
Source§

impl<R> TableOption<R> for Padding

Source§

fn change(&mut self, table: &mut Table<R>)

The function modifies a Grid object.

Auto Trait Implementations§

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.