pub struct DebtCovenant {
pub id: String,
pub covenant_type: CovenantType,
pub threshold: Decimal,
pub measurement_frequency: Frequency,
pub actual_value: Decimal,
pub measurement_date: NaiveDate,
pub is_compliant: bool,
pub headroom: Decimal,
pub waiver_obtained: bool,
}Expand description
A financial covenant attached to a debt instrument.
Fields§
§id: StringUnique covenant identifier
covenant_type: CovenantTypeType of financial ratio being tested
threshold: DecimalCovenant threshold value
measurement_frequency: FrequencyHow often the covenant is tested
actual_value: DecimalMost recent actual measured value
measurement_date: NaiveDateDate the measurement was taken
is_compliant: boolWhether the entity is in compliance
headroom: DecimalDistance from the covenant threshold (positive = headroom, negative = breach)
waiver_obtained: boolWhether a waiver was obtained for a breach
Implementations§
Source§impl DebtCovenant
impl DebtCovenant
Sourcepub fn new(
id: impl Into<String>,
covenant_type: CovenantType,
threshold: Decimal,
measurement_frequency: Frequency,
actual_value: Decimal,
measurement_date: NaiveDate,
) -> Self
pub fn new( id: impl Into<String>, covenant_type: CovenantType, threshold: Decimal, measurement_frequency: Frequency, actual_value: Decimal, measurement_date: NaiveDate, ) -> Self
Creates a new debt covenant.
Sourcepub fn with_waiver(self, waiver: bool) -> Self
pub fn with_waiver(self, waiver: bool) -> Self
Sets the waiver flag.
Sourcepub fn update_compliance(&mut self)
pub fn update_compliance(&mut self)
Recomputes compliance and headroom from current values.
Trait Implementations§
Source§impl Clone for DebtCovenant
impl Clone for DebtCovenant
Source§fn clone(&self) -> DebtCovenant
fn clone(&self) -> DebtCovenant
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for DebtCovenant
impl Debug for DebtCovenant
Source§impl<'de> Deserialize<'de> for DebtCovenant
impl<'de> Deserialize<'de> for DebtCovenant
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
Auto Trait Implementations§
impl Freeze for DebtCovenant
impl RefUnwindSafe for DebtCovenant
impl Send for DebtCovenant
impl Sync for DebtCovenant
impl Unpin for DebtCovenant
impl UnsafeUnpin for DebtCovenant
impl UnwindSafe for DebtCovenant
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