Module response

Module response 

Source
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_ios::response")]
    base: Response<U>,

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

    #[serde(with = "http_serde_ext_ios::response::result")]
    result: Result<Response<U>, T>,

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

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

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

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

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

Modules§

btree_map
hash_map
linked_list
option
result
vec
vec_deque

Functions§

deserialize
serialize