pub struct StyledStr(/* private fields */);
Expand description
Terminal-styling container
Styling may be encoded as ANSI Escape Code
§Examples
// `cstr!` converts tags to ANSI codes
let after_help: &'static str = color_print::cstr!(
r#"<bold><underline>Examples</underline></bold>
<dim>$</dim> <bold>mybin --input file.toml</bold>
"#);
let cmd = clap::Command::new("mybin")
.after_help(after_help) // The `&str` gets converted into a `StyledStr`
// ...
Implementations§
Trait Implementations§
Source§impl IntoResettable<StyledStr> for Option<&'static str>
impl IntoResettable<StyledStr> for Option<&'static str>
Source§fn into_resettable(self) -> Resettable<StyledStr>
fn into_resettable(self) -> Resettable<StyledStr>
Convert to the intended resettable type
Source§impl Ord for StyledStr
impl Ord for StyledStr
Source§impl PartialOrd for StyledStr
impl PartialOrd for StyledStr
Source§impl Write for StyledStr
impl Write for StyledStr
impl Eq for StyledStr
impl StructuralPartialEq for StyledStr
Auto Trait Implementations§
impl Freeze for StyledStr
impl RefUnwindSafe for StyledStr
impl Send for StyledStr
impl Sync for StyledStr
impl Unpin for StyledStr
impl UnwindSafe for StyledStr
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§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§impl<I> IntoResettable<StyledStr> for I
impl<I> IntoResettable<StyledStr> for I
Source§fn into_resettable(self) -> Resettable<StyledStr>
fn into_resettable(self) -> Resettable<StyledStr>
Convert to the intended resettable type