Struct clap_builder::builder::StyledStr
source · pub struct StyledStr(_);
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<StyledStr> for StyledStr
impl PartialEq<StyledStr> for StyledStr
source§impl PartialOrd<StyledStr> for StyledStr
impl PartialOrd<StyledStr> 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 StructuralEq for StyledStr
impl StructuralPartialEq for StyledStr
Auto Trait Implementations§
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<I> IntoResettable<StyledStr> for Iwhere
I: Into<StyledStr>,
impl<I> IntoResettable<StyledStr> for Iwhere I: Into<StyledStr>,
source§fn into_resettable(self) -> Resettable<StyledStr>
fn into_resettable(self) -> Resettable<StyledStr>
Convert to the intended resettable type