Struct amfnengine::core::list_statistic_helper::ListStatisticHelper[]

pub struct ListStatisticHelper { /* fields omitted */ }

Implementations

impl ListStatisticHelper

List of statistic helper elements implementation.

pub fn new() -> ListStatisticHelper

Create and return a new statistic helper.

Return

  • See description.

pub fn add_statistic_helper(
    &mut self,
    name_param: &str,
    last_date_param: usize,
    elem_am_index_param: usize
) -> bool

Add a new statistic into the statistics list.

Arguments

  • name_param - Name of the statistic.
  • last_date_param - The last statistic event date.
  • elem_am_index_param - Index of the amortization element.

Return

  • True if successful, otherwise false.

pub fn copy(&self) -> ListStatisticHelper

Performs a deep copy of this statistic helper list and returns a new statistic helper.

Return

  • See description.

pub fn name(&self) -> &str

Get the name of the statistic.

Return

  • See description.

pub fn principal_decrease(&self) -> Decimal

Get the accumulated principal decrease for statistics period.

Return

  • See description.

pub fn principal_increase(&self) -> Decimal

Get the accumulated principal increase for statistics period.

Return

  • See description.

pub fn interest(&self) -> Decimal

Get the accumulated compounded interest for period.

Return

  • See description.

pub fn sl_interest(&self) -> Decimal

Get the accumulated straight-line interest for period.

Return

  • See description.

pub fn value_to_interest(&self) -> Decimal

Get the accumulated value to interest for period.

Return

  • See description.

pub fn value_to_principal(&self) -> Decimal

Get the accumulated value to principal for period.

Return

  • See description.

pub fn last_date(&self) -> usize

Get the last statistic event date.

Return

  • See description.

pub fn elem_am_index(&self) -> usize

Get the index of the ListAmortization.ElemAmortization object.

Return

  • See description.

pub fn get_element_by_name(&self, name_param: &str) -> bool

Select a statistic based upon a name.

Arguments

  • name_param - The name of the statistic to select.

Return

  • True if successful, otherwise false.

pub fn incr_principal_decrease(
    &mut self,
    principal_decrease_param: Decimal
) -> bool

Increment the accumulated principal decrease for statistics period.

Arguments

  • principal_decrease_param - See description.

Return

  • True if successful, otherwise false.

pub fn incr_principal_increase(
    &mut self,
    principal_increase_param: Decimal
) -> bool

Increment the accumulated principal increase for statistics period.

Arguments

  • principal_increase_param - See description.

Return

  • True if successful, otherwise false.

pub fn incr_interest(&mut self, interest_param: Decimal) -> bool

Increment the accumulated compounded interest for period.

Arguments

  • interest_param - See description.

Return

  • True if successful, otherwise false.

pub fn incr_sl_interest(&mut self, sl_interest_param: Decimal) -> bool

Increment the accumulated straight-line interest for period.

Arguments

  • sl_interest_param - See description.

Return

  • True if successful, otherwise false.

pub fn incr_value_to_interest(
    &mut self,
    value_to_interest_param: Decimal
) -> bool

Increment the accumulated value to interest for period.

Arguments

  • value_to_interest_param - See description.

Return

  • True if successful, otherwise false.

pub fn incr_value_to_principal(
    &mut self,
    value_to_principal_param: Decimal
) -> bool

Increment the accumulated value to principal for period.

Arguments

  • value_to_principal_param - See description.

Return

  • True if successful, otherwise false.

pub fn remove(&mut self) -> bool

Remove the selected statistic from the statistic list.

Return

  • True if successful, otherwise false.

pub fn reset(&mut self) -> bool

Reset all statistic accumulators.

Return

  • True if successful, otherwise false.

pub fn set_last_date(&mut self, last_date_param: usize) -> bool

Set the last statistic event date.

Arguments

  • last_date_param - See description.

Return

  • True if successful, otherwise false.

pub fn set_elem_am_index(&mut self, elem_am_index_param: usize) -> bool

Set the index of the ListAmortization.ElemAmortization object.

Arguments

  • elem_am_index_param - See description.

Return

  • True if successful, otherwise false.

Trait Implementations

impl Default for ListStatisticHelper

List of statistic helper elements default implementation.

fn default() -> Self

Create and return a new statistic helper.

Return

  • See description.

impl ListTrait for ListStatisticHelper

List of statistic helper list implementation.

fn clear(&mut self)

Clear all statistics from the statistic list.

fn count(&self) -> usize

Get the count of the statistic helper list.

Return

  • See description.

fn index(&self) -> usize

Get the index of the selected statistic (starting from 0).

Return

  • See description.

fn get_element(&self, index_param: usize) -> bool

Select a statistic based upon an index value.

Arguments

  • index_param - Index value of the statistic to select (starting from 0).

Return

  • True if successful, otherwise false.

fn set_index(&self, index_param: usize) -> bool

Set the list index.

Arguments

  • index_param - See description.

Return

  • True if successful, otherwise false.

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.