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) -> Styles
pub const fn header(self, style: Style) -> Styles
General Heading style, e.g. help_heading
sourcepub const fn placeholder(self, style: Style) -> Styles
pub const fn placeholder(self, style: Style) -> Styles
Descriptions within command-line syntax, e.g. value_name
source§impl Styles
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 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