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 PartialEq for StyledStr
impl PartialEq for StyledStr
source§impl PartialOrd for StyledStr
impl PartialOrd for StyledStr
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moresource§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§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
)source§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