pub struct RangeParser { /* private fields */ }Expand description
Struct implementing the parser to generate a DateRange from a date range description.
Implementations§
Source§impl RangeParser
impl RangeParser
Sourcepub fn parse_from_str(&self, datespec: &str) -> Result<DateRange>
pub fn parse_from_str(&self, datespec: &str) -> Result<DateRange>
Parse the supplied string to return a DateRange if successful.
§Errors
- Return
DateError::InvalidDateif the specification for a single day is not valid. - Return
DateError::InvalidDaySpecif overall range specification is not valid.
Sourcepub fn parse<'a, I>(&self, datespec: &mut I) -> Result<(DateRange, &'a str)>
pub fn parse<'a, I>(&self, datespec: &mut I) -> Result<(DateRange, &'a str)>
Parse the tokens from the supplied string iterator to return a tuple containing
a DateRange and the last unused token if successful.
§Errors
- Return
DateError::InvalidDateif the specification for a single day is not valid. - Return
DateError::InvalidDaySpecif overall range specification is not valid.
Trait Implementations§
Source§impl Default for RangeParser
impl Default for RangeParser
Source§fn default() -> Self
fn default() -> Self
Return a RangeParser, parsing relative to today.
Auto Trait Implementations§
impl Freeze for RangeParser
impl RefUnwindSafe for RangeParser
impl Send for RangeParser
impl Sync for RangeParser
impl Unpin for RangeParser
impl UnwindSafe for RangeParser
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