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
sourceimpl 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 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.
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
Trait Implementations
sourceimpl Clone for CellAttributes
impl Clone for CellAttributes
sourcefn clone(&self) -> CellAttributes
fn clone(&self) -> CellAttributes
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for CellAttributes
impl Debug for CellAttributes
sourceimpl Default for CellAttributes
impl Default for CellAttributes
sourceimpl<'de> Deserialize<'de> for CellAttributes
impl<'de> Deserialize<'de> for CellAttributes
sourcefn 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>,
Deserialize this value from the given Serde deserializer. Read more
sourceimpl PartialEq<CellAttributes> for CellAttributes
impl PartialEq<CellAttributes> for CellAttributes
sourcefn eq(&self, other: &CellAttributes) -> bool
fn eq(&self, other: &CellAttributes) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
sourcefn ne(&self, other: &CellAttributes) -> bool
fn ne(&self, other: &CellAttributes) -> bool
This method tests for !=
.
sourceimpl Serialize for CellAttributes
impl Serialize for CellAttributes
impl Eq for CellAttributes
impl StructuralEq for CellAttributes
impl StructuralPartialEq for CellAttributes
Auto Trait Implementations
impl RefUnwindSafe for CellAttributes
impl Send for CellAttributes
impl Sync for CellAttributes
impl Unpin for CellAttributes
impl UnwindSafe for CellAttributes
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more