pub struct Thirty360US;Expand description
30/360 (US) — SIA convention: Bond Basis plus the
last-day-of-February rule, applied first. Matches QuantLib’s
Thirty360::USA.
use fasti::{DayCount, Date, Month, Thirty360US};
// Last-of-Feb start: D1 -> 30, then D2 = 31 -> 30.
let start = Date::from_ymd(2025, Month::Feb, 28)?;
let end = Date::from_ymd(2025, Month::Mar, 31)?;
assert_eq!(Thirty360US.day_count(start, end), 30);Trait Implementations§
Source§impl Clone for Thirty360US
impl Clone for Thirty360US
Source§fn clone(&self) -> Thirty360US
fn clone(&self) -> Thirty360US
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 Thirty360US
Source§impl DayCount for Thirty360US
impl DayCount for Thirty360US
Source§fn day_count(&self, start: Date, end: Date) -> i64
fn day_count(&self, start: Date, end: Date) -> i64
Days between
start and end, signed by direction. Defaults
to calendar days; the 30/360 family overrides.Source§fn year_fraction(&self, start: Date, end: Date) -> Fraction
fn year_fraction(&self, start: Date, end: Date) -> Fraction
The year fraction between
start and end: signed by
direction, Fraction::ZERO for equal dates. Read moreSource§impl Debug for Thirty360US
impl Debug for Thirty360US
Source§impl Default for Thirty360US
impl Default for Thirty360US
Source§fn default() -> Thirty360US
fn default() -> Thirty360US
Returns the “default value” for a type. Read more
impl Eq for Thirty360US
Source§impl Hash for Thirty360US
impl Hash for Thirty360US
Source§impl PartialEq for Thirty360US
impl PartialEq for Thirty360US
impl StructuralPartialEq for Thirty360US
Auto Trait Implementations§
impl Freeze for Thirty360US
impl RefUnwindSafe for Thirty360US
impl Send for Thirty360US
impl Sync for Thirty360US
impl Unpin for Thirty360US
impl UnsafeUnpin for Thirty360US
impl UnwindSafe for Thirty360US
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