pub struct Styled<T>where
    T: Display,
{ pub content: T, pub style: StyleSheet, }
Expand description

Represents a content that when rendered must have the associated style applied to it.

Fields

content: T

Content to be rendered.

style: StyleSheet

Style sheet to be applied to content when rendered.

Implementations

Creates a new Styled object with the specified content and a default (empty) style sheet.

Sets the style sheet to the styled struct.

Sets the styled content to have the defined foreground Color.

Sets the styled content to have the defined foreground Color.

Sets the styled content to have the defined attributes.

Warning: this does not keep the previously applied attributes. If you want to just set a new attribute and keep the others, you need to apply the OR operation yourself.

Trait Implementations

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more

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.