pub struct TemporalDebt {
pub id: TemporalId,
pub description: String,
pub principal_minutes: u32,
pub interest_rate: f64,
pub compound_period_secs: i64,
pub incurred_at: DateTime<Utc>,
pub current_total_minutes: u32,
pub blocking: Vec<String>,
pub category: DebtCategory,
pub paid_at: Option<DateTime<Utc>>,
}Expand description
A unit of temporal debt — postponed work that compounds over time.
Fields§
§id: TemporalIdUnique identifier.
description: StringWhat was deferred.
principal_minutes: u32Original time cost in minutes.
interest_rate: f64Interest rate (fraction per compound period).
compound_period_secs: i64How often interest compounds (seconds).
incurred_at: DateTime<Utc>When the debt was incurred.
current_total_minutes: u32Current total including interest (minutes).
blocking: Vec<String>What this debt is blocking.
category: DebtCategoryCategory of debt.
paid_at: Option<DateTime<Utc>>When the debt was paid off (if it has been).
Implementations§
Source§impl TemporalDebt
impl TemporalDebt
Sourcepub fn new(
description: &str,
principal_minutes: u32,
category: DebtCategory,
) -> Self
pub fn new( description: &str, principal_minutes: u32, category: DebtCategory, ) -> Self
Create a new temporal debt with default 10% interest rate and 7-day compound period.
Sourcepub fn calculate_current_total(&self) -> u32
pub fn calculate_current_total(&self) -> u32
Calculate the current total debt including compound interest.
Uses the formula: P * (1 + r)^n where:
- P = principal_minutes
- r = interest_rate per compound period
- n = number of compound periods elapsed
Trait Implementations§
Source§impl Clone for TemporalDebt
impl Clone for TemporalDebt
Source§fn clone(&self) -> TemporalDebt
fn clone(&self) -> TemporalDebt
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 TemporalDebt
impl Debug for TemporalDebt
Source§impl<'de> Deserialize<'de> for TemporalDebt
impl<'de> Deserialize<'de> for TemporalDebt
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 TemporalDebt
impl RefUnwindSafe for TemporalDebt
impl Send for TemporalDebt
impl Sync for TemporalDebt
impl Unpin for TemporalDebt
impl UnsafeUnpin for TemporalDebt
impl UnwindSafe for TemporalDebt
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