pub struct HourRange {
pub from: u8,
pub till: u8,
pub weekday_type: WeekdayType,
}Expand description
Represents a time range when a rate tier applies
Fields§
§from: u8Starting hour (0-23)
till: u8Ending hour (0-23, exclusive)
weekday_type: WeekdayTypeType of day this range applies to
Implementations§
Source§impl HourRange
impl HourRange
Sourcepub fn new(from: u8, till: u8, weekday_type: WeekdayType) -> Self
pub fn new(from: u8, till: u8, weekday_type: WeekdayType) -> Self
Creates a new hour range
Sourcepub fn matches_hour(&self, hour: u8, weekday_type: WeekdayType) -> bool
pub fn matches_hour(&self, hour: u8, weekday_type: WeekdayType) -> bool
Checks if this hour range matches the given hour and day type
Trait Implementations§
impl StructuralPartialEq for HourRange
Auto Trait Implementations§
impl Freeze for HourRange
impl RefUnwindSafe for HourRange
impl Send for HourRange
impl Sync for HourRange
impl Unpin for HourRange
impl UnwindSafe for HourRange
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