pub struct CharAttribute {
pub foreground: Color,
pub background: Color,
pub flags: CharFlags,
}Expand description
Represents attributes of a character such as foreground color, background color, and flags.
Fields§
§foreground: Color§background: Color§flags: CharFlagsImplementations§
Source§impl CharAttribute
impl CharAttribute
Sourcepub fn with_color(fore: Color, back: Color) -> CharAttribute
pub fn with_color(fore: Color, back: Color) -> CharAttribute
Creates a new CharAttribute with the specified foreground and background colors.
The flags are set to CharFlags::None.
§Example
use appcui::prelude::*;
let attr = CharAttribute::with_color(Color::Red, Color::Black);Sourcepub fn with_fore_color(fore: Color) -> CharAttribute
pub fn with_fore_color(fore: Color) -> CharAttribute
Creates a new CharAttribute with the specified foreground color.
The background color is set to Color::Transparent and the flags are set to CharFlags::None.
§Example
use appcui::prelude::*;
let attr = CharAttribute::with_fore_color(Color::Red);Sourcepub fn with_back_color(back: Color) -> CharAttribute
pub fn with_back_color(back: Color) -> CharAttribute
Creates a new CharAttribute with the specified background color.
The foreground color is set to Color::Transparent and the flags are set to CharFlags::None.
§Example
use appcui::prelude::*;
let attr = CharAttribute::with_back_color(Color::Black);Trait Implementations§
Source§impl Clone for CharAttribute
impl Clone for CharAttribute
Source§fn clone(&self) -> CharAttribute
fn clone(&self) -> CharAttribute
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for CharAttribute
Source§impl Debug for CharAttribute
impl Debug for CharAttribute
Source§impl Default for CharAttribute
impl Default for CharAttribute
Source§impl PartialEq for CharAttribute
impl PartialEq for CharAttribute
Source§fn eq(&self, other: &CharAttribute) -> bool
fn eq(&self, other: &CharAttribute) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for CharAttribute
Auto Trait Implementations§
impl Freeze for CharAttribute
impl RefUnwindSafe for CharAttribute
impl Send for CharAttribute
impl Sync for CharAttribute
impl Unpin for CharAttribute
impl UnsafeUnpin for CharAttribute
impl UnwindSafe for CharAttribute
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.