pub struct PaddingColor<C> { /* private fields */ }
Expand description
PaddingColor is responsible for a left/right/top/bottom inner color of a particular cell.
§Example
ⓘ
use tabled::{
Table,
settings::{Padding, PaddingColor, Color, Style},
};
let table = Table::new("2024".chars())
.with(Style::modern())
.modify((2, 0), Padding::new(2, 4, 0, 0))
.modify((2, 0), PaddingColor::filled(Color::FG_RED))
.to_string();
assert_eq!(
table,
concat!(
"┌───────┐\n",
"│ char │\n",
"├───────┤\n",
"│ 2 │\n",
"├───────┤\n",
"│\u{1b}[31m \u{1b}[39m0\u{1b}[31m \u{1b}[39m│\n",
"├───────┤\n",
"│ 2 │\n",
"├───────┤\n",
"│ 4 │\n",
"└───────┘",
),
);
Implementations§
Source§impl<C> PaddingColor<C>
impl<C> PaddingColor<C>
Trait Implementations§
Source§impl<R, C> CellOption<R, ColoredConfig> for PaddingColor<C>
impl<R, C> CellOption<R, ColoredConfig> for PaddingColor<C>
Source§fn change(self, _: &mut R, cfg: &mut ColoredConfig, entity: Entity)
fn change(self, _: &mut R, cfg: &mut ColoredConfig, entity: Entity)
Modification function of a certail part of a grid targeted by
Entity
.Source§fn hint_change(&self) -> Option<Entity>
fn hint_change(&self) -> Option<Entity>
A hint whether an
TableOption
is going to change table layout. Read moreSource§impl<C: Clone> Clone for PaddingColor<C>
impl<C: Clone> Clone for PaddingColor<C>
Source§fn clone(&self) -> PaddingColor<C>
fn clone(&self) -> PaddingColor<C>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl<C: Debug> Debug for PaddingColor<C>
impl<C: Debug> Debug for PaddingColor<C>
Source§impl<C> From<PaddingColor<C>> for Sides<C>
impl<C> From<PaddingColor<C>> for Sides<C>
Source§fn from(value: PaddingColor<C>) -> Self
fn from(value: PaddingColor<C>) -> Self
Converts to this type from the input type.
Source§impl<C> From<Sides<C>> for PaddingColor<C>
impl<C> From<Sides<C>> for PaddingColor<C>
Source§impl<C: Ord> Ord for PaddingColor<C>
impl<C: Ord> Ord for PaddingColor<C>
Source§fn cmp(&self, other: &PaddingColor<C>) -> Ordering
fn cmp(&self, other: &PaddingColor<C>) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl<C: PartialEq> PartialEq for PaddingColor<C>
impl<C: PartialEq> PartialEq for PaddingColor<C>
Source§impl<C: PartialOrd> PartialOrd for PaddingColor<C>
impl<C: PartialOrd> PartialOrd for PaddingColor<C>
Source§impl<R, D, C> TableOption<R, ColoredConfig, D> for PaddingColor<C>
impl<R, D, C> TableOption<R, ColoredConfig, D> for PaddingColor<C>
Source§fn change(self, records: &mut R, cfg: &mut ColoredConfig, _: &mut D)
fn change(self, records: &mut R, cfg: &mut ColoredConfig, _: &mut D)
The function modificaties of records and a grid configuration.
Source§fn hint_change(&self) -> Option<Entity>
fn hint_change(&self) -> Option<Entity>
A hint whether an
TableOption
is going to change table layout. Read moreSource§impl<R, D, C> TableOption<R, CompactConfig, D> for PaddingColor<C>
impl<R, D, C> TableOption<R, CompactConfig, D> for PaddingColor<C>
Source§fn change(self, _: &mut R, cfg: &mut CompactConfig, _: &mut D)
fn change(self, _: &mut R, cfg: &mut CompactConfig, _: &mut D)
The function modificaties of records and a grid configuration.
Source§fn hint_change(&self) -> Option<Entity>
fn hint_change(&self) -> Option<Entity>
A hint whether an
TableOption
is going to change table layout. Read moreSource§impl<R, D, C> TableOption<R, CompactMultilineConfig, D> for PaddingColor<C>
impl<R, D, C> TableOption<R, CompactMultilineConfig, D> for PaddingColor<C>
Source§fn change(self, _: &mut R, cfg: &mut CompactMultilineConfig, _: &mut D)
fn change(self, _: &mut R, cfg: &mut CompactMultilineConfig, _: &mut D)
The function modificaties of records and a grid configuration.
Source§fn hint_change(&self) -> Option<Entity>
fn hint_change(&self) -> Option<Entity>
A hint whether an
TableOption
is going to change table layout. Read moreimpl<C: Copy> Copy for PaddingColor<C>
impl<C: Eq> Eq for PaddingColor<C>
impl<C> StructuralPartialEq for PaddingColor<C>
Auto Trait Implementations§
impl<C> Freeze for PaddingColor<C>where
C: Freeze,
impl<C> RefUnwindSafe for PaddingColor<C>where
C: RefUnwindSafe,
impl<C> Send for PaddingColor<C>where
C: Send,
impl<C> Sync for PaddingColor<C>where
C: Sync,
impl<C> Unpin for PaddingColor<C>where
C: Unpin,
impl<C> UnwindSafe for PaddingColor<C>where
C: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more