Expand description

Serialize/Deserialize for http::Response

use std::{cmp::Ord, collections::*, hash::Hash};

use http::Response;
use serde::{Serialize, Deserialize};

#[derive(Serialize, Deserialize)]
struct MyStruct<T, U>
where
    T: Serialize + for<'a> Deserialize<'a> + Hash + Ord,
    U: Serialize + for<'a> Deserialize<'a>,
{
   #[serde(with = "http_serde_ext::response")]
   base: Response<U>,

   #[serde(with = "http_serde_ext::response::option")]
   option: Option<Response<U>>,

   #[serde(with = "http_serde_ext::response::vec")]
   vec: Vec<Response<U>>,

   #[serde(with = "http_serde_ext::response::vec_deque")]
   vec_deque: VecDeque<Response<U>>,

   #[serde(with = "http_serde_ext::response::linked_list")]
   linked_list: LinkedList<Response<U>>,

   #[serde(with = "http_serde_ext::response::hash_map")]
   hash_map: HashMap<T, Response<U>>,

   #[serde(with = "http_serde_ext::response::btree_map")]
   btree_map: BTreeMap<T, Response<U>>,
}

Modules

Functions