Trait arg_combinators::ArgOption [−][src]
pub trait ArgOption: Arg { type OptionItem; fn option_map<U, F>(self, f: F) -> OptionMap<Self, F>
where
F: Fn(Self::OptionItem) -> U,
Self: Sized, { ... } fn option_try_map<U, E, F>(self, f: F) -> OptionTryMap<Self, F>
where
E: Debug,
F: Fn(Self::OptionItem) -> Result<U, E>,
Self: Sized, { ... } fn option_join<B>(self, b: B) -> OptionJoin<Self, B>
where
B: ArgOption,
Self: Sized, { ... } fn either<B>(self, b: B) -> EitherCombinator<Self, B>
where
B: ArgOption,
Self: Sized, { ... } fn either_homogeneous<B>(self, b: B) -> EitherHomogeneous<Self, B>
where
B: ArgOption<OptionItem = Self::OptionItem>,
Self: Sized, { ... } fn with_default(
self,
default: Self::OptionItem
) -> WithDefault<Self, Self::OptionItem>
where
Self: Sized, { ... } fn required(self) -> Required<Self>
where
Self: Sized, { ... } fn option_convert<F, U, E>(self, f: F) -> OptConvert<Self, F>
where
E: Debug + Display,
F: Fn(Self::OptionItem) -> Result<U, E>,
Self: Sized,
Self::OptionItem: Clone + Debug, { ... } fn otherwise<B>(self, b: B) -> Otherwise<Self, B>
where
B: Arg,
Self: Sized, { ... } }
Associated Types
type OptionItem
Provided Methods
fn option_map<U, F>(self, f: F) -> OptionMap<Self, F> where
F: Fn(Self::OptionItem) -> U,
Self: Sized,
F: Fn(Self::OptionItem) -> U,
Self: Sized,
fn option_try_map<U, E, F>(self, f: F) -> OptionTryMap<Self, F> where
E: Debug,
F: Fn(Self::OptionItem) -> Result<U, E>,
Self: Sized,
E: Debug,
F: Fn(Self::OptionItem) -> Result<U, E>,
Self: Sized,
fn option_join<B>(self, b: B) -> OptionJoin<Self, B> where
B: ArgOption,
Self: Sized,
B: ArgOption,
Self: Sized,
fn either<B>(self, b: B) -> EitherCombinator<Self, B> where
B: ArgOption,
Self: Sized,
B: ArgOption,
Self: Sized,
fn either_homogeneous<B>(self, b: B) -> EitherHomogeneous<Self, B> where
B: ArgOption<OptionItem = Self::OptionItem>,
Self: Sized,
B: ArgOption<OptionItem = Self::OptionItem>,
Self: Sized,
fn with_default(
self,
default: Self::OptionItem
) -> WithDefault<Self, Self::OptionItem> where
Self: Sized,
self,
default: Self::OptionItem
) -> WithDefault<Self, Self::OptionItem> where
Self: Sized,
fn required(self) -> Required<Self> where
Self: Sized,
Self: Sized,
fn option_convert<F, U, E>(self, f: F) -> OptConvert<Self, F> where
E: Debug + Display,
F: Fn(Self::OptionItem) -> Result<U, E>,
Self: Sized,
Self::OptionItem: Clone + Debug,
E: Debug + Display,
F: Fn(Self::OptionItem) -> Result<U, E>,
Self: Sized,
Self::OptionItem: Clone + Debug,
fn otherwise<B>(self, b: B) -> Otherwise<Self, B> where
B: Arg,
Self: Sized,
B: Arg,
Self: Sized,
Implementors
impl<T, P: ?Sized> ArgOption for P where
P: Arg<Item = Option<T>>, type OptionItem = T;