Module http_serde_ext::method
source · Expand description
Serialize
/Deserialize
for http::Method
use std::{cmp::Ord, collections::*, hash::Hash};
use http::Method;
use serde::{Serialize, Deserialize};
#[derive(Serialize, Deserialize)]
struct MyStruct<T>
where
T: Serialize + for<'a> Deserialize<'a> + Hash + Ord,
{
#[serde(with = "http_serde_ext::method")]
base: Method,
#[serde(with = "http_serde_ext::method::option")]
option: Option<Method>,
#[serde(with = "http_serde_ext::method::vec")]
vec: Vec<Method>,
#[serde(with = "http_serde_ext::method::vec_deque")]
vec_deque: VecDeque<Method>,
#[serde(with = "http_serde_ext::method::linked_list")]
linked_list: LinkedList<Method>,
#[serde(with = "http_serde_ext::method::hash_map")]
hash_map: HashMap<T, Method>,
#[serde(with = "http_serde_ext::method::btree_map")]
btree_map: BTreeMap<T, Method>,
}