Struct StyledObject
pub struct StyledObject<D> { /* private fields */ }
A formatting wrapper that can be styled for a terminal.
Implementations
impl<D> StyledObject<D>
fn force_styling(self, value: bool) -> StyledObject<D>Forces styling on or off.
This overrides the automatic detection.
fn for_stderr(self) -> StyledObject<D>Specifies that style is applying to something being written on stderr
const fn for_stdout(self) -> StyledObject<D>Specifies that style is applying to something being written on stdout
This is the default
const fn fg(self, color: Color) -> StyledObject<D>Sets a foreground color.
const fn bg(self, color: Color) -> StyledObject<D>Sets a background color.
const fn attr(self, attr: Attribute) -> StyledObject<D>Adds a attr.
const fn black(self) -> StyledObject<D>const fn red(self) -> StyledObject<D>const fn green(self) -> StyledObject<D>const fn yellow(self) -> StyledObject<D>const fn blue(self) -> StyledObject<D>const fn magenta(self) -> StyledObject<D>const fn cyan(self) -> StyledObject<D>const fn white(self) -> StyledObject<D>const fn color256(self, color: u8) -> StyledObject<D>const fn true_color(self, r: u8, g: u8, b: u8) -> StyledObject<D>const fn bright(self) -> StyledObject<D>const fn on_black(self) -> StyledObject<D>const fn on_red(self) -> StyledObject<D>const fn on_green(self) -> StyledObject<D>const fn on_yellow(self) -> StyledObject<D>const fn on_blue(self) -> StyledObject<D>const fn on_magenta(self) -> StyledObject<D>const fn on_cyan(self) -> StyledObject<D>const fn on_white(self) -> StyledObject<D>const fn on_color256(self, color: u8) -> StyledObject<D>const fn on_true_color(self, r: u8, g: u8, b: u8) -> StyledObject<D>const fn on_bright(self) -> StyledObject<D>const fn bold(self) -> StyledObject<D>const fn dim(self) -> StyledObject<D>const fn italic(self) -> StyledObject<D>const fn underlined(self) -> StyledObject<D>const fn blink(self) -> StyledObject<D>const fn blink_fast(self) -> StyledObject<D>const fn reverse(self) -> StyledObject<D>const fn strikethrough(self) -> StyledObject<D>
Trait Implementations
impl<D: Binary> Binary for StyledObject<D>
fn fmt(&self, f: &mut Formatter<'_>) -> Result
impl<D: Clone> Clone for StyledObject<D>
fn clone(&self) -> Self
impl<D: Debug> Debug for StyledObject<D>
fn fmt(&self, f: &mut Formatter<'_>) -> Result
impl<D: Display> Display for StyledObject<D>
fn fmt(&self, f: &mut Formatter<'_>) -> Result
impl<D: LowerExp> LowerExp for StyledObject<D>
fn fmt(&self, f: &mut Formatter<'_>) -> Result
impl<D: LowerHex> LowerHex for StyledObject<D>
fn fmt(&self, f: &mut Formatter<'_>) -> Result
impl<D: Octal> Octal for StyledObject<D>
fn fmt(&self, f: &mut Formatter<'_>) -> Result
impl<D: Pointer> Pointer for StyledObject<D>
fn fmt(&self, f: &mut Formatter<'_>) -> Result
impl<D: UpperExp> UpperExp for StyledObject<D>
fn fmt(&self, f: &mut Formatter<'_>) -> Result
impl<D: UpperHex> UpperHex for StyledObject<D>
fn fmt(&self, f: &mut Formatter<'_>) -> Result
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> UnsafeUnpin for StyledObject<D>
where
D: UnsafeUnpin,
impl<D> UnwindSafe for StyledObject<D>
where
D: UnwindSafe,
Blanket Implementations
impl<T> Any for StyledObject<D>
where
T: 'static + ?Sized,
fn type_id(&self) -> TypeId
impl<T> Borrow<T> for StyledObject<D>
where
T: ?Sized,
fn borrow(&self) -> &T
impl<T> BorrowMut<T> for StyledObject<D>
where
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
impl<T> CloneToUninit for StyledObject<D>
where
T: Clone,
unsafe fn clone_to_uninit(&self, dest: *mut u8)
impl<T> From<T> for StyledObject<D>
fn from(t: T) -> TReturns the argument unchanged.
impl<T> ToOwned for StyledObject<D>
where
T: Clone,
type Owned = T;fn to_owned(&self) -> Tfn clone_into(&self, target: &mut T)
impl<T> ToString for StyledObject<D>
where
T: Display + ?Sized,
fn to_string(&self) -> String
impl<T, U> Into<U> for StyledObject<D>
where
U: From<T>,
fn into(self) -> UCalls
U::from(self).That is, this conversion is whatever the implementation of
[From]<T> for Uchooses to do.
impl<T, U> TryFrom<U> for StyledObject<D>
where
U: Into<T>,
type Error = never;fn try_from(value: U) -> Result<T, never>
impl<T, U> TryInto<U> for StyledObject<D>
where
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error;fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>