[][src]Struct markings::Args

pub struct Args<'k> { /* fields omitted */ }

This is an easy way to build an argument mapping for the template application method

The key must be a &str while the value can be any std::fmt::Display trait object

note The keys are unique, duplicates will be replaced by the last one

let args = Args::new()
    .with("key1", &false)
    .with("key2", &"message")
    .with("key3", &41)
    .with("key3", &42);

Methods

impl<'k> Args<'k>[src]

pub fn new() -> Self[src]

Create a new Args builder

pub fn len(&self) -> usize[src]

Length of the args

pub fn is_empty(&self) -> bool[src]

Whether the args is empty

pub fn with(self, key: impl Into<Cow<'k, str>>, val: impl Display) -> Self[src]

Maps a key to a type that implements std::fmt::Display

pub fn iter(&self) -> impl Iterator<Item = (&Cow<'k, str>, &String)> + '_[src]

Trait Implementations

impl<'k> Clone for Args<'k>[src]

impl<'k> Default for Args<'k>[src]

impl<'k, K, V> FromIterator<(K, V)> for Args<'k> where
    K: Into<Cow<'k, str>>,
    V: Display
[src]

impl<'k> IntoIterator for Args<'k>[src]

type Item = (Cow<'k, str>, String)

The type of the elements being iterated over.

type IntoIter = ArgsIntoIter<'k>

Which kind of iterator are we turning this into?

Auto Trait Implementations

impl<'k> RefUnwindSafe for Args<'k>

impl<'k> Send for Args<'k>

impl<'k> Sync for Args<'k>

impl<'k> Unpin for Args<'k>

impl<'k> UnwindSafe for Args<'k>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<I> IntoIterator for I where
    I: Iterator
[src]

type Item = <I as Iterator>::Item

The type of the elements being iterated over.

type IntoIter = I

Which kind of iterator are we turning this into?

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.