Trait quartz_cli::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.

Object Safety§

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"