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

source

pub fn intensity(&self) -> Intensity

source

pub fn set_intensity(&mut self, value: Intensity) -> &mut Self

source

pub fn underline(&self) -> Underline

source

pub fn set_underline(&mut self, value: Underline) -> &mut Self

source

pub fn italic(&self) -> bool

source

pub fn set_italic(&mut self, value: bool) -> &mut Self

source

pub fn reverse(&self) -> bool

source

pub fn set_reverse(&mut self, value: bool) -> &mut Self

source

pub fn strikethrough(&self) -> bool

source

pub fn set_strikethrough(&mut self, value: bool) -> &mut Self

source

pub fn invisible(&self) -> bool

source

pub fn set_invisible(&mut self, value: bool) -> &mut Self

source

pub fn wrapped(&self) -> bool

source

pub fn set_wrapped(&mut self, value: bool) -> &mut Self

source

pub fn overline(&self) -> bool

source

pub fn set_overline(&mut self, value: bool) -> &mut Self

source

pub fn semantic_type(&self) -> SemanticType

source

pub fn set_semantic_type(&mut self, value: SemanticType) -> &mut Self

source

pub fn vertical_align(&self) -> VerticalAlign

source

pub fn set_vertical_align(&mut self, value: VerticalAlign) -> &mut Self

source

pub const fn blank() -> Self

source

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.

source

pub fn compute_shape_hash<H: Hasher>(&self, hasher: &mut H)

source

pub fn set_foreground<C: Into<ColorAttribute>>( &mut self, foreground: C ) -> &mut Self

Set the foreground color for the cell to that specified

source

pub fn foreground(&self) -> ColorAttribute

source

pub fn set_background<C: Into<ColorAttribute>>( &mut self, background: C ) -> &mut Self

source

pub fn background(&self) -> ColorAttribute

source

pub fn set_image(&mut self, image: Box<ImageCell>) -> &mut Self

Assign a single image to a cell.

source

pub fn clear_images(&mut self) -> &mut Self

Clear all images from a cell

source

pub fn detach_image_with_placement( &mut self, image_id: u32, placement_id: Option<u32> )

source

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

source

pub fn set_underline_color<C: Into<ColorAttribute>>( &mut self, underline_color: C ) -> &mut Self

source

pub fn clone_sgr_only(&self) -> Self

Clone the attributes, but exclude fancy extras such as hyperlinks or future sprite things

source

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![]).

source

pub fn underline_color(&self) -> ColorAttribute

source

pub fn apply_change(&mut self, change: &AttributeChange)

Trait Implementations§

source§

impl Clone for CellAttributes

source§

fn clone(&self) -> CellAttributes

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for CellAttributes

source§

fn fmt(&self, fmt: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
source§

impl Default for CellAttributes

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl<'de> Deserialize<'de> for CellAttributes

source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
source§

impl PartialEq for CellAttributes

source§

fn eq(&self, other: &CellAttributes) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl Serialize for CellAttributes

source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
source§

impl Eq for CellAttributes

source§

impl StructuralEq for CellAttributes

source§

impl StructuralPartialEq for CellAttributes

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,