pub struct Styles { /* private fields */ }
Expand description
Terminal styling definitions
See also [Command::styles
][crate::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
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Layout§
Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...)
attributes. Please see the Rust Reference's “Type Layout” chapter for details on type layout guarantees.
Size: 98 bytes