pub struct OpeningHoursExpression {
pub rules: Vec<RuleSequence>,
}Fields§
§rules: Vec<RuleSequence>Implementations§
Source§impl OpeningHoursExpression
impl OpeningHoursExpression
Sourcepub fn is_constant(&self) -> bool
pub fn is_constant(&self) -> bool
Check if this expression is trivially constant (ie. always evaluated at the exact same
status). Note that this may return false for an expression that is constant but should
cover most common cases.
use opening_hours_syntax::parse;
assert!(parse("24/7").unwrap().is_constant());
assert!(parse("24/7 closed").unwrap().is_constant());
assert!(parse("00:00-24:00 open").unwrap().is_constant());
assert!(!parse("00:00-18:00 open").unwrap().is_constant());
assert!(!parse("24/7 ; PH off").unwrap().is_constant());Trait Implementations§
Source§impl Clone for OpeningHoursExpression
impl Clone for OpeningHoursExpression
Source§fn clone(&self) -> OpeningHoursExpression
fn clone(&self) -> OpeningHoursExpression
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for OpeningHoursExpression
impl Debug for OpeningHoursExpression
Source§impl Display for OpeningHoursExpression
impl Display for OpeningHoursExpression
Source§impl Hash for OpeningHoursExpression
impl Hash for OpeningHoursExpression
Source§impl PartialEq for OpeningHoursExpression
impl PartialEq for OpeningHoursExpression
impl Eq for OpeningHoursExpression
impl StructuralPartialEq for OpeningHoursExpression
Auto Trait Implementations§
impl Freeze for OpeningHoursExpression
impl RefUnwindSafe for OpeningHoursExpression
impl Send for OpeningHoursExpression
impl Sync for OpeningHoursExpression
impl Unpin for OpeningHoursExpression
impl UnwindSafe for OpeningHoursExpression
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