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<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