pub struct ContentStyle {
    pub foreground_color: Option<Color>,
    pub background_color: Option<Color>,
    pub underline_color: Option<Color>,
    pub attributes: Attributes,
}
Expand description

The style that can be put on content.

Fields

foreground_color: Option<Color>

The foreground color.

background_color: Option<Color>

The background color.

underline_color: Option<Color>

The underline color.

attributes: Attributes

List of attributes.

Implementations

Creates a StyledContent by applying the style to the given val.

Creates a new ContentStyle.

Trait Implementations

Converts this type into a mutable reference of the (usually inferred) input type.

Converts this type into a mutable reference of the (usually inferred) input type.

Converts this type into a shared reference of the (usually inferred) input type.

Converts this type into a shared reference of the (usually inferred) input type.

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Returns the “default value” for a type. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

This type with styles applied.

Styles this type.

Sets the foreground color.

Sets the background color.

Sets the underline color.

Styles the content with the attribute.

Applies the Reset attribute to the text.

Applies the Bold attribute to the text.

Applies the Underlined attribute to the text.

Applies the Reverse attribute to the text.

Applies the Dim attribute to the text.

Applies the Italic attribute to the text.

Applies the Reverse attribute to the text.

Applies the SlowBlink attribute to the text.

Applies the RapidBlink attribute to the text.

Applies the Hidden attribute to the text.

Applies the CrossedOut attribute to the text.

Sets the foreground color to Black.

Sets the background color to Black.

Sets the underline color to Black.

Sets the foreground color to DarkGrey.

Sets the background color to DarkGrey.

Sets the underline color to DarkGrey.

Sets the foreground color to Red.

Sets the background color to Red.

Sets the underline color to Red.

Sets the foreground color to DarkRed.

Sets the background color to DarkRed.

Sets the underline color to DarkRed.

Sets the foreground color to Green.

Sets the background color to Green.

Sets the underline color to Green.

Sets the foreground color to DarkGreen.

Sets the background color to DarkGreen.

Sets the underline color to DarkGreen.

Sets the foreground color to Yellow.

Sets the background color to Yellow.

Sets the underline color to Yellow.

Sets the foreground color to DarkYellow.

Sets the background color to DarkYellow.

Sets the underline color to DarkYellow.

Sets the foreground color to Blue.

Sets the background color to Blue.

Sets the underline color to Blue.

Sets the foreground color to DarkBlue.

Sets the background color to DarkBlue.

Sets the underline color to DarkBlue.

Sets the foreground color to Magenta.

Sets the background color to Magenta.

Sets the underline color to Magenta.

Sets the foreground color to DarkMagenta.

Sets the background color to DarkMagenta.

Sets the underline color to DarkMagenta.

Sets the foreground color to Cyan.

Sets the background color to Cyan.

Sets the underline color to Cyan.

Sets the foreground color to DarkCyan.

Sets the background color to DarkCyan.

Sets the underline color to DarkCyan.

Sets the foreground color to White.

Sets the background color to White.

Sets the underline color to White.

Sets the foreground color to Grey.

Sets the background color to Grey.

Sets the underline color to Grey.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.