Enum DayCount Copy item path Source pub enum DayCount {
Act360,
Act365,
Bd252,
ActActISDA,
D30360Euro,
D30365,
}Expand description Day count conventions used when computing time fractions between two dates.
Pass one of these values to algebra::day_count_fraction .
§ Examples
use findates::conventions::DayCount;
let dc = DayCount::Act365;
assert_eq! (dc.to_string(), "Act365" );
let parsed: DayCount = "Act360" .parse().unwrap();
assert_eq! (parsed, DayCount::Act360);Actual days divided by 360.
QuantLib equivalent: Actual360
Actual days divided by 365.
QuantLib equivalent: Actual365Fixed (Standard variant)
Business days divided by 252 (Brazilian convention).
Requires a Calendar .
QuantLib equivalent: Business252
Actual/Actual ISDA: accounts for leap years by splitting
the period at year boundaries.
QuantLib equivalent: ActualActual(ActualActual::ISDA)
30/360 European: if either date falls on the 31st of a month
it is treated as the 30th. Year of 360 days.
QuantLib equivalent: Thirty360(Thirty360::European) /
Thirty360(Thirty360::EurobondBasis)
30/365: months of 30 days, year of 365 days.
QuantLib equivalent: no direct equivalent — closest is
Thirty360 with custom year basis
Performs copy-assignment from
source.
Read more Formats the value using the given formatter.
Read more Formats the value using the given formatter.
Read more Parse a DayCount from its canonical string representation (case-sensitive).
§ Examples
use findates::conventions::DayCount;
assert_eq! ("ActActISDA" .parse::<DayCount>().unwrap(), DayCount::ActActISDA);
assert! ("actactisda" .parse::<DayCount>().is_err()); The associated error which can be returned from parsing.
Tests for self and other values to be equal, and is used by ==.
Tests for !=. The default implementation is almost always sufficient,
and should not be overridden without very good reason.
Immutably borrows from an owned value.
Read more Mutably borrows from an owned value.
Read more 🔬 This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from
self to
dest.
Read more Returns the argument unchanged.
Calls U::from(self).
That is, this conversion is whatever the implementation of
From <T> for U chooses to do.
The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning.
Read more Uses borrowed data to replace owned data, usually by cloning.
Read more Converts the given value to a
String.
Read more The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.