[−][src]Struct simon::ext::ArgExt
Methods
impl<A> ArgExt<A> where
A: Arg,
[src]
A: Arg,
pub fn parse<I>(
&self,
args: I
) -> (Result<A::Item, TopLevelError<A::Error>>, Usage) where
I: IntoIterator,
I::Item: AsRef<OsStr>,
[src]
&self,
args: I
) -> (Result<A::Item, TopLevelError<A::Error>>, Usage) where
I: IntoIterator,
I::Item: AsRef<OsStr>,
pub fn parse_env(
&self,
program_name: ProgramName
) -> (Result<A::Item, TopLevelError<A::Error>>, UsageWithProgramName)
[src]
&self,
program_name: ProgramName
) -> (Result<A::Item, TopLevelError<A::Error>>, UsageWithProgramName)
pub fn parse_env_default(
&self
) -> (Result<A::Item, TopLevelError<A::Error>>, UsageWithProgramName)
[src]
&self
) -> (Result<A::Item, TopLevelError<A::Error>>, UsageWithProgramName)
pub fn just_parse<I>(&self, args: I) -> Result<A::Item, TopLevelError<A::Error>> where
I: IntoIterator,
I::Item: AsRef<OsStr>,
[src]
I: IntoIterator,
I::Item: AsRef<OsStr>,
pub fn just_parse_env(
&self,
program_name: ProgramName
) -> Result<A::Item, TopLevelError<A::Error>>
[src]
&self,
program_name: ProgramName
) -> Result<A::Item, TopLevelError<A::Error>>
pub fn just_parse_env_default(&self) -> Result<A::Item, TopLevelError<A::Error>>
[src]
pub fn result_map<F, U, E>(self, f: F) -> ArgExt<impl Arg<Item = U, Error = E>> where
E: Debug + Display,
F: Fn(Result<A::Item, A::Error>) -> Result<U, E>,
[src]
E: Debug + Display,
F: Fn(Result<A::Item, A::Error>) -> Result<U, E>,
pub fn result_both<B>(
self,
b: B
) -> ArgExt<impl Arg<Item = (Result<A::Item, A::Error>, Result<B::Item, B::Error>), Error = Never>> where
B: Arg,
Self: Sized,
[src]
self,
b: B
) -> ArgExt<impl Arg<Item = (Result<A::Item, A::Error>, Result<B::Item, B::Error>), Error = Never>> where
B: Arg,
Self: Sized,
pub fn both<B>(
self,
b: B
) -> ArgExt<impl Arg<Item = (A::Item, B::Item), Error = BothError<A::Error, B::Error>>> where
B: Arg,
[src]
self,
b: B
) -> ArgExt<impl Arg<Item = (A::Item, B::Item), Error = BothError<A::Error, B::Error>>> where
B: Arg,
pub fn try_map<F, U, E>(
self,
f: F
) -> ArgExt<impl Arg<Item = U, Error = TryMapError<A::Error, E>>> where
E: Debug + Display,
F: Fn(A::Item) -> Result<U, E>,
[src]
self,
f: F
) -> ArgExt<impl Arg<Item = U, Error = TryMapError<A::Error, E>>> where
E: Debug + Display,
F: Fn(A::Item) -> Result<U, E>,
pub fn map<F, U>(self, f: F) -> ArgExt<impl Arg<Item = U, Error = A::Error>> where
F: Fn(A::Item) -> U,
[src]
F: Fn(A::Item) -> U,
pub fn convert<F, U, E>(
self,
f: F
) -> ArgExt<impl Arg<Item = U, Error = TryMapError<A::Error, ConvertFailed<A::Item, E>>>> where
A::Item: Clone + Debug + Display,
E: Clone + Debug + Display,
F: Fn(A::Item) -> Result<U, E>,
[src]
self,
f: F
) -> ArgExt<impl Arg<Item = U, Error = TryMapError<A::Error, ConvertFailed<A::Item, E>>>> where
A::Item: Clone + Debug + Display,
E: Clone + Debug + Display,
F: Fn(A::Item) -> Result<U, E>,
pub fn with_help(self, flag: Flag) -> ArgExt<impl Arg<Item = HelpOr<A::Item>>>
[src]
pub fn with_help_default(self) -> ArgExt<impl Arg<Item = HelpOr<A::Item>>>
[src]
pub fn rename(
self,
name: &str
) -> ArgExt<impl Arg<Item = A::Item, Error = A::Error>>
[src]
self,
name: &str
) -> ArgExt<impl Arg<Item = A::Item, Error = A::Error>>
pub fn valid(self) -> ArgExt<Valid<A>>
[src]
impl<A, B> ArgExt<A> where
A: Arg<Item = HelpOr<B>>,
[src]
A: Arg<Item = HelpOr<B>>,
pub fn parse_env_or_exit(&self, program_name: ProgramName) -> B
[src]
pub fn parse_env_default_or_exit(&self) -> B
[src]
impl<A, T> ArgExt<A> where
A: Arg<Item = Option<T>>,
[src]
A: Arg<Item = Option<T>>,
pub fn depend<B, U>(
self,
b: B
) -> ArgExt<impl Arg<Item = Option<(T, U)>, Error = DependError<A::Error, B::Error>>> where
B: Arg<Item = Option<U>>,
[src]
self,
b: B
) -> ArgExt<impl Arg<Item = Option<(T, U)>, Error = DependError<A::Error, B::Error>>> where
B: Arg<Item = Option<U>>,
pub fn otherwise<U>(self, b: U) -> ArgExt<impl Arg<Item = Either<T, U::Item>>> where
U: Arg,
[src]
U: Arg,
pub fn option_try_map<F, U, E>(
self,
f: F
) -> ArgExt<impl Arg<Item = Option<U>, Error = TryMapError<A::Error, E>>> where
E: Debug + Display,
F: Fn(T) -> Result<U, E>,
[src]
self,
f: F
) -> ArgExt<impl Arg<Item = Option<U>, Error = TryMapError<A::Error, E>>> where
E: Debug + Display,
F: Fn(T) -> Result<U, E>,
pub fn option_map<F, U>(
self,
f: F
) -> ArgExt<impl Arg<Item = Option<U>, Error = A::Error>> where
F: Fn(T) -> U,
[src]
self,
f: F
) -> ArgExt<impl Arg<Item = Option<U>, Error = A::Error>> where
F: Fn(T) -> U,
pub fn either_or_both_any<B, U>(
self,
b: B
) -> ArgExt<impl Arg<Item = Option<EitherOrBoth<T, U>>>> where
B: Arg<Item = Option<U>>,
[src]
self,
b: B
) -> ArgExt<impl Arg<Item = Option<EitherOrBoth<T, U>>>> where
B: Arg<Item = Option<U>>,
pub fn either_any<B, U>(
self,
b: B
) -> ArgExt<impl Arg<Item = Option<Either<T, U>>>> where
B: Arg<Item = Option<U>>,
[src]
self,
b: B
) -> ArgExt<impl Arg<Item = Option<Either<T, U>>>> where
B: Arg<Item = Option<U>>,
pub fn either<B>(self, b: B) -> ArgExt<impl Arg<Item = Option<T>>> where
B: Arg<Item = Option<T>>,
[src]
B: Arg<Item = Option<T>>,
pub fn with_default_lazy<F: Fn() -> T>(self, f: F) -> ArgExt<impl Arg<Item = T>>
[src]
pub fn with_default(self, t: T) -> ArgExt<impl Arg<Item = T>> where
T: Clone,
[src]
T: Clone,
pub fn required(
self
) -> ArgExt<impl Arg<Item = T, Error = TryMapError<A::Error, MissingRequiredArg>>>
[src]
self
) -> ArgExt<impl Arg<Item = T, Error = TryMapError<A::Error, MissingRequiredArg>>>
pub fn option_convert<F, U, E>(
self,
f: F
) -> ArgExt<impl Arg<Item = Option<U>, Error = TryMapError<A::Error, ConvertFailed<T, E>>>> where
T: Clone + Debug + Display,
E: Clone + Debug + Display,
F: Fn(T) -> Result<U, E>,
[src]
self,
f: F
) -> ArgExt<impl Arg<Item = Option<U>, Error = TryMapError<A::Error, ConvertFailed<T, E>>>> where
T: Clone + Debug + Display,
E: Clone + Debug + Display,
F: Fn(T) -> Result<U, E>,
impl<A> ArgExt<A> where
A: Arg<Item = bool>,
[src]
A: Arg<Item = bool>,
pub fn some_if_lazy<T, F>(self, f: F) -> ArgExt<impl Arg<Item = Option<T>>> where
F: Fn() -> T,
[src]
F: Fn() -> T,
pub fn some_if<T>(self, t: T) -> ArgExt<impl Arg<Item = Option<T>>> where
T: Clone,
[src]
T: Clone,
pub fn unit_option(self) -> ArgExt<impl Arg<Item = Option<()>>>
[src]
pub fn unless<U>(self, b: U) -> ArgExt<impl Arg<Item = Option<U::Item>>> where
U: Arg,
[src]
U: Arg,
impl<A, I> ArgExt<A> where
A: Arg<Item = I>,
I: IntoIterator,
[src]
A: Arg<Item = I>,
I: IntoIterator,
pub fn into_iter(self) -> ArgExt<impl Arg<Item = I::IntoIter>>
[src]
pub fn vec_try_map<F, U, E>(
self,
f: F
) -> ArgExt<impl Arg<Item = Vec<U>, Error = TryMapError<A::Error, E>>> where
E: Debug + Display,
F: Fn(I::Item) -> Result<U, E>,
[src]
self,
f: F
) -> ArgExt<impl Arg<Item = Vec<U>, Error = TryMapError<A::Error, E>>> where
E: Debug + Display,
F: Fn(I::Item) -> Result<U, E>,
pub fn vec_map<F, U>(
self,
f: F
) -> ArgExt<impl Arg<Item = Vec<U>, Error = A::Error>> where
F: Fn(I::Item) -> U,
[src]
self,
f: F
) -> ArgExt<impl Arg<Item = Vec<U>, Error = A::Error>> where
F: Fn(I::Item) -> U,
pub fn vec_convert<F, U, E>(
self,
f: F
) -> ArgExt<impl Arg<Item = Vec<U>, Error = TryMapError<A::Error, ConvertFailed<I::Item, E>>>> where
I::Item: Clone + Debug + Display,
E: Clone + Debug + Display,
F: Fn(I::Item) -> Result<U, E>,
[src]
self,
f: F
) -> ArgExt<impl Arg<Item = Vec<U>, Error = TryMapError<A::Error, ConvertFailed<I::Item, E>>>> where
I::Item: Clone + Debug + Display,
E: Clone + Debug + Display,
F: Fn(I::Item) -> Result<U, E>,
impl<A, I, T, E> ArgExt<A> where
E: Debug + Display,
A: Arg<Item = I>,
I: IntoIterator<Item = Result<T, E>>,
[src]
E: Debug + Display,
A: Arg<Item = I>,
I: IntoIterator<Item = Result<T, E>>,
pub fn vec_ok_or_first_err(
self
) -> ArgExt<impl Arg<Item = Vec<T>, Error = TryMapError<A::Error, E>>>
[src]
self
) -> ArgExt<impl Arg<Item = Vec<T>, Error = TryMapError<A::Error, E>>>
impl<A, I> ArgExt<A> where
A: Arg<Item = I>,
I: Iterator,
[src]
A: Arg<Item = I>,
I: Iterator,
Trait Implementations
impl<A> Arg for ArgExt<A> where
A: Arg,
[src]
A: Arg,
type Item = A::Item
type Error = A::Error
fn update_switches<S: Switches>(&self, switches: &mut S)
[src]
fn name(&self) -> String
[src]
fn get(&self, matches: &Matches) -> Result<Self::Item, Self::Error>
[src]
fn parse<I>(
&self,
args: I
) -> (Result<Self::Item, TopLevelError<Self::Error>>, Usage) where
I: IntoIterator,
I::Item: AsRef<OsStr>,
[src]
&self,
args: I
) -> (Result<Self::Item, TopLevelError<Self::Error>>, Usage) where
I: IntoIterator,
I::Item: AsRef<OsStr>,
fn validate(&self) -> Option<Invalid>
[src]
Auto Trait Implementations
Blanket Implementations
impl<A, D> Arg for D where
A: Arg,
D: Deref<Target = A>,
[src]
A: Arg,
D: Deref<Target = A>,
type Item = <A as Arg>::Item
type Error = <A as Arg>::Error
fn update_switches<S>(&Self, &mut S) where
S: Switches,
[src]
S: Switches,
fn name(&Self) -> String
[src]
fn get(&Self, &Matches) -> Result<<D as Arg>::Item, <D as Arg>::Error>
[src]
fn validate(&self) -> Option<Invalid>
[src]
fn parse<I>(
&self,
args: I
) -> (Result<Self::Item, TopLevelError<Self::Error>>, Usage) where
I: IntoIterator,
I::Item: AsRef<OsStr>,
[src]
&self,
args: I
) -> (Result<Self::Item, TopLevelError<Self::Error>>, Usage) where
I: IntoIterator,
I::Item: AsRef<OsStr>,
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From<T> for T
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,