Struct bdays::HolidayCalendarCache
source · pub struct HolidayCalendarCache<T: Datelike + Copy + PartialOrd> { /* private fields */ }
Expand description
Caches business days calculation for a given holiday calendar
and a given range of dates. Implements the HolidayCalendar
trait.
Implementations§
source§impl<T: Datelike + Copy + PartialOrd + Display> HolidayCalendarCache<T>
impl<T: Datelike + Copy + PartialOrd + Display> HolidayCalendarCache<T>
sourcepub fn new<H: HolidayCalendar<T>>(
calendar: H,
dt_min: T,
dt_max: T
) -> HolidayCalendarCache<T>
pub fn new<H: HolidayCalendar<T>>( calendar: H, dt_min: T, dt_max: T ) -> HolidayCalendarCache<T>
Creates HolidayCalendarCache
that caches business days calculation
in the range of dates from dt_min
to dt_max
.
Trait Implementations§
source§impl<T: Datelike + Copy + PartialOrd + Display> HolidayCalendar<T> for HolidayCalendarCache<T>
impl<T: Datelike + Copy + PartialOrd + Display> HolidayCalendar<T> for HolidayCalendarCache<T>
source§fn is_holiday(&self, date: T) -> bool
fn is_holiday(&self, date: T) -> bool
Returns
true
if date
is a holiday.source§fn is_bday(&self, date: T) -> bool
fn is_bday(&self, date: T) -> bool
Returns
true
if date
is a Business Day.
A Business Day is defined as a weekday that is not a holiday.source§fn to_bday(&self, date: T, adjust_next: bool) -> T
fn to_bday(&self, date: T, adjust_next: bool) -> T
Adjusts
date
to the last/next business day if it’s not a business day.source§fn advance_bdays(&self, date: T, bdays_count: i32) -> T
fn advance_bdays(&self, date: T, bdays_count: i32) -> T
Advances
bdays_count
number of business days from date
.Auto Trait Implementations§
impl<T> Freeze for HolidayCalendarCache<T>where
T: Freeze,
impl<T> RefUnwindSafe for HolidayCalendarCache<T>where
T: RefUnwindSafe,
impl<T> Send for HolidayCalendarCache<T>where
T: Send,
impl<T> Sync for HolidayCalendarCache<T>where
T: Sync,
impl<T> Unpin for HolidayCalendarCache<T>where
T: Unpin,
impl<T> UnwindSafe for HolidayCalendarCache<T>where
T: UnwindSafe,
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