[][src]Struct termimad::CompoundStyle

pub struct CompoundStyle {
    pub object_style: ContentStyle,
}

A style which may be applied to a compound

Fields

object_style: ContentStyle

Implementations

impl CompoundStyle[src]

pub fn apply_to<D>(&self, val: D) -> StyledContent<D> where
    D: Clone + Display
[src]

Apply an StyledContent to the passed displayable object.

pub fn new(
    foreground_color: Option<Color>,
    background_color: Option<Color>,
    attributes: Attributes
) -> 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 get_fg(&self) -> Option<Color>[src]

pub fn get_bg(&self) -> Option<Color>[src]

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

pub fn queue<W, D>(&self, w: &mut W, val: D) -> Result<()> where
    D: Clone + Display,
    W: Write
[src]

write the value with this style on the given writer

pub fn queue_str<W>(&self, w: &mut W, s: &str) -> Result<()> where
    W: Write
[src]

write the string with this style on the given writer

pub fn queue_fg<W>(&self, w: &mut W) -> Result<()> where
    W: Write
[src]

pub fn queue_bg<W>(&self, w: &mut W) -> Result<()> where
    W: Write
[src]

pub fn clear<W>(&self, w: &mut W, clear_type: ClearType) -> Result<()> where
    W: Write
[src]

Clear with the compound_style's background.

let mut w = std::io::stderr();
skin.paragraph.compound_style.clear(&mut w, ClearType::UntilNewLine).unwrap();

pub fn style_char(&self, nude_char: char) -> StyledChar[src]

Trait Implementations

impl Clone for CompoundStyle[src]

impl Default for CompoundStyle[src]

impl From<ContentStyle> for CompoundStyle[src]

Auto Trait Implementations

Blanket Implementations

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

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

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

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

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

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

type Owned = T

The resulting type after obtaining ownership.

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.