nom-rfc8288

Crates.ionom-rfc8288
lib.rsnom-rfc8288
version0.2.3
sourcesrc
created_at2023-05-10 07:04:08.358368
updated_at2023-10-22 22:21:42.027532
descriptionA nom based parser for RFC 8288
homepagehttps://github.com/mishazharov/nom-rfc8288
repositoryhttps://github.com/mishazharov/nom-rfc8288
max_upload_size
id861139
size25,894
Misha Zharov (mishazharov)

documentation

https://docs.rs/nom-rfc8288

README

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.

Commit count: 13

cargo fmt