Crates.io | nom-rfc8288 |
lib.rs | nom-rfc8288 |
version | 0.2.3 |
source | src |
created_at | 2023-05-10 07:04:08.358368 |
updated_at | 2023-10-22 22:21:42.027532 |
description | A nom based parser for RFC 8288 |
homepage | https://github.com/mishazharov/nom-rfc8288 |
repository | https://github.com/mishazharov/nom-rfc8288 |
max_upload_size | |
id | 861139 |
size | 25,894 |
RFC 8288 specifies the convention for parsing the Link header.
use nom_rfc8288::complete::{link, LinkData, LinkParam};
let link_data = r#"<https://example.com>; rel="origin"; csv="one,two""#;
let parsed = link(link_data).unwrap();
assert_eq!(
parsed,
vec![
Some(
LinkData {
url: "https://example.com",
params: vec![
LinkParam {
key: "rel",
val: Some("origin".to_owned()),
},
LinkParam {
key: "csv",
val: Some("one,two".to_owned()),
}
],
}
),
]
);
See the pre-commit
quick start guide for how to setup pre-commit
.