use std::{
collections::HashMap,
ops::{Deref, DerefMut},
};
#[derive(Debug, Clone, Eq, PartialEq)]
pub struct Parameters(pub HashMap<String, String>);
impl Parameters {
pub fn empty() -> Self {
Self(HashMap::new())
}
pub fn insert(
&mut self,
key: impl Into<String>,
value: impl ToString,
) -> &mut Self {
self.0.insert(key.into(), value.to_string());
self
}
}
impl Deref for Parameters {
type Target = HashMap<String, String>;
fn deref(&self) -> &Self::Target {
&self.0
}
}
impl DerefMut for Parameters {
fn deref_mut(&mut self) -> &mut Self::Target {
&mut self.0
}
}