Struct ConvertString

Source
pub struct ConvertString<A, F>
where A: Arg,
{ /* private fields */ }

Trait Implementations§

Source§

impl<A, F, T, E> Arg for ConvertString<A, F>
where A: Arg<Item = String>, F: FnOnce(&str) -> Result<T, E>, E: Display + Debug,

Source§

type Item = T

Source§

type Error = ConvertStringError<<A as Arg>::Error, E>

Source§

fn update_switches<S: Switches>(&self, switches: &mut S)

Source§

fn name(&self) -> String

Source§

fn get(self, matches: &Matches) -> Result<Self::Item, Self::Error>

Source§

fn validate(&self) -> Result<(), Invalid>

Source§

fn parse_specified_ignoring_validation<I>( self, program_name: String, args: I, ) -> ParseResult<Self::Item, Self::Error>
where I: IntoIterator, I::Item: AsRef<OsStr>,

Source§

fn parse_specified<I>( self, program_name: String, args: I, ) -> ParseResult<Self::Item, Self::Error>
where I: IntoIterator, I::Item: AsRef<OsStr>,

Source§

fn parse_env(self) -> ParseResult<Self::Item, Self::Error>

Source§

fn with_help(self, help_flag: Flag) -> WithHelp<Self>

Source§

fn with_help_default(self) -> WithHelp<Self>

Source§

fn option_map<F, T, U>(self, f: F) -> OptionMap<Self, F>
where F: FnOnce(T) -> U,

Source§

fn with_default<T>(self, default_value: T) -> WithDefault<Self, T>

Source§

fn with_default_lazy<F>(self, default_value_f: F) -> WithDefaultLazy<Self, F>

Source§

fn choice<O>(self, other: O) -> Choice<Self, O>
where O: Arg<Item = Self::Item>,

Source§

fn both<O>(self, other: O) -> Both<Self, O>
where O: Arg,

Source§

fn map<F, U>(self, f: F) -> Map<Self, F>
where F: FnOnce(Self::Item) -> U,

Source§

fn required(self) -> Required<Self>

Source§

fn convert_string<F, T, E>(self, f: F) -> ConvertString<Self, F>
where F: FnOnce(&str) -> Result<T, E>,

Source§

fn option_convert_string<F, T, E>(self, f: F) -> OptionConvertString<Self, F>
where F: FnOnce(&str) -> Result<T, E>,

Source§

fn vec_convert_string<F, T, E>(self, f: F) -> VecConvertString<Self, F>
where F: FnMut(&str) -> Result<T, E>,

Source§

fn vec_singleton(self) -> VecSingleton<Self>

Source§

fn depend<O>(self, other: O) -> Depend<Self, O>
where O: Arg,

Source§

fn some_if<T>(self, t: T) -> SomeIf<Self, T>

Auto Trait Implementations§

§

impl<A, F> Freeze for ConvertString<A, F>
where A: Freeze, F: Freeze,

§

impl<A, F> RefUnwindSafe for ConvertString<A, F>

§

impl<A, F> Send for ConvertString<A, F>
where A: Send, F: Send,

§

impl<A, F> Sync for ConvertString<A, F>
where A: Sync, F: Sync,

§

impl<A, F> Unpin for ConvertString<A, F>
where A: Unpin, F: Unpin,

§

impl<A, F> UnwindSafe for ConvertString<A, F>
where A: UnwindSafe, F: UnwindSafe,

Blanket Implementations§

Source§

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

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

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

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

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

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

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

Performs the conversion.