Skip to main content

Global

Struct Global 

Source
pub struct Global {
    pub id: &'static str,
    pub name: &'static str,
    pub summary: &'static str,
    pub description: &'static str,
}
Expand description

One global flag, as the first screen prints it and as a verb page prints it.

The summary and the description are declared together, at the flag, which is what #321 clause 5 asks of a short form: a summary written a second time somewhere else is the second copy of a description that #257 was filed about. The table is here rather than in headwater-verbs, where headwater_verbs::Verb declares the same pair for a verb, because HW-DR-0033 rules that a flag belongs to the verb that reads it and that its description is written at the declaration of that flag. A global flag is declared in this file, so its summary is too.

HW-DR-0042 holds summary to one line of the first screen, and engine/crates/cli/tests/help.rs is what holds it.

Fields§

§id: &'static str

The identifier clap knows the argument by.

The entry is bound to the flag by this rather than by a name that resembles it, so a flag that arrives with no entry is reported against the identifier a reader of the parser will recognize.

§name: &'static str

The flag as the first screen names it: every spelling, and any value.

§summary: &'static str

One line of the first screen, for a reader who is choosing a verb.

§description: &'static str

The whole of it, which is what clap carries onto every verb page.

Implementations§

Source§

impl Global

Source

pub fn covers(&self, id: &str) -> bool

Whether this entry is the entry of the argument clap calls id.

Trait Implementations§

Source§

impl Debug for Global

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.