Struct TryMapValueParser

pub struct TryMapValueParser<P, F> { /* private fields */ }

Adapt a TypedValueParser from one value to another

See TypedValueParser::try_map

Trait Implementations

impl<P, F, T, E> TypedValueParser for TryMapValueParser<P, F> where P: TypedValueParser, P::Value: Send + Sync + Clone, F: Fn(P::Value) -> Result<T, E> + Clone + Send + Sync + 'static, T: Send + Sync + Clone, E: Into<Box<dyn Error + Send + Sync + 'static>>,

type Value = T;
fn parse_ref(&self, cmd: &Command, arg: Option<&Arg>, value: &OsStr) -> Result<Self::Value, Error>
fn possible_values(&self) -> Option<Box<dyn Iterator<Item = PossibleValue> + '_>>

impl<P: Clone, F: Clone> Clone for TryMapValueParser<P, F>

fn clone(&self) -> TryMapValueParser<P, F>

impl<P: Debug, F: Debug> Debug for TryMapValueParser<P, F>

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Auto Trait Implementations

impl<P, F> Freeze for TryMapValueParser<P, F> where P: Freeze, F: Freeze,

impl<P, F> RefUnwindSafe for TryMapValueParser<P, F> where P: RefUnwindSafe, F: RefUnwindSafe,

impl<P, F> Send for TryMapValueParser<P, F> where P: Send, F: Send,

impl<P, F> Sync for TryMapValueParser<P, F> where P: Sync, F: Sync,

impl<P, F> Unpin for TryMapValueParser<P, F> where P: Unpin, F: Unpin,

impl<P, F> UnsafeUnpin for TryMapValueParser<P, F> where P: UnsafeUnpin, F: UnsafeUnpin,

impl<P, F> UnwindSafe for TryMapValueParser<P, F> where P: UnwindSafe, F: UnwindSafe,

Blanket Implementations

impl<I> IntoResettable<ValueParser> for TryMapValueParser<P, F> where I: Into<ValueParser>,

fn into_resettable(self) -> Resettable<ValueParser>

impl<T> Any for TryMapValueParser<P, F> where T: 'static + ?Sized,

fn type_id(&self) -> TypeId

impl<T> Borrow<T> for TryMapValueParser<P, F> where T: ?Sized,

fn borrow(&self) -> &T

impl<T> BorrowMut<T> for TryMapValueParser<P, F> where T: ?Sized,

fn borrow_mut(&mut self) -> &mut T

impl<T> CloneToUninit for TryMapValueParser<P, F> where T: Clone,

unsafe fn clone_to_uninit(&self, dest: *mut u8)

impl<T> From<T> for TryMapValueParser<P, F>

fn from(t: T) -> T

Returns the argument unchanged.

impl<T> ToOwned for TryMapValueParser<P, F> where T: Clone,

type Owned = T;
fn to_owned(&self) -> T
fn clone_into(&self, target: &mut T)

impl<T, U> Into<U> for TryMapValueParser<P, F> where U: From<T>,

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of [From]<T> for U chooses to do.

impl<T, U> TryFrom<U> for TryMapValueParser<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 TryMapValueParser<P, F> where U: TryFrom<T>,

type Error = <U as TryFrom<T>>::Error;
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>