Struct Styles
struct Styles { ... }
Terminal styling definitions
See also [Command::styles][crate::Command::styles].
Example
clap v3 styling
# use clap_builder as clap;
# use *;
let styles = styled
.header
.usage
.literal
.placeholder;
Implementations
impl Styles
const fn get_header(self: &Self) -> &StyleGeneral Heading style, e.g. [
help_heading][crate::Arg::help_heading]const fn get_error(self: &Self) -> &StyleError heading
const fn get_usage(self: &Self) -> &StyleUsage heading
const fn get_literal(self: &Self) -> &StyleLiteral command-line syntax, e.g.
--helpconst fn get_placeholder(self: &Self) -> &StyleDescriptions within command-line syntax, e.g. [
value_name][crate::Arg::value_name]const fn get_valid(self: &Self) -> &StyleHighlight suggested usage
const fn get_invalid(self: &Self) -> &StyleHighlight invalid usage
impl Styles
const fn plain() -> SelfNo terminal styling
const fn styled() -> SelfDefault terminal styling
const fn header(self: Self, style: Style) -> SelfGeneral Heading style, e.g. [
help_heading][crate::Arg::help_heading]const fn error(self: Self, style: Style) -> SelfError heading
const fn usage(self: Self, style: Style) -> SelfUsage heading
const fn literal(self: Self, style: Style) -> SelfLiteral command-line syntax, e.g.
--helpconst fn placeholder(self: Self, style: Style) -> SelfDescriptions within command-line syntax, e.g. [
value_name][crate::Arg::value_name]const fn valid(self: Self, style: Style) -> SelfHighlight suggested usage
const fn invalid(self: Self, style: Style) -> SelfHighlight invalid usage
impl Clone for Styles
fn clone(self: &Self) -> Styles
impl Debug for Styles
fn fmt(self: &Self, f: &mut $crate::fmt::Formatter<'_>) -> $crate::fmt::Result
impl Default for Styles
fn default() -> Self
impl Freeze for Styles
impl RefUnwindSafe for Styles
impl Send for Styles
impl Sync for Styles
impl Unpin for Styles
impl UnwindSafe for Styles
impl<T> Any for Styles
fn type_id(self: &Self) -> TypeId
impl<T> Borrow for Styles
fn borrow(self: &Self) -> &T
impl<T> BorrowMut for Styles
fn borrow_mut(self: &mut Self) -> &mut T
impl<T> CloneToUninit for Styles
unsafe fn clone_to_uninit(self: &Self, dest: *mut u8)
impl<T> From for Styles
fn from(t: T) -> TReturns the argument unchanged.
impl<T> ToOwned for Styles
fn to_owned(self: &Self) -> Tfn clone_into(self: &Self, target: &mut T)
impl<T, U> Into for Styles
fn into(self: Self) -> UCalls
U::from(self).That is, this conversion is whatever the implementation of
[From]<T> for Uchooses to do.
impl<T, U> TryFrom for Styles
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
impl<T, U> TryInto for Styles
fn try_into(self: Self) -> Result<U, <U as TryFrom<T>>::Error>