Skip to main content

shield_dioxus/
query.rs

1use std::{collections::HashMap, ops::Deref};
2
3#[derive(Clone, Debug)]
4pub struct Query(HashMap<String, String>);
5
6impl Query {
7    pub fn parse(query: &str) -> Self {
8        Self(serde_qs::from_str::<HashMap<String, String>>(query).unwrap_or_default())
9    }
10}
11
12impl Deref for Query {
13    type Target = HashMap<String, String>;
14
15    fn deref(&self) -> &Self::Target {
16        &self.0
17    }
18}