[][src]Trait dynfmt::FormatArgs

pub trait FormatArgs {
    fn get_index(&self, index: usize) -> Result<Option<Argument>, ()> { ... }
fn get_key(&self, key: &str) -> Result<Option<Argument>, ()> { ... } }

A container that provides access to indexed or named arguments.

Instances of this trait can be used as argument lists to format calls. A container may implement either get_index, get_key or even both.

Provided methods

fn get_index(&self, index: usize) -> Result<Option<Argument>, ()>

Returns the argument with the specified index.

Implement this method if the container supports indexed access. Return Ok(Some(...)) if the argument exists, or Ok(None) if the index is out of bounds.

fn get_key(&self, key: &str) -> Result<Option<Argument>, ()>

Returns the argument with the given name.

Implement this method if the container supports named access. Return Ok(Some(...)) if the argument exists, or Ok(None) if the index is out of bounds.

Loading content...

Implementations on Foreign Types

impl<T> FormatArgs for Vec<T> where
    T: Serialize
[src]

impl<'_, T> FormatArgs for &'_ [T] where
    T: Serialize
[src]

impl<T> FormatArgs for [T; 0] where
    T: Serialize
[src]

impl<T> FormatArgs for [T; 1] where
    T: Serialize
[src]

impl<T> FormatArgs for [T; 2] where
    T: Serialize
[src]

impl<T> FormatArgs for [T; 3] where
    T: Serialize
[src]

impl<T> FormatArgs for [T; 4] where
    T: Serialize
[src]

impl<T> FormatArgs for [T; 5] where
    T: Serialize
[src]

impl<T> FormatArgs for [T; 6] where
    T: Serialize
[src]

impl<T> FormatArgs for [T; 7] where
    T: Serialize
[src]

impl<T> FormatArgs for [T; 8] where
    T: Serialize
[src]

impl<T> FormatArgs for [T; 9] where
    T: Serialize
[src]

impl<T> FormatArgs for [T; 10] where
    T: Serialize
[src]

impl<T> FormatArgs for [T; 11] where
    T: Serialize
[src]

impl<T> FormatArgs for [T; 12] where
    T: Serialize
[src]

impl<T> FormatArgs for [T; 13] where
    T: Serialize
[src]

impl<T> FormatArgs for [T; 14] where
    T: Serialize
[src]

impl<T> FormatArgs for [T; 15] where
    T: Serialize
[src]

impl<T> FormatArgs for [T; 16] where
    T: Serialize
[src]

impl<T> FormatArgs for VecDeque<T> where
    T: Serialize
[src]

impl<S, T> FormatArgs for BTreeMap<S, T> where
    S: Borrow<str> + Ord,
    T: Serialize
[src]

impl<S, T> FormatArgs for HashMap<S, T> where
    S: Borrow<str> + Hash + Eq,
    T: Serialize
[src]

impl<'_, A> FormatArgs for &'_ A where
    A: FormatArgs
[src]

Loading content...

Implementors

Loading content...