pub enum DayCountConvention {
Act365,
Act360,
Thirty360,
}Expand description
Day count conventions used to convert a pair of dates into a year fraction.
This is the single bridge between calendar dates and the year-fraction
times used by crate::core::curves::YieldCurve; instruments carry their
own convention and curves carry theirs.
Variants§
Implementations§
Source§impl DayCountConvention
impl DayCountConvention
Sourcepub fn year_fraction(&self, start: NaiveDate, end: NaiveDate) -> f64
pub fn year_fraction(&self, start: NaiveDate, end: NaiveDate) -> f64
Year fraction from start to end under this convention.
Negative if end is before start.
Trait Implementations§
Source§impl Clone for DayCountConvention
impl Clone for DayCountConvention
Source§fn clone(&self) -> DayCountConvention
fn clone(&self) -> DayCountConvention
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for DayCountConvention
Source§impl Debug for DayCountConvention
impl Debug for DayCountConvention
Source§impl Default for DayCountConvention
impl Default for DayCountConvention
Source§fn default() -> DayCountConvention
fn default() -> DayCountConvention
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for DayCountConvention
impl<'de> Deserialize<'de> for DayCountConvention
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for DayCountConvention
Source§impl PartialEq for DayCountConvention
impl PartialEq for DayCountConvention
Source§impl Serialize for DayCountConvention
impl Serialize for DayCountConvention
impl StructuralPartialEq for DayCountConvention
Auto Trait Implementations§
impl Freeze for DayCountConvention
impl RefUnwindSafe for DayCountConvention
impl Send for DayCountConvention
impl Sync for DayCountConvention
impl Unpin for DayCountConvention
impl UnsafeUnpin for DayCountConvention
impl UnwindSafe for DayCountConvention
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