[][src]Struct termimad::CompoundStyle

pub struct CompoundStyle {
    pub object_style: ObjectStyle,
}

A style which may be applied to a compound

Fields

object_style: ObjectStyle

Methods

impl CompoundStyle[src]

pub fn apply_to<D: Display>(&self, val: D) -> StyledObject<D>[src]

Apply an StyledObject to the passed displayable object.

pub fn new(
    fg_color: Option<Color>,
    bg_color: Option<Color>,
    attrs: Vec<Attribute>
) -> CompoundStyle
[src]

Get an new instance of CompoundStyle

pub fn with_fgbg(fg: Color, bg: Color) -> CompoundStyle[src]

Get an new instance of CompoundStyle

pub fn with_fg(fg: Color) -> CompoundStyle[src]

Get an new instance of CompoundStyle

pub fn with_bg(bg: Color) -> CompoundStyle[src]

Get an new instance of CompoundStyle

pub fn with_attr(attr: Attribute) -> CompoundStyle[src]

Get an new instance of CompoundStyle

pub fn set_fg(&mut self, color: Color)[src]

Set the foreground color to the passed color.

pub fn set_bg(&mut self, color: Color)[src]

Set the background color to the passed color.

pub fn set_fgbg(&mut self, fg: Color, bg: Color)[src]

Set the colors to the passed ones

pub fn add_attr(&mut self, attr: Attribute)[src]

Add an Attribute. Like italic, underlined or bold.

pub fn overwrite_with(&mut self, other: &CompoundStyle)[src]

Add the defined characteristics of other to self, overwriting its own one when defined

pub fn repeat_string(&self, f: &mut Formatter, s: &str, count: usize) -> Result[src]

Write a string several times with the line compound style

Implementation Note: performances here are critical

pub fn repeat_space(&self, f: &mut Formatter, count: usize) -> Result[src]

Write 0 or more spaces with the line's compound style

Trait Implementations

impl Clone for CompoundStyle[src]

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

impl Default for CompoundStyle[src]

impl From<ObjectStyle> for CompoundStyle[src]

Auto Trait Implementations

Blanket Implementations

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]