quantlib_rs 0.1.0

A ground-up, idiomatic Rust quantitative finance library inspired by QuantLib.
Documentation
//! Null calendar where every day is a business day.

use crate::time::calendar::Calendar;
use crate::time::date::Date;

/// A calendar where every day is treated as a business day.
///
/// Useful for testing, theoretical modeling, or crypto markets that trade 24/7.
///
/// # Examples
/// ```
/// use quantlib_rs::time::calendar::Calendar;
/// use quantlib_rs::time::calendars::null_calendar::NullCalendar;
/// use quantlib_rs::time::date::{Date, Month};
///
/// let cal = NullCalendar;
/// let saturday = Date::from_ymd(2026, Month::September, 5).unwrap();
/// assert!(cal.is_business_day(saturday));
/// ```
#[derive(Debug, Clone, Copy, PartialEq, Eq, Default)]
pub struct NullCalendar;

impl Calendar for NullCalendar {
    fn name(&self) -> &'static str {
        "Null Calendar"
    }

    #[inline]
    fn is_business_day(&self, _date: Date) -> bool {
        true
    }

    #[inline]
    fn is_weekend(&self, _date: Date) -> bool {
        false
    }
}