pub struct Calendar { /* private fields */ }
Expand description
Calendar for arbitrary complex holiday rules
Implementations§
Source§impl Calendar
impl Calendar
Sourcepub fn calc_calendar(
holiday_rules: &[Holiday],
start: i32,
end: i32,
) -> Result<Calendar, CalendarError>
pub fn calc_calendar( holiday_rules: &[Holiday], start: i32, end: i32, ) -> Result<Calendar, CalendarError>
Calculate all holidays and recognize weekend days for a given range of years
from start
to end
(inclusively). The calculation is performed on the basis
of a vector of holiday rules.
Sourcepub fn next_bday(&self, date: Date) -> Result<Date, CalendarError>
pub fn next_bday(&self, date: Date) -> Result<Date, CalendarError>
Calculate the next business day
Sourcepub fn prev_bday(&self, date: Date) -> Result<Date, CalendarError>
pub fn prev_bday(&self, date: Date) -> Result<Date, CalendarError>
Calculate the previous business day
Sourcepub fn is_weekend(&self, day: Date) -> bool
pub fn is_weekend(&self, day: Date) -> bool
Returns true if the date falls on a weekend
Sourcepub fn is_holiday(&self, date: Date) -> bool
pub fn is_holiday(&self, date: Date) -> bool
Returns true if the specified day is a bank holiday
Sourcepub fn is_business_day(&self, date: Date) -> bool
pub fn is_business_day(&self, date: Date) -> bool
Returns true if the specified day is a business day
Trait Implementations§
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