5 releases

0.2.3 Oct 22, 2023
0.2.2 Oct 20, 2023
0.2.1 Sep 17, 2023
0.2.0 Sep 4, 2023
0.1.0 May 10, 2023

#1856 in Parser implementations

29 downloads per month

MIT/Apache

25KB
565 lines

RFC 8288 parser

RFC 8288 specifies the convention for parsing the Link header.

Usage

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()),
                    }
                ],
            }
        ),
    ]
);

Contributing

Pre-commit hooks

See the pre-commit quick start guide for how to setup pre-commit.

Dependencies

~1.5–2.2MB
~44K SLoC