pub struct NpvPeriod { /* private fields */ }Implementations§
Source§impl NpvPeriod
impl NpvPeriod
pub fn new( period: u32, rate: f64, present_value: f64, future_value: f64, investment_value: f64, formula: String, formula_symbolic: String, ) -> Self
Sourcepub fn period(&self) -> u32
pub fn period(&self) -> u32
Returns the period number. The first real period is 1 but there’s also a period 0 which which shows the starting conditions.
Sourcepub fn rate(&self) -> f64
pub fn rate(&self) -> f64
Returns the periodic rate for the current period. If the containing struct is a
TvmSolution every period will have the same rate. If it’s a [TvmSchedule] each period
may have a different rate.
Sourcepub fn present_value(&self) -> f64
pub fn present_value(&self) -> f64
Returns the present value of the cashflow.
Sourcepub fn future_value(&self) -> f64
pub fn future_value(&self) -> f64
Returns the future value of the cashflow.
Sourcepub fn investment_value(&self) -> f64
pub fn investment_value(&self) -> f64
Returns the investment value of the Npv scenario at the time of the current period.
Sourcepub fn formula(&self) -> &str
pub fn formula(&self) -> &str
Returns a text version of the formula used to calculate the value for the current period.
The formula includes the actual values rather than variable names. For the formula with
variables such as pv for present value call formula_symbolic.
Sourcepub fn formula_symbolic(&self) -> &str
pub fn formula_symbolic(&self) -> &str
Returns a text version of the formula used to calculate the value for the current period.
The formula includes variables such as r for the rate. For the formula with actual values
rather than variables call formula.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for NpvPeriod
impl RefUnwindSafe for NpvPeriod
impl Send for NpvPeriod
impl Sync for NpvPeriod
impl Unpin for NpvPeriod
impl UnsafeUnpin for NpvPeriod
impl UnwindSafe for NpvPeriod
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more