Expand description
systemd-duration is a library that parses systemd-style durations.
It can parse durations into the following formats:
time::Duration
(with thewith-time
feature)chrono::TimeDelta
(with thewith-chrono
feature)std::time::Duration
It uses the nom
library to parse durations.
§Example
let td = systemd_duration::stdtime::parse("1d3s").expect("Could not parse duration");
assert_eq!(td, std::time::Duration::from_secs(86_403));