pub struct Calendar {
pub id: CalendarId,
pub name: String,
pub working_hours: Vec<TimeRange>,
pub working_days: Vec<u8>,
pub holidays: Vec<Holiday>,
pub exceptions: Vec<CalendarException>,
}Expand description
Working time definitions
Fields§
§id: CalendarIdUnique identifier
name: StringHuman-readable name
working_hours: Vec<TimeRange>Working hours per day
working_days: Vec<u8>Working days (0 = Sunday, 6 = Saturday)
holidays: Vec<Holiday>Holiday dates
exceptions: Vec<CalendarException>Exceptions (override working hours for specific dates)
Implementations§
Source§impl Calendar
impl Calendar
Sourcepub fn hours_per_day(&self) -> f64
pub fn hours_per_day(&self) -> f64
Calculate working hours per day
Sourcepub fn is_working_day(&self, date: NaiveDate) -> bool
pub fn is_working_day(&self, date: NaiveDate) -> bool
Check if a date is a working day
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Calendar
impl<'de> Deserialize<'de> for Calendar
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for Calendar
impl RefUnwindSafe for Calendar
impl Send for Calendar
impl Sync for Calendar
impl Unpin for Calendar
impl UnwindSafe for Calendar
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