pub struct ArgSpec {
pub name: &'static str,
pub doc: &'static str,
pub default: Option<&'static str>,
pub example: Option<&'static str>,
}Expand description
Specification for Arg.
Fields§
§name: &'static strValue name (usually SCREAMING_SNAKE_CASE).
doc: &'static strDocumentation.
default: Option<&'static str>Default value.
example: Option<&'static str>Example value (if this is set, the argument is considered to be requried when generating the help text).
This is only used if RawArgs::metadata().help_mode is true.
Implementations§
Source§impl ArgSpec
impl ArgSpec
Sourcepub const fn new(name: &'static str) -> Self
pub const fn new(name: &'static str) -> Self
Makes an ArgSpec instance with a specified name (equivalent to noargs::arg(name)).
Sourcepub const fn doc(self, doc: &'static str) -> Self
pub const fn doc(self, doc: &'static str) -> Self
Updates the value of ArgSpec::doc.
Sourcepub const fn default(self, default: &'static str) -> Self
pub const fn default(self, default: &'static str) -> Self
Updates the value of ArgSpec::default.
Sourcepub const fn example(self, example: &'static str) -> Self
pub const fn example(self, example: &'static str) -> Self
Updates the value of ArgSpec::example.
Trait Implementations§
impl Copy for ArgSpec
impl Eq for ArgSpec
impl StructuralPartialEq for ArgSpec
Auto Trait Implementations§
impl Freeze for ArgSpec
impl RefUnwindSafe for ArgSpec
impl Send for ArgSpec
impl Sync for ArgSpec
impl Unpin for ArgSpec
impl UnwindSafe for ArgSpec
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