use std::fmt;
#[derive(Debug, PartialEq, Eq)]
pub enum DayCountError {
MissingCalendar,
}
impl fmt::Display for DayCountError {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
match self {
DayCountError::MissingCalendar => {
write!(f, "DayCount::Bd252 requires a Calendar")
}
}
}
}
impl std::error::Error for DayCountError {}
#[derive(Debug, PartialEq, Eq)]
pub enum BusinessDayError {
InvalidStartDate,
}
impl fmt::Display for BusinessDayError {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
match self {
BusinessDayError::InvalidStartDate => {
write!(f, "start date is not a business day in the given calendar")
}
}
}
}
impl std::error::Error for BusinessDayError {}