Struct amfnengine::engine::calc_utility::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
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
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
)
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
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
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
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
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
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
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
calc_manager_param: &Rc<RefCell<CalcManager>>
) -> ListSummary
Auto Trait Implementations
impl RefUnwindSafe for CalcUtility
impl Send for CalcUtility
impl Sync for CalcUtility
impl Unpin for CalcUtility
impl UnwindSafe for CalcUtility
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,