pub enum Error {
Syntax(Box<Error<Rule>>),
Unsupported(&'static str),
Overflow {
value: i16,
expected_bounds: RangeInclusive<i16>,
},
InvalidExtendedTime {
hour: u8,
minutes: u8,
},
InvertedYearRange {
start: Year,
end: Year,
step: u16,
},
InvertedWeekRange {
start: WeekNum,
end: WeekNum,
step: u8,
},
GrammarUnexpectedToken {
rule: Rule,
unexpected: Rule,
},
GrammarLogic {
rule: Rule,
invariant: &'static str,
},
}Variants§
Syntax(Box<Error<Rule>>)
Could not parse the expression. It is not conformant with the grammar defined in the wiki: https://wiki.openstreetmap.org/wiki/Key:opening_hours/specification
Unsupported(&'static str)
Use of an unsupported feature.
Overflow
Some number has overflowed.
InvalidExtendedTime
Extended time has overflowed.
InvertedYearRange
A year range that starts after it ends.
InvertedWeekRange
A week range that starts after it ends.
GrammarUnexpectedToken
This should never be built at runtime if the grammar implementation is sound.
GrammarLogic
This should never be built at runtime if the grammar implementation is sound.
Implementations§
Source§impl Error
impl Error
Sourcepub fn is_implementation_error(&self) -> bool
pub fn is_implementation_error(&self) -> bool
If this is true, this is an error that should not be raised as long as the implementation is sound. If this kind of error occurs, you can report it here : https://github.com/remi-dupre/opening-hours-rs/issues
Trait Implementations§
Source§impl Error for Error
Available on crate feature std only.
impl Error for Error
Available on crate feature
std only.Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0:
use the Display impl or to_string()
Auto Trait Implementations§
impl Freeze for Error
impl RefUnwindSafe for Error
impl Send for Error
impl Sync for Error
impl Unpin for Error
impl UnsafeUnpin for Error
impl UnwindSafe for Error
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