[−][src]Struct tuikit::attr::Attr
Attr
is a rendering attribute that contains fg color, bg color and text effect.
use tuikit::attr::{Attr, Effect, Color}; let attr = Attr { fg: Color::RED, effect: Effect::BOLD, ..Attr::default() };
Fields
fg: Color
bg: Color
effect: Effect
Implementations
impl Attr
[src]
pub fn extend(&self, new_attr: Self) -> Attr
[src]
extend the properties with the new attr's if the properties in new attr is not default.
use tuikit::attr::{Attr, Color, Effect}; let default = Attr{fg: Color::BLUE, bg: Color::YELLOW, effect: Effect::BOLD}; let new = Attr{fg: Color::Default, bg: Color::WHITE, effect: Effect::REVERSE}; let extended = default.extend(new); assert_eq!(Color::BLUE, extended.fg); assert_eq!(Color::WHITE, extended.bg); assert_eq!(Effect::BOLD | Effect::REVERSE, extended.effect);
pub fn fg(self, fg: Color) -> Self
[src]
pub fn bg(self, bg: Color) -> Self
[src]
pub fn effect(self, effect: Effect) -> Self
[src]
Trait Implementations
impl Clone for Attr
[src]
impl Copy for Attr
[src]
impl Debug for Attr
[src]
impl Default for Attr
[src]
impl From<Color> for Attr
[src]
impl From<Effect> for Attr
[src]
impl PartialEq<Attr> for Attr
[src]
impl StructuralPartialEq for Attr
[src]
Auto Trait Implementations
impl RefUnwindSafe for Attr
impl Send for Attr
impl Sync for Attr
impl Unpin for Attr
impl UnwindSafe for Attr
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,