pub struct DebtInstrument {Show 14 fields
pub id: String,
pub entity_id: String,
pub instrument_type: DebtType,
pub lender: String,
pub principal: Decimal,
pub currency: String,
pub interest_rate: Decimal,
pub rate_type: InterestRateType,
pub origination_date: NaiveDate,
pub maturity_date: NaiveDate,
pub amortization_schedule: Vec<AmortizationPayment>,
pub covenants: Vec<DebtCovenant>,
pub drawn_amount: Decimal,
pub facility_limit: Decimal,
}Expand description
A debt instrument (loan, bond, credit facility).
Fields§
§id: StringUnique instrument identifier
entity_id: StringLegal entity borrower
instrument_type: DebtTypeType of debt instrument
lender: StringLender / creditor name
principal: DecimalOriginal principal amount
currency: StringDenomination currency
interest_rate: DecimalInterest rate (annual, as decimal fraction)
rate_type: InterestRateTypeFixed or variable rate
origination_date: NaiveDateDate the instrument was originated
maturity_date: NaiveDateContractual maturity date
amortization_schedule: Vec<AmortizationPayment>Amortization schedule (empty for bullet / revolving)
covenants: Vec<DebtCovenant>Associated financial covenants
drawn_amount: DecimalCurrent drawn amount (for revolving facilities)
facility_limit: DecimalCommitted facility limit (for revolving facilities)
Implementations§
Source§impl DebtInstrument
impl DebtInstrument
Sourcepub fn new(
id: impl Into<String>,
entity_id: impl Into<String>,
instrument_type: DebtType,
lender: impl Into<String>,
principal: Decimal,
currency: impl Into<String>,
interest_rate: Decimal,
rate_type: InterestRateType,
origination_date: NaiveDate,
maturity_date: NaiveDate,
) -> Self
pub fn new( id: impl Into<String>, entity_id: impl Into<String>, instrument_type: DebtType, lender: impl Into<String>, principal: Decimal, currency: impl Into<String>, interest_rate: Decimal, rate_type: InterestRateType, origination_date: NaiveDate, maturity_date: NaiveDate, ) -> Self
Creates a new debt instrument.
Sourcepub fn with_amortization_schedule(
self,
schedule: Vec<AmortizationPayment>,
) -> Self
pub fn with_amortization_schedule( self, schedule: Vec<AmortizationPayment>, ) -> Self
Sets the amortization schedule.
Sourcepub fn with_covenant(self, covenant: DebtCovenant) -> Self
pub fn with_covenant(self, covenant: DebtCovenant) -> Self
Adds a covenant.
Sourcepub fn with_drawn_amount(self, amount: Decimal) -> Self
pub fn with_drawn_amount(self, amount: Decimal) -> Self
Sets the drawn amount (for revolving facilities).
Sourcepub fn with_facility_limit(self, limit: Decimal) -> Self
pub fn with_facility_limit(self, limit: Decimal) -> Self
Sets the facility limit (for revolving facilities).
Sourcepub fn total_principal_payments(&self) -> Decimal
pub fn total_principal_payments(&self) -> Decimal
Returns the total principal payments across the amortization schedule.
Sourcepub fn total_interest_payments(&self) -> Decimal
pub fn total_interest_payments(&self) -> Decimal
Returns the total interest payments across the amortization schedule.
Sourcepub fn available_capacity(&self) -> Decimal
pub fn available_capacity(&self) -> Decimal
Returns available capacity on a revolving credit facility.
Sourcepub fn all_covenants_compliant(&self) -> bool
pub fn all_covenants_compliant(&self) -> bool
Returns true if all covenants are compliant.
Trait Implementations§
Source§impl Clone for DebtInstrument
impl Clone for DebtInstrument
Source§fn clone(&self) -> DebtInstrument
fn clone(&self) -> DebtInstrument
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more