pub struct Arg {
pub name: String,
pub variadic: bool,
pub default: Option<String>,
}Expand description
One declared positional argument.
Fields§
§name: String§variadic: bool*name: collects all remaining positionals, space-joined.
default: Option<String>name='default': optional, with this value when not supplied.
Implementations§
Source§impl Arg
impl Arg
Sourcepub fn is_valid_name(&self) -> bool
pub fn is_valid_name(&self) -> bool
Whether this name can actually become the shell variable the script will read.
An argument is bound as an environment variable, so a name that is not a
valid identifier cannot ever work. Worth knowing at parse time rather
than at unbound variable time, because the shell reports the name the
script used, which is spelled correctly, and says nothing about the
declaration that is actually wrong.
Trait Implementations§
impl Eq for Arg
impl StructuralPartialEq for Arg
Auto Trait Implementations§
impl Freeze for Arg
impl RefUnwindSafe for Arg
impl Send for Arg
impl Sync for Arg
impl Unpin for Arg
impl UnsafeUnpin for Arg
impl UnwindSafe for Arg
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