Getter

Trait Getter 

Source
pub trait Getter<'a, R>: Sized
where R: PartialEq + Debug + Display,
{ type Iter: Iterator<Item = R>; // Required methods fn value<S>(&self, s: S, f: Filter) -> Option<R> where S: AsRef<str>; fn values<S>(&self, s: S, f: Filter) -> Option<Self::Iter> where S: AsRef<str>; // Provided methods fn local_value<S>(&self, s: S, f: Filter) -> Option<PathBuf> where S: AsRef<str> { ... } fn bool_flag<S>(&self, s: S, f: Filter) -> bool where S: AsRef<str> { ... } fn sub<S>(&self, _: S, _: Filter) -> bool where S: AsRef<str> { ... } fn wrap<R2, F>(self, f: F) -> Wrapper<Self, F, R> where F: Fn(R) -> R2 { ... } fn hold<B, RB>(self, b: B) -> Holder<'a, Self, B, R, RB> where B: Getter<'a, RB>, R: From<RB>, RB: PartialEq + Debug + Display, <B as Getter<'a, RB>>::Iter: Iterator<Item = RB> { ... } fn grab(&'a self) -> Grabber<'a, Self, R, Self::Iter> { ... } fn grab_local(&'a self) -> LocalGrabber<'a, Self, R, Self::Iter> { ... } fn grab_multi(&'a self) -> MultiGrabber<'a, Self, R> { ... } }

Required Associated Types§

Source

type Iter: Iterator<Item = R>

Required Methods§

Source

fn value<S>(&self, s: S, f: Filter) -> Option<R>
where S: AsRef<str>,

Source

fn values<S>(&self, s: S, f: Filter) -> Option<Self::Iter>
where S: AsRef<str>,

Provided Methods§

Source

fn local_value<S>(&self, s: S, f: Filter) -> Option<PathBuf>
where S: AsRef<str>,

Source

fn bool_flag<S>(&self, s: S, f: Filter) -> bool
where S: AsRef<str>,

Source

fn sub<S>(&self, _: S, _: Filter) -> bool
where S: AsRef<str>,

Source

fn wrap<R2, F>(self, f: F) -> Wrapper<Self, F, R>
where F: Fn(R) -> R2,

Source

fn hold<B, RB>(self, b: B) -> Holder<'a, Self, B, R, RB>
where B: Getter<'a, RB>, R: From<RB>, RB: PartialEq + Debug + Display, <B as Getter<'a, RB>>::Iter: Iterator<Item = RB>,

Source

fn grab(&'a self) -> Grabber<'a, Self, R, Self::Iter>

Source

fn grab_local(&'a self) -> LocalGrabber<'a, Self, R, Self::Iter>

Source

fn grab_multi(&'a self) -> MultiGrabber<'a, Self, R>

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl<'a> Getter<'a, &'a Value> for &'a Value

Source§

type Iter = Iter<'a, Value>

Source§

fn bool_flag<S>(&self, s: S, f: Filter) -> bool
where S: AsRef<str>,

Source§

fn value<S>(&self, s: S, f: Filter) -> Option<&'a Value>
where S: AsRef<str>,

Source§

fn values<S>(&self, s: S, f: Filter) -> Option<Iter<'a, Value>>
where S: AsRef<str>,

Source§

impl<'a> Getter<'a, String> for Value

Source§

type Iter = IntoIter<String>

Source§

fn bool_flag<S>(&self, s: S, f: Filter) -> bool
where S: AsRef<str>,

Source§

fn value<S>(&self, s: S, f: Filter) -> Option<String>
where S: AsRef<str>,

Source§

fn values<S>(&self, s: S, f: Filter) -> Option<IntoIter<String>>
where S: AsRef<str>,

Implementors§

Source§

impl<'a> Getter<'a, String> for Enver

Source§

impl<'a, 'b> Getter<'a, &'a str> for &'a ArgMatches<'b>

Source§

type Iter = Values<'a>

Source§

impl<'a, A, RA, B, RB> Getter<'a, RA> for Holder<'a, A, B, RA, RB>
where A: Getter<'a, RA>, B: Getter<'a, RB>, <A as Getter<'a, RA>>::Iter: Iterator<Item = RA>, <B as Getter<'a, RB>>::Iter: Iterator<Item = RB>, RA: PartialEq + Debug + Display + From<RB>, RB: PartialEq + Debug + Display,

Source§

type Iter = OrIter<<A as Getter<'a, RA>>::Iter, <B as Getter<'a, RB>>::Iter>

Source§

impl<'a, G, R, F, CR> Getter<'a, R> for Wrapper<G, F, CR>
where G: Getter<'a, CR>, F: Fn(CR) -> R + Clone, CR: PartialEq + Debug + Display, R: PartialEq + Debug + Display,

Source§

type Iter = ConvIter<<G as Getter<'a, CR>>::Iter, F>

Source§

impl<'a, R, G> Getter<'a, R> for Localizer<G>
where R: PartialEq + Debug + Display, G: Getter<'a, R>,

Source§

type Iter = <G as Getter<'a, R>>::Iter