#[non_exhaustive]pub struct Usage {
pub line: &'static str,
pub help_flag: bool,
}Expand description
The usage line of a command and whether it has a help flag, to remind the user of both after an argument error, as Clap does.
The GetArgs derive generates one as the USAGE constant of the struct, built at compile
time without allocation. Its Display shows the usage line alone, e.g.
Usage: copy [OPTIONS] <INPUT>. Pass it to Error::with_usage to show it after an error.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.line: &'static strThe usage line, starting with Usage: and without a trailing newline.
help_flag: boolWhether the command has a help flag, which the hint after the usage line refers to.
Implementations§
Trait Implementations§
impl Copy for Usage
impl Eq for Usage
impl StructuralPartialEq for Usage
Auto Trait Implementations§
impl Forget for Usage
impl Freeze for Usage
impl Move for Usage
impl RefUnwindSafe for Usage
impl Send for Usage
impl Sync for Usage
impl Unpin for Usage
impl UnsafeUnpin for Usage
impl UnwindSafe for Usage
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