2 releases

0.1.1 Mar 8, 2024
0.1.0 Jul 22, 2020

#760 in Parser implementations

Download history 14/week @ 2024-01-22 5/week @ 2024-01-29 2/week @ 2024-02-05 4/week @ 2024-02-12 23/week @ 2024-02-19 24/week @ 2024-02-26 183/week @ 2024-03-04 75/week @ 2024-03-11 77/week @ 2024-03-18 65/week @ 2024-03-25 64/week @ 2024-04-01 49/week @ 2024-04-08 36/week @ 2024-04-15 44/week @ 2024-04-22 30/week @ 2024-04-29 28/week @ 2024-05-06

140 downloads per month

MIT/Apache

18KB
312 lines

adstxt

ci Rust Documentation Latest Version

This library provides a parser for ads.txt v1.0.2.

Example

# use adstxt::*;

assert_eq!(
    AdsTxt::parse(
        "# comment
placeholder.example.com, placeholder, DIRECT, placeholder # Comment
contact=adops@example.com

unknown"
    ),
    AdsTxt {
        records: vec![(
            Record {
                domain: "placeholder.example.com",
                account_id: "placeholder",
                relation: Relation::Direct,
                authority_id: Some("placeholder"),
            },
            None
        )],
        variables: vec![(Variable { name: "contact", value: "adops@example.com" }, None)],
    }
);

License

Licensed under either of Apache License, Version 2.0 or MIT license at your option.

No runtime deps