Skip to content

mishazharov/nom-rfc8288

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

About

A Rust parser for Link headers

Resources

Stars

Watchers

Forks

Languages