Trait dynfmt::FormatArgs [−][src]
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<'_>>, ()>
[src]
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<'_>>, ()>
[src]
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.
Implementations on Foreign Types
impl<T> FormatArgs for Vec<T> where
T: Serialize,
[src]
T: Serialize,
impl<T> FormatArgs for &[T] where
T: Serialize,
[src]
T: Serialize,
impl<T> FormatArgs for [T; 0] where
T: Serialize,
[src]
T: Serialize,
impl<T> FormatArgs for [T; 1] where
T: Serialize,
[src]
T: Serialize,
impl<T> FormatArgs for [T; 2] where
T: Serialize,
[src]
T: Serialize,
impl<T> FormatArgs for [T; 3] where
T: Serialize,
[src]
T: Serialize,
impl<T> FormatArgs for [T; 4] where
T: Serialize,
[src]
T: Serialize,
impl<T> FormatArgs for [T; 5] where
T: Serialize,
[src]
T: Serialize,
impl<T> FormatArgs for [T; 6] where
T: Serialize,
[src]
T: Serialize,
impl<T> FormatArgs for [T; 7] where
T: Serialize,
[src]
T: Serialize,
impl<T> FormatArgs for [T; 8] where
T: Serialize,
[src]
T: Serialize,
impl<T> FormatArgs for [T; 9] where
T: Serialize,
[src]
T: Serialize,
impl<T> FormatArgs for [T; 10] where
T: Serialize,
[src]
T: Serialize,
impl<T> FormatArgs for [T; 11] where
T: Serialize,
[src]
T: Serialize,
impl<T> FormatArgs for [T; 12] where
T: Serialize,
[src]
T: Serialize,
impl<T> FormatArgs for [T; 13] where
T: Serialize,
[src]
T: Serialize,
impl<T> FormatArgs for [T; 14] where
T: Serialize,
[src]
T: Serialize,
impl<T> FormatArgs for [T; 15] where
T: Serialize,
[src]
T: Serialize,
impl<T> FormatArgs for [T; 16] where
T: Serialize,
[src]
T: Serialize,
impl<T> FormatArgs for VecDeque<T> where
T: Serialize,
[src]
T: Serialize,
impl<S, T> FormatArgs for BTreeMap<S, T> where
S: Borrow<str> + Ord,
T: Serialize,
[src]
S: Borrow<str> + Ord,
T: Serialize,
impl<S, T> FormatArgs for HashMap<S, T> where
S: Borrow<str> + Hash + Eq,
T: Serialize,
[src]
S: Borrow<str> + Hash + Eq,
T: Serialize,
impl<A> FormatArgs for &A where
A: FormatArgs,
[src]
A: FormatArgs,