Struct termwiz::cell::CellAttributes
source · pub struct CellAttributes { /* private fields */ }
Expand description
Holds the attributes for a cell. Most style attributes are stored internally as part of a bitfield to reduce per-cell overhead. The setter methods return a mutable self reference so that they can be chained together.
Implementations§
source§impl CellAttributes
impl CellAttributes
pub fn intensity(&self) -> Intensity
pub fn set_intensity(&mut self, value: Intensity) -> &mut Self
pub fn underline(&self) -> Underline
pub fn set_underline(&mut self, value: Underline) -> &mut Self
pub fn blink(&self) -> Blink
pub fn set_blink(&mut self, value: Blink) -> &mut Self
pub fn italic(&self) -> bool
pub fn set_italic(&mut self, value: bool) -> &mut Self
pub fn reverse(&self) -> bool
pub fn set_reverse(&mut self, value: bool) -> &mut Self
pub fn strikethrough(&self) -> bool
pub fn set_strikethrough(&mut self, value: bool) -> &mut Self
pub fn invisible(&self) -> bool
pub fn set_invisible(&mut self, value: bool) -> &mut Self
pub fn wrapped(&self) -> bool
pub fn set_wrapped(&mut self, value: bool) -> &mut Self
pub fn overline(&self) -> bool
pub fn set_overline(&mut self, value: bool) -> &mut Self
pub fn semantic_type(&self) -> SemanticType
pub fn set_semantic_type(&mut self, value: SemanticType) -> &mut Self
pub fn vertical_align(&self) -> VerticalAlign
pub fn set_vertical_align(&mut self, value: VerticalAlign) -> &mut Self
pub const fn blank() -> Self
sourcepub fn attribute_bits_equal(&self, other: &Self) -> bool
pub fn attribute_bits_equal(&self, other: &Self) -> bool
Returns true if the attribute bits in both objects are equal.
This can be used to cheaply test whether the styles of the two
cells are the same, and is used by some Renderer
implementations.
pub fn compute_shape_hash<H: Hasher>(&self, hasher: &mut H)
sourcepub fn set_foreground<C: Into<ColorAttribute>>(
&mut self,
foreground: C
) -> &mut Self
pub fn set_foreground<C: Into<ColorAttribute>>( &mut self, foreground: C ) -> &mut Self
Set the foreground color for the cell to that specified
pub fn foreground(&self) -> ColorAttribute
pub fn set_background<C: Into<ColorAttribute>>( &mut self, background: C ) -> &mut Self
pub fn background(&self) -> ColorAttribute
pub fn set_hyperlink(&mut self, link: Option<Arc<Hyperlink>>) -> &mut Self
sourcepub fn set_image(&mut self, image: Box<ImageCell>) -> &mut Self
pub fn set_image(&mut self, image: Box<ImageCell>) -> &mut Self
Assign a single image to a cell.
sourcepub fn clear_images(&mut self) -> &mut Self
pub fn clear_images(&mut self) -> &mut Self
Clear all images from a cell
pub fn detach_image_with_placement( &mut self, image_id: u32, placement_id: Option<u32> )
sourcepub fn attach_image(&mut self, image: Box<ImageCell>) -> &mut Self
pub fn attach_image(&mut self, image: Box<ImageCell>) -> &mut Self
Add an image attachement, preserving any existing attachments. The list of images is maintained in z-index order
pub fn set_underline_color<C: Into<ColorAttribute>>( &mut self, underline_color: C ) -> &mut Self
sourcepub fn clone_sgr_only(&self) -> Self
pub fn clone_sgr_only(&self) -> Self
Clone the attributes, but exclude fancy extras such as hyperlinks or future sprite things
pub fn hyperlink(&self) -> Option<&Arc<Hyperlink>>
sourcepub fn images(&self) -> Option<Vec<ImageCell>>
pub fn images(&self) -> Option<Vec<ImageCell>>
Returns the list of attached images in z-index order. Returns None if there are no attached images; will never return Some(vec![]).
pub fn underline_color(&self) -> ColorAttribute
pub fn apply_change(&mut self, change: &AttributeChange)
Trait Implementations§
source§impl Clone for CellAttributes
impl Clone for CellAttributes
source§fn clone(&self) -> CellAttributes
fn clone(&self) -> CellAttributes
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for CellAttributes
impl Debug for CellAttributes
source§impl Default for CellAttributes
impl Default for CellAttributes
source§impl<'de> Deserialize<'de> for CellAttributes
impl<'de> Deserialize<'de> for CellAttributes
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
source§impl PartialEq for CellAttributes
impl PartialEq for CellAttributes
source§fn eq(&self, other: &CellAttributes) -> bool
fn eq(&self, other: &CellAttributes) -> bool
self
and other
values to be equal, and is used
by ==
.