Struct amfnengine::engine::calc_utility::CalcUtility[]

pub struct CalcUtility {}

Implementations

impl CalcUtility

The AmFn utility methods implementation.

pub fn convert_currency_event(
    calc_manager_param: &Ref<'_, CalcManager>,
    cashflow_currency_code: &str,
    event_currency_code: &str,
    value: Decimal
) -> Decimal

Convert a value from the cashflow code to the event code. Cross rates are used if the exchange rate is unavailable and the cross rate international currency code is not empty.

Arguments

  • value - The value to convert.

Return

  • See description.

pub fn create_event_type_list_parameter(
    calc_manager_param: &Rc<RefCell<CalcManager>>,
    elem_type: ExtensionType,
    elem_extension: &ElemExtension
) -> ListParameter

Create the event type parameter list.

Arguments

  • calc_manager_param - Calculation manager.
  • elem_type - Type of the event.
  • elem_extension - A ElemPrincipalChange, ElemCurrentValue, ElemInterestChange, or ElemStatisticValue element.

Return

  • See description.

pub fn evaluate_descriptors(
    calc_manager_param: &Rc<RefCell<CalcManager>>,
    expression: &RefCell<CalcExpression>,
    list_parameter: &ListParameter,
    list_descriptor: &ListDescriptor
)

Evaluate all of the descriptors in the list. For each descriptor that specifies an expression, execute the expression using the list of parameters.

Arguments

  • calc_manager_param - Calculation manager.
  • expression - CalcExpression element.
  • list_parameter - List of parameters used with evaluation.
  • list_descriptor - List of descriptors to evaluate.

pub fn evaluate_expression(
    calc_manager_param: &Rc<RefCell<CalcManager>>,
    list_parameter: Option<&ListParameter>,
    expression_str: &str,
    cashflow: bool
) -> ElemSymbol

Evaluate the expression.

Arguments

  • calc_manager_param - Calculation manager.
  • list_parameter - List of parameters used with evaluation.
  • expression_str - The expression to evaluate.
  • cashflow - Search the cashflow preferences.

Return

  • Resulting symbol if successful, otherwise an error message in the symbol.

pub fn get_event_value(
    calc_manager_param: &Rc<RefCell<CalcManager>>,
    elem_column: &ElemColumn
) -> String

Get the appropriate event list value as a string.

Arguments

  • calc_manager_param - Calculation manager.
  • elem_column - Column element.

Return

  • See description.

pub fn get_am_value(
    calc_manager_param: &Rc<RefCell<CalcManager>>,
    elem_column: &ElemColumn,
    list_am: &ListAmortization
) -> String

Get the appropriate amortization list value as a string.

Arguments

  • calc_manager_param - Calculation manager.
  • elem_column - Column element.
  • list_am_opt - Amortization list.

Return

  • See description.

pub fn is_event_column_empty(
    calc_manager_param: &Rc<RefCell<CalcManager>>,
    elem_column: &ElemColumn
) -> bool

Determine if the event column is empty.

Arguments

  • calc_manager_param - Calculation manager.
  • elem_column - Column element.
  • elem_type - The type of table.

Return

  • See description.

pub fn normalize_expression(
    calc_manager_param: &Rc<RefCell<CalcManager>>,
    expression: &str,
    new_line: bool
) -> String

Normalize the expression.

Arguments

  • calc_manager_param - Calculation manager.
  • expression - The expression to normalize.
  • new_line - If true, format with a newline character between expressions.

Return

  • Normalized expression.

pub fn parse_columns(
    calc_manager_param: &Rc<RefCell<CalcManager>>,
    elem_type: TableType,
    cashflow: bool
) -> ListColumn

Create and return a column list object.

Arguments

  • calc_manager_param - Calculation manager.
  • elem_type - The type of table.
  • cashflow - Search the cashflow preferences.

Return

  • See description.

pub fn parse_summary(
    calc_manager_param: &Rc<RefCell<CalcManager>>
) -> ListSummary

Create and return a summary list object.

Arguments

  • calc_manager_param - Calculation manager.

Return

  • See description.

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.