Skip to main content

InputChain

Struct InputChain 

Source
pub struct InputChain<T> { /* private fields */ }

Implementations§

Source§

impl<T: Clone + Send + Sync + 'static> InputChain<T>

Source

pub fn new() -> Self

Source

pub fn try_source<C: InputCollector<T> + 'static>(self, source: C) -> Self

Source

pub fn try_source_with_kind<C: InputCollector<T> + 'static>( self, source: C, kind: InputSourceKind, ) -> Self

Source

pub fn validate<F>(self, f: F, error_msg: impl Into<String>) -> Self
where F: Fn(&T) -> bool + Send + Sync + 'static,

Source

pub fn validate_with<F>(self, f: F) -> Self
where F: Fn(&T) -> Result<(), String> + Send + Sync + 'static,

Source

pub fn default(self, value: T) -> Self

Source

pub fn resolve(&self, matches: &ArgMatches) -> Result<T, InputError>

Source

pub fn resolve_from( &self, matches: &ArgMatches, sources: &InputSources, ) -> Result<T, InputError>

Source

pub fn resolve_with_source( &self, matches: &ArgMatches, ) -> Result<ResolvedInput<T>, InputError>

Source

pub fn resolve_from_with_source( &self, matches: &ArgMatches, sources: &InputSources, ) -> Result<ResolvedInput<T>, InputError>

Source

pub fn has_available_source(&self, matches: &ArgMatches) -> bool

Source

pub fn has_available_source_from( &self, matches: &ArgMatches, sources: &InputSources, ) -> bool

Source

pub fn source_count(&self) -> usize

Trait Implementations§

Source§

impl<T> Debug for InputChain<T>

Source§

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

Formats the value using the given formatter. Read more
Source§

impl<T: Clone + Send + Sync + 'static> Default for InputChain<T>

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

§

impl<T> !RefUnwindSafe for InputChain<T>

§

impl<T> !UnwindSafe for InputChain<T>

§

impl<T> Freeze for InputChain<T>

§

impl<T> Send for InputChain<T>
where Vec<(Box<dyn InputCollector<T>>, InputSourceKind)>: Send, Vec<(Box<dyn Fn(&T) -> Result<(), String> + Send + Sync>, String)>: Send, Option<T>: Send,

§

impl<T> Sync for InputChain<T>
where Vec<(Box<dyn InputCollector<T>>, InputSourceKind)>: Sync, Vec<(Box<dyn Fn(&T) -> Result<(), String> + Send + Sync>, String)>: Sync, Option<T>: Sync,

§

impl<T> Unpin for InputChain<T>
where Vec<(Box<dyn InputCollector<T>>, InputSourceKind)>: Unpin, Vec<(Box<dyn Fn(&T) -> Result<(), String> + Send + Sync>, String)>: Unpin, Option<T>: Unpin,

§

impl<T> UnsafeUnpin for InputChain<T>

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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

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

Source§

type Error = !

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.