pub struct CalendarSpec {
pub zone: ZoneName,
pub working_days: WorkingDays,
pub holidays: Vec<Date>,
}Expand description
A named working calendar: the weekdays worked and the holidays that are not, in a zone.
use opportune::model::CalendarSpec;
use opportune::time::{Date, WorkingDays, ZoneName};
let org = CalendarSpec {
zone: ZoneName::new("America/New_York").unwrap(),
working_days: WorkingDays::weekdays(),
holidays: vec![Date::new(2027, 1, 1).unwrap()],
};
assert_eq!(org.holidays.len(), 1);Fields§
§zone: ZoneNameThe zone the calendar’s civil dates are read in.
working_days: WorkingDaysThe weekdays the calendar works.
holidays: Vec<Date>Dates that are not worked whatever the weekday.
Trait Implementations§
Source§impl Clone for CalendarSpec
impl Clone for CalendarSpec
Source§impl Debug for CalendarSpec
impl Debug for CalendarSpec
impl Eq for CalendarSpec
Source§impl PartialEq for CalendarSpec
impl PartialEq for CalendarSpec
impl StructuralPartialEq for CalendarSpec
Auto Trait Implementations§
impl Forget for CalendarSpec
impl Freeze for CalendarSpec
impl Move for CalendarSpec
impl RefUnwindSafe for CalendarSpec
impl Send for CalendarSpec
impl Sync for CalendarSpec
impl Unpin for CalendarSpec
impl UnsafeUnpin for CalendarSpec
impl UnwindSafe for CalendarSpec
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