//! Cash flow traits and interfaces.
usecrate::time::date::Date;/// Common trait for all financial cash flows.
////// Implementors must be `Send + Sync` to support multi-threaded portfolio
/// discounting and curve calibration without lock contention.
pubtraitCashFlow: Send + Sync {/// Return the payment date of the cash flow.
fndate(&self)-> Date;/// Return the cash flow amount.
fnamount(&self)->f64;/// Return true if the cash flow has occurred strictly on or before `ref_date`.
#[inline]fnhas_occurred(&self, ref_date: Date)->bool{self.date()<= ref_date
}}