Struct MapValueParser
pub struct MapValueParser<P, F> { /* private fields */ }
Adapt a TypedValueParser from one value to another
Trait Implementations
impl<P, F, T> TypedValueParser for MapValueParser<P, F>
where
P: TypedValueParser,
P::Value: Send + Sync + Clone,
F: Fn(P::Value) -> T + Clone + Send + Sync + 'static,
T: Send + Sync + Clone,
type Value = T;fn parse_ref(&self, cmd: &Command, arg: Option<&Arg>, value: &OsStr) -> Result<Self::Value, Error>fn parse(&self, cmd: &Command, arg: Option<&Arg>, value: OsString) -> Result<Self::Value, Error>fn possible_values(&self) -> Option<Box<dyn Iterator<Item = PossibleValue> + '_>>
impl<P: Clone, F: Clone> Clone for MapValueParser<P, F>
fn clone(&self) -> MapValueParser<P, F>
impl<P: Debug, F: Debug> Debug for MapValueParser<P, F>
fn fmt(&self, f: &mut Formatter<'_>) -> Result
Auto Trait Implementations
impl<P, F> Freeze for MapValueParser<P, F>
where
P: Freeze,
F: Freeze,
impl<P, F> RefUnwindSafe for MapValueParser<P, F>
where
P: RefUnwindSafe,
F: RefUnwindSafe,
impl<P, F> Send for MapValueParser<P, F>
where
P: Send,
F: Send,
impl<P, F> Sync for MapValueParser<P, F>
where
P: Sync,
F: Sync,
impl<P, F> Unpin for MapValueParser<P, F>
where
P: Unpin,
F: Unpin,
impl<P, F> UnsafeUnpin for MapValueParser<P, F>
where
P: UnsafeUnpin,
F: UnsafeUnpin,
impl<P, F> UnwindSafe for MapValueParser<P, F>
where
P: UnwindSafe,
F: UnwindSafe,
Blanket Implementations
impl<I> IntoResettable<ValueParser> for MapValueParser<P, F>
where
I: Into<ValueParser>,
fn into_resettable(self) -> Resettable<ValueParser>
impl<T> Any for MapValueParser<P, F>
where
T: 'static + ?Sized,
fn type_id(&self) -> TypeId
impl<T> Borrow<T> for MapValueParser<P, F>
where
T: ?Sized,
fn borrow(&self) -> &T
impl<T> BorrowMut<T> for MapValueParser<P, F>
where
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
impl<T> CloneToUninit for MapValueParser<P, F>
where
T: Clone,
unsafe fn clone_to_uninit(&self, dest: *mut u8)
impl<T> From<T> for MapValueParser<P, F>
fn from(t: T) -> TReturns the argument unchanged.
impl<T> ToOwned for MapValueParser<P, F>
where
T: Clone,
type Owned = T;fn to_owned(&self) -> Tfn clone_into(&self, target: &mut T)
impl<T, U> Into<U> for MapValueParser<P, F>
where
U: From<T>,
fn into(self) -> UCalls
U::from(self).That is, this conversion is whatever the implementation of
[From]<T> for Uchooses to do.
impl<T, U> TryFrom<U> for MapValueParser<P, F>
where
U: Into<T>,
type Error = Infallible;fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
impl<T, U> TryInto<U> for MapValueParser<P, F>
where
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error;fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>