pub trait InputCollector<T>: Send + Sync {
// Required methods
fn name(&self) -> &'static str;
fn is_available(&self, matches: &ArgMatches) -> bool;
fn collect(&self, matches: &ArgMatches) -> Result<Option<T>, InputError>;
// Provided methods
fn bind_sources(
&self,
_sources: &InputSources,
) -> Option<Box<dyn InputCollector<T>>> { ... }
fn validate(&self, _value: &T) -> Result<(), String> { ... }
fn can_retry(&self) -> bool { ... }
}Required Methods§
fn name(&self) -> &'static str
fn is_available(&self, matches: &ArgMatches) -> bool
fn collect(&self, matches: &ArgMatches) -> Result<Option<T>, InputError>
Provided Methods§
fn bind_sources( &self, _sources: &InputSources, ) -> Option<Box<dyn InputCollector<T>>>
fn validate(&self, _value: &T) -> Result<(), String>
fn can_retry(&self) -> bool
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".