Trait ArgGetter

Source
pub trait ArgGetter<T> {
    // Required method
    fn get_arg(self, s: &str) -> Option<T>;
}
Expand description

Represents something capable of turning a &str in the value type of your choice. Implement this to use with ArgParseResults::get_with

§Note

An implementation is provided for all closures of type F: FnOnce(&str) -> Option<T>

Required Methods§

Source

fn get_arg(self, s: &str) -> Option<T>

This is the key function that converts from a string to the required value tpe

Implementors§

Source§

impl<T, F: FnOnce(&str) -> Option<T>> ArgGetter<T> for F