25 releases

0.6.18 Nov 27, 2023
0.6.15 Jun 14, 2023
0.6.4 Aug 12, 2022
0.5.6 Aug 6, 2022
0.4.1 Feb 22, 2021

#155 in Geospatial

38 downloads per month
Used in opening-hours

MIT/Apache

48KB
1K SLoC

Rust 1K SLoC // 0.0% comments Pest 182 SLoC // 0.1% comments

Rust parser for OSM Opening Hours

Parsing component of opening-hours crate.

Usage

Add this to your Cargo.toml:

[dependencies]
opening-hours-syntax = "0"

And then a basic usage would look like that:

use opening_hours_syntax::parse;

// Opens until 18pm during the week and until 12am the week-end.
const OH: &str = "Mo-Fr 10:00-18:00; Sa-Su 10:00-12:00";

fn main() {
    let oh = parse(&OH).unwrap();
    eprintln!("{:?}", oh);
}
"Root Package"


"Package"


"Documentation"

lib.rs:

Parsing component of opening-hours crate.

Usage

Add this to your Cargo.toml:

[dependencies]
opening-hours-syntax = "0"

And then a basic usage would look like that:

use opening_hours_syntax::parse;

// Opens until 18pm during the week and until 12am the week-end.
const OH: &str = "Mo-Fr 10:00-18:00; Sa-Su 10:00-12:00";

fn main() {
    let oh = parse(&OH).unwrap();
    eprintln!("{:?}", oh);
}

Dependencies

~4MB
~77K SLoC