[−][src]Struct crossterm::style::StyledContent
The style with the content to be styled.
Examples
use crossterm::style::{style, Color, Attribute}; let styled = style("Hello there") .with(Color::Yellow) .on(Color::Blue) .attribute(Attribute::Bold); println!("{}", styled);
Methods
impl<D: Display> StyledContent<D>
[src]
pub fn new(style: ContentStyle, content: D) -> StyledContent<D>
[src]
Creates a new StyledContent
.
pub fn with(self, foreground_color: Color) -> StyledContent<D>
[src]
Sets the foreground color.
pub fn on(self, background_color: Color) -> StyledContent<D>
[src]
Sets the background color.
pub fn attribute(self, attr: Attribute) -> StyledContent<D>
[src]
Adds the attribute.
You can add more attributes by calling this method multiple times.
pub fn content(&self) -> &D
[src]
Returns the content.
pub fn style(&self) -> &ContentStyle
[src]
Returns the style.
pub fn style_mut(&mut self) -> &mut ContentStyle
[src]
Returns a mutable reference to the style, so that it can be futher manipulated
Trait Implementations
impl<D: Clone + Display> Clone for StyledContent<D>
[src]
fn clone(&self) -> StyledContent<D>
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl<D: Display + Clone> Colorize<D> for StyledContent<D>
[src]
fn black(self) -> StyledContent<D>
[src]
fn dark_grey(self) -> StyledContent<D>
[src]
fn red(self) -> StyledContent<D>
[src]
fn dark_red(self) -> StyledContent<D>
[src]
fn green(self) -> StyledContent<D>
[src]
fn dark_green(self) -> StyledContent<D>
[src]
fn yellow(self) -> StyledContent<D>
[src]
fn dark_yellow(self) -> StyledContent<D>
[src]
fn blue(self) -> StyledContent<D>
[src]
fn dark_blue(self) -> StyledContent<D>
[src]
fn magenta(self) -> StyledContent<D>
[src]
fn dark_magenta(self) -> StyledContent<D>
[src]
fn cyan(self) -> StyledContent<D>
[src]
fn dark_cyan(self) -> StyledContent<D>
[src]
fn white(self) -> StyledContent<D>
[src]
fn grey(self) -> StyledContent<D>
[src]
fn on_black(self) -> StyledContent<D>
[src]
fn on_dark_grey(self) -> StyledContent<D>
[src]
fn on_red(self) -> StyledContent<D>
[src]
fn on_dark_red(self) -> StyledContent<D>
[src]
fn on_green(self) -> StyledContent<D>
[src]
fn on_dark_green(self) -> StyledContent<D>
[src]
fn on_yellow(self) -> StyledContent<D>
[src]
fn on_dark_yellow(self) -> StyledContent<D>
[src]
fn on_blue(self) -> StyledContent<D>
[src]
fn on_dark_blue(self) -> StyledContent<D>
[src]
fn on_magenta(self) -> StyledContent<D>
[src]
fn on_dark_magenta(self) -> StyledContent<D>
[src]
fn on_cyan(self) -> StyledContent<D>
[src]
fn on_dark_cyan(self) -> StyledContent<D>
[src]
fn on_white(self) -> StyledContent<D>
[src]
fn on_grey(self) -> StyledContent<D>
[src]
impl<D: Debug + Display> Debug for StyledContent<D>
[src]
impl<D: Display> Display for StyledContent<D>
[src]
impl<D: Display + Clone> Styler<D> for StyledContent<D>
[src]
fn reset(self) -> StyledContent<D>
[src]
fn bold(self) -> StyledContent<D>
[src]
fn underlined(self) -> StyledContent<D>
[src]
fn reverse(self) -> StyledContent<D>
[src]
fn dim(self) -> StyledContent<D>
[src]
fn italic(self) -> StyledContent<D>
[src]
fn negative(self) -> StyledContent<D>
[src]
fn slow_blink(self) -> StyledContent<D>
[src]
fn rapid_blink(self) -> StyledContent<D>
[src]
[src]
fn crossed_out(self) -> StyledContent<D>
[src]
Auto Trait Implementations
impl<D> RefUnwindSafe for StyledContent<D> where
D: RefUnwindSafe,
D: RefUnwindSafe,
impl<D> Send for StyledContent<D> where
D: Send,
D: Send,
impl<D> Sync for StyledContent<D> where
D: Sync,
D: Sync,
impl<D> Unpin for StyledContent<D> where
D: Unpin,
D: Unpin,
impl<D> UnwindSafe for StyledContent<D> where
D: UnwindSafe,
D: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,