[−][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);
Implementations
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 further manipulated
Trait Implementations
impl<D: Clone + Display> Clone for StyledContent<D>
[src]
pub fn clone(&self) -> StyledContent<D>
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl<D: Display + Clone> Colorize<D> for StyledContent<D>
[src]
pub fn black(self) -> StyledContent<D>
[src]
pub fn dark_grey(self) -> StyledContent<D>
[src]
pub fn red(self) -> StyledContent<D>
[src]
pub fn dark_red(self) -> StyledContent<D>
[src]
pub fn green(self) -> StyledContent<D>
[src]
pub fn dark_green(self) -> StyledContent<D>
[src]
pub fn yellow(self) -> StyledContent<D>
[src]
pub fn dark_yellow(self) -> StyledContent<D>
[src]
pub fn blue(self) -> StyledContent<D>
[src]
pub fn dark_blue(self) -> StyledContent<D>
[src]
pub fn magenta(self) -> StyledContent<D>
[src]
pub fn dark_magenta(self) -> StyledContent<D>
[src]
pub fn cyan(self) -> StyledContent<D>
[src]
pub fn dark_cyan(self) -> StyledContent<D>
[src]
pub fn white(self) -> StyledContent<D>
[src]
pub fn grey(self) -> StyledContent<D>
[src]
pub fn on_black(self) -> StyledContent<D>
[src]
pub fn on_dark_grey(self) -> StyledContent<D>
[src]
pub fn on_red(self) -> StyledContent<D>
[src]
pub fn on_dark_red(self) -> StyledContent<D>
[src]
pub fn on_green(self) -> StyledContent<D>
[src]
pub fn on_dark_green(self) -> StyledContent<D>
[src]
pub fn on_yellow(self) -> StyledContent<D>
[src]
pub fn on_dark_yellow(self) -> StyledContent<D>
[src]
pub fn on_blue(self) -> StyledContent<D>
[src]
pub fn on_dark_blue(self) -> StyledContent<D>
[src]
pub fn on_magenta(self) -> StyledContent<D>
[src]
pub fn on_dark_magenta(self) -> StyledContent<D>
[src]
pub fn on_cyan(self) -> StyledContent<D>
[src]
pub fn on_dark_cyan(self) -> StyledContent<D>
[src]
pub fn on_white(self) -> StyledContent<D>
[src]
pub fn on_grey(self) -> StyledContent<D>
[src]
impl<D: Copy + Display> Copy for 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]
pub fn reset(self) -> StyledContent<D>
[src]
pub fn bold(self) -> StyledContent<D>
[src]
pub fn underlined(self) -> StyledContent<D>
[src]
pub fn reverse(self) -> StyledContent<D>
[src]
pub fn dim(self) -> StyledContent<D>
[src]
pub fn italic(self) -> StyledContent<D>
[src]
pub fn negative(self) -> StyledContent<D>
[src]
pub fn slow_blink(self) -> StyledContent<D>
[src]
pub fn rapid_blink(self) -> StyledContent<D>
[src]
pub fn hidden(self) -> StyledContent<D>
[src]
pub fn crossed_out(self) -> StyledContent<D>
[src]
Auto Trait Implementations
impl<D> RefUnwindSafe for StyledContent<D> where
D: RefUnwindSafe,
[src]
D: RefUnwindSafe,
impl<D> Send for StyledContent<D> where
D: Send,
[src]
D: Send,
impl<D> Sync for StyledContent<D> where
D: Sync,
[src]
D: Sync,
impl<D> Unpin for StyledContent<D> where
D: Unpin,
[src]
D: Unpin,
impl<D> UnwindSafe for StyledContent<D> where
D: UnwindSafe,
[src]
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,
pub 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.
pub fn to_owned(&self) -> T
[src]
pub 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.
pub 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>,