pub struct Styles { /* private fields */ }
Expand description
Terminal styling definitions
See also Command::styles
.
§Example
clap v3 styling
let styles = Styles::styled()
.header(AnsiColor::Yellow.on_default())
.usage(AnsiColor::Green.on_default())
.literal(AnsiColor::Green.on_default())
.placeholder(AnsiColor::Green.on_default());
Implementations§
Source§impl Styles
impl Styles
Sourcepub const fn header(self, style: Style) -> Self
pub const fn header(self, style: Style) -> Self
General Heading style, e.g. help_heading
Sourcepub const fn placeholder(self, style: Style) -> Self
pub const fn placeholder(self, style: Style) -> Self
Descriptions within command-line syntax, e.g. value_name
Source§impl Styles
Reflection
impl Styles
Reflection
Sourcepub const fn get_header(&self) -> &Style
pub const fn get_header(&self) -> &Style
General Heading style, e.g. help_heading
Sourcepub const fn get_literal(&self) -> &Style
pub const fn get_literal(&self) -> &Style
Literal command-line syntax, e.g. --help
Sourcepub const fn get_placeholder(&self) -> &Style
pub const fn get_placeholder(&self) -> &Style
Descriptions within command-line syntax, e.g. value_name
Sourcepub const fn get_invalid(&self) -> &Style
pub const fn get_invalid(&self) -> &Style
Highlight invalid usage
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Styles
impl RefUnwindSafe for Styles
impl Send for Styles
impl Sync for Styles
impl Unpin for Styles
impl UnwindSafe for Styles
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