Trait ArgumentSource

Source
pub trait ArgumentSource<V>
where V: FormatArgument,
{ // Required methods fn next_argument(&mut self) -> Option<&V>; fn lookup_argument_by_index(&self, idx: usize) -> Option<&V>; fn lookup_argument_by_name(&self, name: &str) -> Option<&V>; }
Expand description

A source of values to use when parsing the formatting string.

Required Methods§

Source

fn next_argument(&mut self) -> Option<&V>

Returns the next positional argument, if any. Calling lookup_argument_by_index does not affect which value will be returned by the next call to next_argument.

Source

fn lookup_argument_by_index(&self, idx: usize) -> Option<&V>

Returns the positional argument with the given index, if any. Calling lookup_argument_by_index does not affect which value will be returned by the next call to next_argument.

Source

fn lookup_argument_by_name(&self, name: &str) -> Option<&V>

Returns the named argument with the given name, if any.

Implementors§

Source§

impl<'p, V, P, N> ArgumentSource<V> for Parser<'p, V, P, N>