#[non_exhaustive]pub struct CellStyle {
pub color: Option<Color>,
pub background: Option<Color>,
pub italic: bool,
pub strikethrough: bool,
}Expand description
How a cell’s text looks (see Column::style): the default for each
field is the table’s own look.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.color: Option<Color>The text’s colour.
background: Option<Color>A tint behind the cell (a changed value, say).
italic: boolItalic text (a placeholder such as NULL).
strikethrough: boolStruck-through text (a row about to be deleted).
Implementations§
Source§impl CellStyle
impl CellStyle
Sourcepub fn new() -> Self
pub fn new() -> Self
The table’s own look: change it with the other methods. Each takes a
value computed for the row, so a style reads as one expression:
CellStyle::new().strikethrough(o.done).color(o.done.then_some(Color::Secondary)).
Sourcepub fn color(self, color: impl Into<Option<Color>>) -> Self
pub fn color(self, color: impl Into<Option<Color>>) -> Self
The text’s colour (None: the table’s own).
Sourcepub fn background(self, color: impl Into<Option<Color>>) -> Self
pub fn background(self, color: impl Into<Option<Color>>) -> Self
A tint behind the cell (None: no tint).
Sourcepub fn strikethrough(self, on: bool) -> Self
pub fn strikethrough(self, on: bool) -> Self
Struck-through text, when on.
Trait Implementations§
impl StructuralPartialEq for CellStyle
Auto Trait Implementations§
impl Forget for CellStyle
impl Freeze for CellStyle
impl Move for CellStyle
impl RefUnwindSafe for CellStyle
impl Send for CellStyle
impl Sync for CellStyle
impl Unpin for CellStyle
impl UnsafeUnpin for CellStyle
impl UnwindSafe for CellStyle
Blanket Implementations§
impl<T> AutoreleaseSafe for Twhere
T: ?Sized,
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