pub struct ParserUnits { /* private fields */ }Expand description
Used to customize the parser’s units and their values.
Implementations§
Source§impl ParserUnits
impl ParserUnits
Sourcepub fn add_unit(&mut self, k: &'static str, v: Duration)
pub fn add_unit(&mut self, k: &'static str, v: Duration)
Insert/update a unit and its value.
For example, to add a unit ‘day’ with a duration of 24 hours:
use durstr::ParserUnits;
use std::time::Duration;
let mut units = ParserUnits::default();
units.add_unit("day", Duration::from_secs(3600) * 24);Trait Implementations§
Auto Trait Implementations§
impl Freeze for ParserUnits
impl RefUnwindSafe for ParserUnits
impl Send for ParserUnits
impl Sync for ParserUnits
impl Unpin for ParserUnits
impl UnwindSafe for ParserUnits
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more