serde_header

Crates.ioserde_header
lib.rsserde_header
version0.2.0
sourcesrc
created_at2020-09-15 07:15:38.464018
updated_at2020-09-17 05:32:00.061908
descriptionStrongly typed HTTP Header library for Rust, built upon serde
homepagehttps://github.com/Xuanwo/serde_header
repositoryhttps://github.com/Xuanwo/serde_header
max_upload_size
id288833
size14,342
Xuanwo (Xuanwo)

documentation

https://docs.rs/serde_header/

README

serde_header

Strongly typed HTTP Header library for Rust, built upon serde

Quick start

use serde_header::from_http_header_map;

#[derive(Deserialize, Debug)]
struct Example {
    content_length: i64,
    content_type: String,
}

// let mut h = http::header::HeaderMap::new();
// h.insert("content_length", "100".parse().unwrap());
// h.insert("content_type", "application/json".parse().unwrap());

let t: Example = from_http_header_map(&h).unwrap();

println!("{:?}", &t)
Commit count: 11

cargo fmt