[−][src]Struct markings::Args
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]
K: Into<Cow<'k, str>>,
V: Display,
fn from_iter<T: IntoIterator<Item = (K, V)>>(iter: T) -> Self
[src]
impl<'k> IntoIterator for Args<'k>
[src]
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]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<I> IntoIterator for I where
I: Iterator,
[src]
I: Iterator,
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?
fn into_iter(self) -> I
[src]
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,