Struct console::StyledObject

source ·
pub struct StyledObject<D> { /* private fields */ }
Expand description

A formatting wrapper that can be styled for a terminal.

Implementations§

source§

impl<D> StyledObject<D>

source

pub fn force_styling(self, value: bool) -> StyledObject<D>

Forces styling on or off.

This overrides the automatic detection.

source

pub fn for_stderr(self) -> StyledObject<D>

Specifies that style is applying to something being written on stderr

source

pub fn for_stdout(self) -> StyledObject<D>

Specifies that style is applying to something being written on stdout

This is the default

source

pub fn fg(self, color: Color) -> StyledObject<D>

Sets a foreground color.

source

pub fn bg(self, color: Color) -> StyledObject<D>

Sets a background color.

source

pub fn attr(self, attr: Attribute) -> StyledObject<D>

Adds a attr.

source

pub fn black(self) -> StyledObject<D>

source

pub fn red(self) -> StyledObject<D>

source

pub fn green(self) -> StyledObject<D>

source

pub fn yellow(self) -> StyledObject<D>

source

pub fn blue(self) -> StyledObject<D>

source

pub fn magenta(self) -> StyledObject<D>

source

pub fn cyan(self) -> StyledObject<D>

source

pub fn white(self) -> StyledObject<D>

source

pub fn color256(self, color: u8) -> StyledObject<D>

source

pub fn bright(self) -> StyledObject<D>

source

pub fn on_black(self) -> StyledObject<D>

source

pub fn on_red(self) -> StyledObject<D>

source

pub fn on_green(self) -> StyledObject<D>

source

pub fn on_yellow(self) -> StyledObject<D>

source

pub fn on_blue(self) -> StyledObject<D>

source

pub fn on_magenta(self) -> StyledObject<D>

source

pub fn on_cyan(self) -> StyledObject<D>

source

pub fn on_white(self) -> StyledObject<D>

source

pub fn on_color256(self, color: u8) -> StyledObject<D>

source

pub fn on_bright(self) -> StyledObject<D>

source

pub fn bold(self) -> StyledObject<D>

source

pub fn dim(self) -> StyledObject<D>

source

pub fn italic(self) -> StyledObject<D>

source

pub fn underlined(self) -> StyledObject<D>

source

pub fn reverse(self) -> StyledObject<D>

source

pub fn hidden(self) -> StyledObject<D>

source

pub fn strikethrough(self) -> StyledObject<D>

Trait Implementations§

source§

impl<D: Binary> Binary for StyledObject<D>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter.
source§

impl<D: Clone> Clone for StyledObject<D>

source§

fn clone(&self) -> StyledObject<D>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<D: Debug> Debug for StyledObject<D>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<D: Display> Display for StyledObject<D>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<D: LowerExp> LowerExp for StyledObject<D>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter.
source§

impl<D: LowerHex> LowerHex for StyledObject<D>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter.
source§

impl<D: Octal> Octal for StyledObject<D>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter.
source§

impl<D: Pointer> Pointer for StyledObject<D>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter.
source§

impl<D: UpperExp> UpperExp for StyledObject<D>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter.
source§

impl<D: UpperHex> UpperHex for StyledObject<D>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter.

Auto Trait Implementations§

§

impl<D> RefUnwindSafe for StyledObject<D>
where D: RefUnwindSafe,

§

impl<D> Send for StyledObject<D>
where D: Send,

§

impl<D> Sync for StyledObject<D>
where D: Sync,

§

impl<D> Unpin for StyledObject<D>
where D: Unpin,

§

impl<D> UnwindSafe for StyledObject<D>
where D: UnwindSafe,

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

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

source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

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

fn clone_into(&self, target: &mut T)

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

impl<T> ToString for T
where T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.