pub struct OptRule { /* private fields */ }Expand description
A parsing rule that describes one option. This includes the following metadata:
name: internal lookup name.long: optional long form (for exampleverbose).short: optional short form (for examplev).val_count: number of following values. Zero means this is a flag.
Implementations§
Source§impl OptRule
impl OptRule
Sourcepub const fn new(name: &'static str) -> OptRule
pub const fn new(name: &'static str) -> OptRule
Creates an OptRule with name. No short or long identifier is set.
Sourcepub const fn new_auto_long(name: &'static str) -> OptRule
pub const fn new_auto_long(name: &'static str) -> OptRule
Creates an OptRule whose long identifier equals name.
Sourcepub const fn new_auto(name: &'static str) -> OptRule
pub const fn new_auto(name: &'static str) -> OptRule
Creates an OptRule with long equal to name and short set to the first character of
name.
Sourcepub const fn set_val_count(self, val_count: usize) -> OptRule
pub const fn set_val_count(self, val_count: usize) -> OptRule
Sets the number of values this option accepts.
Auto Trait Implementations§
impl Freeze for OptRule
impl RefUnwindSafe for OptRule
impl !Send for OptRule
impl !Sync for OptRule
impl Unpin for OptRule
impl UnwindSafe for OptRule
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