Expand description
Serialize/Deserialize for http::uri::Authority
use std::{cmp::Ord, collections::*, hash::Hash};
use http::uri::Authority;
use serde::{Serialize, Deserialize};
#[derive(Serialize, Deserialize)]
struct MyStruct<T, U>
where
U: Serialize + for<'a> Deserialize<'a>,
T: Serialize + for<'a> Deserialize<'a> + Hash + Ord,
{
#[serde(with = "http_serde_ext::authority")]
base: Authority,
#[serde(with = "http_serde_ext::authority::option", default)]
option: Option<Authority>,
#[serde(with = "http_serde_ext::authority::result")]
result: Result<Authority, U>,
#[serde(with = "http_serde_ext::authority::vec")]
vec: Vec<Authority>,
#[serde(with = "http_serde_ext::authority::vec_deque")]
vec_deque: VecDeque<Authority>,
#[serde(with = "http_serde_ext::authority::linked_list")]
linked_list: LinkedList<Authority>,
#[serde(with = "http_serde_ext::authority::hash_map")]
hash_map: HashMap<T, Authority>,
#[serde(with = "http_serde_ext::authority::hash_map_key")]
hash_map_key: HashMap<Authority, U>,
#[serde(with = "http_serde_ext::authority::btree_map")]
btree_map: BTreeMap<T, Authority>,
#[serde(with = "http_serde_ext::authority::hash_set")]
hash_set: HashSet<Authority>,
}