pub struct Calendar { /* private fields */ }Expand description
Calendar for arbitrary complex holiday rules
Implementations
sourceimpl Calendar
impl Calendar
sourcepub fn calc_calendar(
holiday_rules: &[Holiday],
start: i32,
end: i32
) -> Calendar
pub fn calc_calendar(
holiday_rules: &[Holiday],
start: i32,
end: i32
) -> Calendar
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 is_weekend(&self, day: NaiveDate) -> bool
pub fn is_weekend(&self, day: NaiveDate) -> bool
Returns true if the date falls on a weekend
sourcepub fn is_holiday(&self, date: NaiveDate) -> bool
pub fn is_holiday(&self, date: NaiveDate) -> bool
Returns true if the specified day is a bank holiday
sourcepub fn is_business_day(&self, date: NaiveDate) -> bool
pub fn is_business_day(&self, date: NaiveDate) -> bool
Returns true if the specified day is a business day
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for Calendar
impl Send for Calendar
impl Sync for Calendar
impl Unpin for Calendar
impl UnwindSafe for Calendar
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
🔬 This is a nightly-only experimental API. (
toowned_clone_into)Uses borrowed data to replace owned data, usually by cloning. Read more