[][src]Struct finance_solution::NpvSolution

pub struct NpvSolution { /* fields omitted */ }

The custom solution information of a NPV scenario. The struct values are immutable by the user of the library.

Implementations

impl NpvSolution[src]

pub fn new(
    rates: Vec<f64>,
    periods: u32,
    initial_investment: f64,
    cashflows: Vec<f64>,
    sum_of_cashflows: f64,
    sum_of_discounted_cashflows: f64,
    net_present_value: f64
) -> Self
[src]

Create a new instance of the struct

pub fn series(&self) -> NpvSeries[src]

pub fn rate_avg(&self) -> f64[src]

Call rate_avg on a NpvSolution to get the simple average rate of a schedule;

pub fn rates(&self) -> &[f64][src]

Returns the rate schedule

pub fn periods(&self) -> u32[src]

Returns the number of periods as u32.

pub fn initial_investment(&self) -> f64[src]

Returns the initial investment as f64.

pub fn cashflows(&self) -> &[f64][src]

Returns a Vec of the cashflows.

pub fn sum_of_cashflows(&self) -> f64[src]

Returns the sum of the cashflows at their future value.

pub fn sum_of_discounted_cashflows(&self) -> f64[src]

Returns the sum of the cashflows at their present value.

pub fn net_present_value(&self) -> f64[src]

Returns the net present value as f64.

pub fn npv(&self) -> f64[src]

Alias for net_present_value()

pub fn print_table(&self)[src]

Pretty-print a table of the calculations at each period for visual analysis.

pub fn print_table_locale(&self, locale: &Locale, precision: usize)[src]

Pretty-print a table of the calculations at each period for visual analysis, and provide a Locale for monetary formatting and preferred decimal precision.

pub fn max_discounted_cashflow(&self) -> f64[src]

Return the max discounted cashflow (present value of the cashflow)

pub fn min_discounted_cashflow(&self) -> f64[src]

Return the min discounted cashflow (present value of the cashflow)

Trait Implementations

impl Debug for NpvSolution[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.