pub struct ParsableValueArgument<V> { /* private fields */ }
Expand description
Structure which defines how given argument should be handled. Allows for automatic parsing and validation. Mutable borrow to parsable argument definition has to be registered in ArgumentList. Because of that registered arguments cannot be used while those borrows exist. Either ArgumentList instance has to be dropped or there are no further usages of it. This method of defining arguments is preferred as oposed to using the legacy API.
Implementations§
source§impl<V> ParsableValueArgument<V>
impl<V> ParsableValueArgument<V>
source§impl ParsableValueArgument<i64>
impl ParsableValueArgument<i64>
sourcepub fn new_integer(
identification: ArgumentIdentification
) -> ParsableValueArgument<i64>
pub fn new_integer( identification: ArgumentIdentification ) -> ParsableValueArgument<i64>
Default integer type argument value handler. Checks whether value contains only digits or starts with minus sign.
source§impl ParsableValueArgument<String>
impl ParsableValueArgument<String>
sourcepub fn new_string(
identification: ArgumentIdentification
) -> ParsableValueArgument<String>
pub fn new_string( identification: ArgumentIdentification ) -> ParsableValueArgument<String>
Default string type argument value handler.
Trait Implementations§
source§impl<'a, V> HandleableArgument<'a> for ParsableValueArgument<V>
impl<'a, V> HandleableArgument<'a> for ParsableValueArgument<V>
source§fn handle(
&mut self,
input_iter: &mut Peekable<&mut Iter<'_, String>>
) -> Result<(), String>
fn handle( &mut self, input_iter: &mut Peekable<&mut Iter<'_, String>> ) -> Result<(), String>
Handles argument. Gets all needed values from input iterator.
source§fn is_by_short(&self, name: char) -> bool
fn is_by_short(&self, name: char) -> bool
Check if this argument is identified by specified short name.
source§fn is_by_long(&self, name: &str) -> bool
fn is_by_long(&self, name: &str) -> bool
Check if this argument is identified by specified long name.
source§fn identification(&self) -> &ArgumentIdentification
fn identification(&self) -> &ArgumentIdentification
Get this arguments identification.
Auto Trait Implementations§
impl<V> !RefUnwindSafe for ParsableValueArgument<V>
impl<V> !Send for ParsableValueArgument<V>
impl<V> !Sync for ParsableValueArgument<V>
impl<V> Unpin for ParsableValueArgument<V>where V: Unpin,
impl<V> !UnwindSafe for ParsableValueArgument<V>
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