[][src]Struct crossterm_style::styledobject::StyledObject

pub struct StyledObject<D: Display> {
    pub object_style: ObjectStyle,
    pub content: D,
}

Contains both the style and the content wits can be styled.

Fields

object_style: ObjectStylecontent: D

Methods

impl<'a, D: Display + 'a> StyledObject<D>[src]

pub fn with(self, foreground_color: Color) -> StyledObject<D>[src]

Set the foreground of the styled object to the passed Color.

Remarks

This methods consumes 'self', and works like a builder. By having this functionality you can do: with().on().attr()

pub fn on(self, background_color: Color) -> StyledObject<D>[src]

Set the background of the styled object to the passed Color.

Remarks

This methods consumes 'self', and works like a builder. By having this functionality you can do: with().on().attr()

pub fn attr(self, attr: Attribute) -> StyledObject<D>[src]

Set the attribute of an styled object to the passed Attribute.

Remarks

This methods consumes 'self', and works like a builder. By having this functionality you can do: with().on().attr()

Trait Implementations

impl<D: Display> Colorize<D> for StyledObject<D>[src]

impl<D: Display> Styler<D> for StyledObject<D>[src]

impl<D: Display> Display for StyledObject<D>[src]

Auto Trait Implementations

impl<D> Send for StyledObject<D> where
    D: Send

impl<D> Sync for StyledObject<D> where
    D: Sync

Blanket Implementations

impl<T> ToString for T where
    T: Display + ?Sized
[src]

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]