pub struct Cell {
pub fg: Color,
pub bg: Color,
pub underline_color: 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.
underline_color: Color
The underline 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::const_new
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>
).
Sourcepub fn set_skip(&mut self, skip: bool) -> &mut Self
pub fn set_skip(&mut self, skip: bool) -> &mut Self
Sets the cell to be skipped when copying (diffing) the buffer to the screen.
This is helpful when it is necessary to prevent the buffer from overwriting a cell that is covered by an image from some terminal graphics protocol (Sixel / iTerm / Kitty …).
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more