[][src]Struct finql::calendar::Calendar

pub struct Calendar { /* fields omitted */ }

Calendar for arbitrary complex holiday rules

Methods

impl Calendar[src]

pub fn calc_calendar(
    holiday_rules: &Vec<Holiday>,
    start: i32,
    end: i32
) -> Calendar
[src]

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.

pub fn next_bday(&self, date: NaiveDate) -> NaiveDate[src]

Calculate the next business day

pub fn prev_bday(&self, date: NaiveDate) -> NaiveDate[src]

Calculate the previous business day

pub fn is_weekend(&self, day: NaiveDate) -> bool[src]

Returns true if the date falls on a weekend

pub fn is_holiday(&self, date: NaiveDate) -> bool[src]

Returns true if the specified day is a bank holiday

pub fn is_business_day(&self, date: NaiveDate) -> bool[src]

Returns true if the specified day is a business day

Trait Implementations

impl Clone for Calendar[src]

impl Debug for Calendar[src]

Auto Trait Implementations

Blanket Implementations

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = !

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]