[−][src]Struct crossterm_style::StyledObject
A styled object.
Examples
use crossterm_style::{style, Color, Attribute}; let styled = style("Hello there") .with(Color::Yellow) .on(Color::Blue) .attr(Attribute::Bold); println!("{}", styled);
Fields
object_style: ObjectStyle
The object style (colors, content attributes).
content: D
An object to apply the style on.
Methods
impl<'a, D: Display + 'a + Clone> StyledObject<D>
[src]
pub fn with(self, foreground_color: Color) -> StyledObject<D>
[src]
Sets the foreground color.
pub fn on(self, background_color: Color) -> StyledObject<D>
[src]
Sets the background color.
pub fn attr(self, attr: Attribute) -> StyledObject<D>
[src]
Adds the attribute.
You can add more attributes by calling this method multiple times.
Trait Implementations
impl<D: Display + Clone> Colorize<D> for StyledObject<D>
[src]
fn black(self) -> StyledObject<D>
[src]
fn dark_grey(self) -> StyledObject<D>
[src]
fn red(self) -> StyledObject<D>
[src]
fn dark_red(self) -> StyledObject<D>
[src]
fn green(self) -> StyledObject<D>
[src]
fn dark_green(self) -> StyledObject<D>
[src]
fn yellow(self) -> StyledObject<D>
[src]
fn dark_yellow(self) -> StyledObject<D>
[src]
fn blue(self) -> StyledObject<D>
[src]
fn dark_blue(self) -> StyledObject<D>
[src]
fn magenta(self) -> StyledObject<D>
[src]
fn dark_magenta(self) -> StyledObject<D>
[src]
fn cyan(self) -> StyledObject<D>
[src]
fn dark_cyan(self) -> StyledObject<D>
[src]
fn white(self) -> StyledObject<D>
[src]
fn grey(self) -> StyledObject<D>
[src]
fn on_black(self) -> StyledObject<D>
[src]
fn on_dark_grey(self) -> StyledObject<D>
[src]
fn on_red(self) -> StyledObject<D>
[src]
fn on_dark_red(self) -> StyledObject<D>
[src]
fn on_green(self) -> StyledObject<D>
[src]
fn on_dark_green(self) -> StyledObject<D>
[src]
fn on_yellow(self) -> StyledObject<D>
[src]
fn on_dark_yellow(self) -> StyledObject<D>
[src]
fn on_blue(self) -> StyledObject<D>
[src]
fn on_dark_blue(self) -> StyledObject<D>
[src]
fn on_magenta(self) -> StyledObject<D>
[src]
fn on_dark_magenta(self) -> StyledObject<D>
[src]
fn on_cyan(self) -> StyledObject<D>
[src]
fn on_dark_cyan(self) -> StyledObject<D>
[src]
fn on_white(self) -> StyledObject<D>
[src]
fn on_grey(self) -> StyledObject<D>
[src]
impl<D: Display + Clone> Styler<D> for StyledObject<D>
[src]
fn reset(self) -> StyledObject<D>
[src]
fn bold(self) -> StyledObject<D>
[src]
fn underlined(self) -> StyledObject<D>
[src]
fn reverse(self) -> StyledObject<D>
[src]
fn dim(self) -> StyledObject<D>
[src]
fn italic(self) -> StyledObject<D>
[src]
fn negative(self) -> StyledObject<D>
[src]
fn slow_blink(self) -> StyledObject<D>
[src]
fn rapid_blink(self) -> StyledObject<D>
[src]
[src]
fn crossed_out(self) -> StyledObject<D>
[src]
impl<D: Clone + Display> Clone for StyledObject<D>
[src]
fn clone(&self) -> StyledObject<D>
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl<D: Display + Clone> Display for StyledObject<D>
[src]
Auto Trait Implementations
impl<D> Send for StyledObject<D> where
D: Send,
D: Send,
impl<D> Sync for StyledObject<D> where
D: Sync,
D: Sync,
impl<D> Unpin for StyledObject<D> where
D: Unpin,
D: Unpin,
impl<D> UnwindSafe for StyledObject<D> where
D: UnwindSafe,
D: UnwindSafe,
impl<D> RefUnwindSafe for StyledObject<D> where
D: RefUnwindSafe,
D: RefUnwindSafe,
Blanket Implementations
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From<T> for T
[src]
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>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
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> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,