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>
impl<D> StyledObject<D>
sourcepub fn force_styling(self, value: bool) -> StyledObject<D>
pub fn force_styling(self, value: bool) -> StyledObject<D>
Forces styling on or off.
This overrides the automatic detection.
sourcepub fn for_stderr(self) -> StyledObject<D>
pub fn for_stderr(self) -> StyledObject<D>
Specifies that style is applying to something being written on stderr
sourcepub fn for_stdout(self) -> StyledObject<D>
pub fn for_stdout(self) -> StyledObject<D>
Specifies that style is applying to something being written on stdout
This is the default
sourcepub fn fg(self, color: Color) -> StyledObject<D>
pub fn fg(self, color: Color) -> StyledObject<D>
Sets a foreground color.
sourcepub fn bg(self, color: Color) -> StyledObject<D>
pub fn bg(self, color: Color) -> StyledObject<D>
Sets a background color.
sourcepub fn attr(self, attr: Attribute) -> StyledObject<D>
pub fn attr(self, attr: Attribute) -> StyledObject<D>
Adds a attr.
pub fn black(self) -> StyledObject<D>
pub fn red(self) -> StyledObject<D>
pub fn green(self) -> StyledObject<D>
pub fn yellow(self) -> StyledObject<D>
pub fn blue(self) -> StyledObject<D>
pub fn magenta(self) -> StyledObject<D>
pub fn cyan(self) -> StyledObject<D>
pub fn white(self) -> StyledObject<D>
pub fn color256(self, color: u8) -> StyledObject<D>
pub fn bright(self) -> StyledObject<D>
pub fn on_black(self) -> StyledObject<D>
pub fn on_red(self) -> StyledObject<D>
pub fn on_green(self) -> StyledObject<D>
pub fn on_yellow(self) -> StyledObject<D>
pub fn on_blue(self) -> StyledObject<D>
pub fn on_magenta(self) -> StyledObject<D>
pub fn on_cyan(self) -> StyledObject<D>
pub fn on_white(self) -> StyledObject<D>
pub fn on_color256(self, color: u8) -> StyledObject<D>
pub fn on_bright(self) -> StyledObject<D>
pub fn bold(self) -> StyledObject<D>
pub fn dim(self) -> StyledObject<D>
pub fn italic(self) -> StyledObject<D>
pub fn underlined(self) -> StyledObject<D>
pub fn blink(self) -> StyledObject<D>
pub fn blink_fast(self) -> StyledObject<D>
pub fn reverse(self) -> StyledObject<D>
pub fn strikethrough(self) -> StyledObject<D>
Trait Implementations§
source§impl<D: Binary> Binary for StyledObject<D>
impl<D: Binary> Binary for StyledObject<D>
source§impl<D: Clone> Clone for StyledObject<D>
impl<D: Clone> Clone for StyledObject<D>
source§fn clone(&self) -> StyledObject<D>
fn clone(&self) -> StyledObject<D>
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl<D: Debug> Debug for StyledObject<D>
impl<D: Debug> Debug for StyledObject<D>
source§impl<D: Display> Display for StyledObject<D>
impl<D: Display> Display for StyledObject<D>
source§impl<D: LowerExp> LowerExp for StyledObject<D>
impl<D: LowerExp> LowerExp for StyledObject<D>
source§impl<D: LowerHex> LowerHex for StyledObject<D>
impl<D: LowerHex> LowerHex for StyledObject<D>
source§impl<D: Octal> Octal for StyledObject<D>
impl<D: Octal> Octal for StyledObject<D>
source§impl<D: Pointer> Pointer for StyledObject<D>
impl<D: Pointer> Pointer for StyledObject<D>
source§impl<D: UpperExp> UpperExp for StyledObject<D>
impl<D: UpperExp> UpperExp for StyledObject<D>
Auto Trait Implementations§
impl<D> Freeze for StyledObject<D>where
D: Freeze,
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> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)