pub struct Value<'a, T>where
T: Iterator,{ /* private fields */ }
Expand description
A handle for getting the value associated with a named flag.UsageError
This handle can only be used once, and is consumed.
Implementations§
Source§impl<'a, T> Value<'a, T>
impl<'a, T> Value<'a, T>
Sourcepub fn as_str(self) -> Result<&'a str, OptionError>
pub fn as_str(self) -> Result<&'a str, OptionError>
Get the associated value as a string.
Note that ownership of the string is not passed. Ownership is kept by the NamedArgument so it can be attached to error messages.
Returns an error if the user did not supply a value.
Sourcepub fn as_osstr(self) -> Result<&'a OsStr, OptionError>
pub fn as_osstr(self) -> Result<&'a OsStr, OptionError>
Get the associated value as an OsStr.
Note that ownership of the string is not passed. Ownership is kept by the NamedArgument so it can be attached to error messages.
Returns an error if the user did not supply a value.
Auto Trait Implementations§
impl<'a, T> Freeze for Value<'a, T>
impl<'a, T> RefUnwindSafe for Value<'a, T>
impl<'a, T> Send for Value<'a, T>
impl<'a, T> Sync for Value<'a, T>
impl<'a, T> Unpin for Value<'a, T>
impl<'a, T> !UnwindSafe for Value<'a, T>
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