pub struct Cell {
pub fg: Color,
pub bg: Color,
pub modifier: Modifier,
pub skip: bool,
/* private fields */
}
Expand description
A buffer cell
Fields§
§fg: Color
The foreground color of the cell.
bg: Color
The background color of the cell.
modifier: Modifier
The modifier of the cell.
skip: bool
Whether the cell should be skipped when copying (diffing) the buffer to the screen.
Implementations§
Source§impl Cell
impl Cell
Sourcepub const fn new(symbol: &'static str) -> Self
pub const fn new(symbol: &'static str) -> Self
Creates a new Cell
with the given symbol.
This works at compile time and puts the symbol onto the stack. Fails to build when the
symbol doesnt fit onto the stack and requires to be placed on the heap. Use
Self::default().set_symbol()
in that case. See CompactString::new_inline
for more
details on this.
Sourcepub fn set_symbol(&mut self, symbol: &str) -> &mut Self
pub fn set_symbol(&mut self, symbol: &str) -> &mut Self
Sets the symbol of the cell.
Sourcepub fn set_char(&mut self, ch: char) -> &mut Self
pub fn set_char(&mut self, ch: char) -> &mut Self
Sets the symbol of the cell to a single character.
Sourcepub fn set_style<S: Into<Style>>(&mut self, style: S) -> &mut Self
pub fn set_style<S: Into<Style>>(&mut self, style: S) -> &mut Self
Sets the style of the cell.
style
accepts any type that is convertible to Style
(e.g. Style
, Color
, or
your own type that implements Into<Style>
).
Trait Implementations§
impl Eq for Cell
impl StructuralPartialEq for Cell
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> 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