Trait PairMap

Source
pub trait PairMap<'a, K = String, V = String>
where K: Eq + PartialEq + Hash + From<&'a str>, V: From<&'a str>,
{ const NAME: &'static str = "key-value pair"; const EXPECTED: &'static str = "<key>=<value>"; // Required method fn map(&mut self) -> &mut HashMap<K, V>; // Provided methods fn pair(input: &'a str) -> Option<(K, V)> { ... } fn set(&mut self, input: &'a str) { ... } }

Provided Associated Constants§

Source

const NAME: &'static str = "key-value pair"

Source

const EXPECTED: &'static str = "<key>=<value>"

Required Methods§

Source

fn map(&mut self) -> &mut HashMap<K, V>

Returns HashMap in the implementation struct.

Provided Methods§

Source

fn pair(input: &'a str) -> Option<(K, V)>

Breaks string into (key, value) tuple.

Source

fn set(&mut self, input: &'a str)

Inserts key-value pair into map.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl PairMap<'_> for Headers

Source§

const NAME: &'static str = "header"

Source§

const EXPECTED: &'static str = "<key>: [value]"

Source§

impl PairMap<'_> for Query

Source§

const NAME: &'static str = "query param"

Source§

impl PairMap<'_> for Variables

Source§

const NAME: &'static str = "variable"