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>
Sourcepub const fn new(left: C, right: C, top: C, bottom: C) -> PaddingColor<C>
pub const fn new(left: C, right: C, top: C, bottom: C) -> PaddingColor<C>
Construct’s an Padding object.
Sourcepub fn filled(color: C) -> PaddingColor<C>where
C: Clone,
pub fn filled(color: C) -> PaddingColor<C>where
C: Clone,
The function, sets a color for all sides.
Source§impl PaddingColor<ANSIStr<'static>>
impl PaddingColor<ANSIStr<'static>>
Sourcepub const fn empty() -> PaddingColor<ANSIStr<'static>>
pub const fn empty() -> PaddingColor<ANSIStr<'static>>
Construct’s an Padding object with no color.
Trait Implementations§
Source§impl<R, C> CellOption<R, ColoredConfig> for PaddingColor<C>
Available on crate feature std only.
impl<R, C> CellOption<R, ColoredConfig> for PaddingColor<C>
Available on crate feature
std only.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 for PaddingColor<C>where
C: Clone,
impl<C> Clone for PaddingColor<C>where
C: Clone,
Source§fn clone(&self) -> PaddingColor<C>
fn clone(&self) -> PaddingColor<C>
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl<C> Copy for PaddingColor<C>where
C: Copy,
Source§impl<C> Debug for PaddingColor<C>where
C: Debug,
impl<C> Debug for PaddingColor<C>where
C: Debug,
impl<C> Eq for PaddingColor<C>where
C: Eq,
Source§impl<C> From<PaddingColor<C>> for Sides<C>
impl<C> From<PaddingColor<C>> for Sides<C>
Source§fn from(value: PaddingColor<C>) -> Sides<C>
fn from(value: PaddingColor<C>) -> Sides<C>
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§fn from(colors: Sides<C>) -> PaddingColor<C>
fn from(colors: Sides<C>) -> PaddingColor<C>
Converts to this type from the input type.
Source§impl<C> Ord for PaddingColor<C>where
C: Ord,
impl<C> Ord for PaddingColor<C>where
C: Ord,
Source§fn cmp(&self, other: &PaddingColor<C>) -> Ordering
fn cmp(&self, other: &PaddingColor<C>) -> Ordering
1.21.0 (const: unstable) · 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
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the minimum of two values. Read more
Source§impl<C> PartialEq for PaddingColor<C>where
C: PartialEq,
impl<C> PartialEq for PaddingColor<C>where
C: PartialEq,
Source§impl<C> PartialOrd for PaddingColor<C>where
C: PartialOrd,
impl<C> PartialOrd for PaddingColor<C>where
C: PartialOrd,
impl<C> StructuralPartialEq for PaddingColor<C>where
C: PartialEq,
Source§impl<R, D, C> TableOption<R, ColoredConfig, D> for PaddingColor<C>
Available on crate feature std only.
impl<R, D, C> TableOption<R, ColoredConfig, D> for PaddingColor<C>
Available on crate feature
std only.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 moreAuto Trait Implementations§
impl<C> Freeze for PaddingColor<C>
impl<C> RefUnwindSafe for PaddingColor<C>where
Sides<C>: RefUnwindSafe,
impl<C> Send for PaddingColor<C>
impl<C> Sync for PaddingColor<C>
impl<C> Unpin for PaddingColor<C>
impl<C> UnsafeUnpin for PaddingColor<C>where
Sides<C>: UnsafeUnpin,
impl<C> UnwindSafe for PaddingColor<C>where
Sides<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