Trait bdays::HolidayCalendar
source · pub trait HolidayCalendar<T: Datelike + Copy + PartialOrd> {
fn is_holiday(&self, date: T) -> bool;
fn is_bday(&self, date: T) -> bool { ... }
fn to_bday(&self, date: T, adjust_next: bool) -> T { ... }
fn advance_bdays(&self, date: T, bdays_count: i32) -> T { ... }
fn bdays(&self, d0: T, d1: T) -> i32 { ... }
}
Expand description
Abstraction for a Holiday Calendar.
Required Methods
sourcefn is_holiday(&self, date: T) -> bool
fn is_holiday(&self, date: T) -> bool
Returns true
if date
is a holiday.
Provided Methods
sourcefn 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.
sourcefn 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.
sourcefn 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
.