Struct amfnengine::engine::calc_manager::CalcManager
[−]pub struct CalcManager { /* private fields */ }
Implementations
impl CalcManager
impl CalcManager
The manager implementation of the AmFn engine component.
pub fn new(core_manager_param: CoreManager) -> CalcManager
pub fn new(core_manager_param: CoreManager) -> CalcManager
pub fn init_calc_manager(&mut self, calc_manager: &Rc<RefCell<CalcManager>>)
pub fn init_calc_manager(&mut self, calc_manager: &Rc<RefCell<CalcManager>>)
pub fn core_manager(&self) -> &CoreManager
pub fn core_manager(&self) -> &CoreManager
pub fn clear(&mut self)
pub fn clear(&mut self)
Clear all engine elements and lists.
pub fn copy_template_events(
&self,
calc_manager: &Rc<RefCell<CalcManager>>,
date_param: usize,
end_date_param: usize,
new_date_param: usize,
frequency_param: FrequencyType
) -> Result<ListEvent, ErrorType>
pub fn copy_template_events(
&self,
calc_manager: &Rc<RefCell<CalcManager>>,
date_param: usize,
end_date_param: usize,
new_date_param: usize,
frequency_param: FrequencyType
) -> Result<ListEvent, ErrorType>
Copies the event list from the currently selected template event into a new event list.
Arguments
calc_manager
- Calculation manager.date_param
- Base starting date for the new event(s).end_date_param
- Base ending date for the new event(s).new_date_param
- Next date for the new event(s) (i.e., normally end_date_param plus one period).frequency_param
- Next frequency for the new event(s).
Return
- The new event list, otherwise an error code.
pub fn combine_principal(&self, cashflow: bool) -> bool
pub fn combine_principal(&self, cashflow: bool) -> bool
pub fn compress_descriptor(&self, cashflow: bool) -> bool
pub fn compress_descriptor(&self, cashflow: bool) -> bool
pub fn cross_rate_code(&self, cashflow: bool) -> &str
pub fn cross_rate_code(&self, cashflow: bool) -> &str
pub fn fiscal_year_start(&self, cashflow: bool) -> usize
pub fn fiscal_year_start(&self, cashflow: bool) -> usize
pub fn decimal_digits(&self, cashflow: bool) -> usize
pub fn decimal_digits(&self, cashflow: bool) -> usize
pub fn default_encoding(&self, cashflow: bool) -> &str
pub fn default_encoding(&self, cashflow: bool) -> &str
pub fn target(&self) -> Decimal
pub fn target(&self) -> Decimal
Get the resolved target value. The cashflow and user preferences are searched in that order.
Return
- See description.
pub fn descriptor_value(
&self,
group: &str,
name: &str,
desc_type: &str,
code: &str,
cashflow: bool,
is_event: bool
) -> String
pub fn descriptor_value(
&self,
group: &str,
name: &str,
desc_type: &str,
code: &str,
cashflow: bool,
is_event: bool
) -> String
Searches the various descriptor lists, from lowest to highest, and returns the constant value for a group, name, type, and code.
Arguments
group
- The group name of the descriptor.name
- The name of the descriptor.desc_type
- The type of the descriptor.code
- The code of the descriptor.cashflow
- Search the cashflow descriptor list.is_event
- Search the event descriptor list.
Return
- See description.
pub fn list_locale(&self) -> &ListLocale
pub fn list_locale(&self) -> &ListLocale
pub fn list_locale_mut(&mut self) -> &mut ListLocale
pub fn list_locale_mut(&mut self) -> &mut ListLocale
pub fn preferences(&self) -> &ElemPreferences
pub fn preferences(&self) -> &ElemPreferences
pub fn preferences_mut(&mut self) -> &mut ElemPreferences
pub fn preferences_mut(&mut self) -> &mut ElemPreferences
pub fn list_cashflow(&self) -> &ListCashflow
pub fn list_cashflow(&self) -> &ListCashflow
pub fn list_cashflow_mut(&mut self) -> &mut ListCashflow
pub fn list_cashflow_mut(&mut self) -> &mut ListCashflow
pub fn list_template_group(&self) -> &ListTemplateGroup
pub fn list_template_group(&self) -> &ListTemplateGroup
pub fn list_template_group_mut(&mut self) -> &mut ListTemplateGroup
pub fn list_template_group_mut(&mut self) -> &mut ListTemplateGroup
pub fn list_exchange_rate(&self) -> &ListExchangeRate
pub fn list_exchange_rate(&self) -> &ListExchangeRate
pub fn list_exchange_rate_mut(&mut self) -> &mut ListExchangeRate
pub fn list_exchange_rate_mut(&mut self) -> &mut ListExchangeRate
pub fn get_error_string(&self, error: ErrorType) -> String
pub fn get_error_string(&self, error: ErrorType) -> String
pub fn statistic_events(&self, cashflow: bool) -> bool
pub fn statistic_events(&self, cashflow: bool) -> bool
pub fn updating_json(&self) -> bool
pub fn updating_json(&self) -> bool
pub fn set_list_locale(&mut self, list_locale: ListLocale)
pub fn set_list_locale(&mut self, list_locale: ListLocale)
pub fn set_preferences(&mut self, preferences: ElemPreferences)
pub fn set_preferences(&mut self, preferences: ElemPreferences)
pub fn set_list_cashflow(&mut self, list_cashflow: ListCashflow)
pub fn set_list_cashflow(&mut self, list_cashflow: ListCashflow)
pub fn set_list_template_group(
&mut self,
list_template_group: ListTemplateGroup
)
pub fn set_list_template_group(
&mut self,
list_template_group: ListTemplateGroup
)
pub fn set_list_exchange_rate(&mut self, list_exchange_rate: ListExchangeRate)
pub fn set_list_exchange_rate(&mut self, list_exchange_rate: ListExchangeRate)
pub fn set_updating_json(&self, value_param: bool)
pub fn set_updating_json(&self, value_param: bool)
pub fn col_name_resource_key(column_value: ColumnType) -> String
pub fn col_name_resource_key(column_value: ColumnType) -> String
pub fn util_date_diff(
date1: usize,
date2: usize,
frequency: FrequencyType,
intervals: usize,
eom: bool
) -> i32
pub fn util_date_diff(
date1: usize,
date2: usize,
frequency: FrequencyType,
intervals: usize,
eom: bool
) -> i32
Calculates number of intervals between two dates. If intDate2 is greater than or equal to intDate1, the result will be positive, otherwise the result will be negative.
Arguments
date1
- First date in YYYYMMDD format.date2
- Second date in YYYYMMDD format.frequency
- Date frequency.intervals
- Number of intervals of frequency.eom
- Adjust successive dates to end of month.
Return
- Number of intervals (positive or negative).
pub fn util_date_newi(
event_date: usize,
periods: usize,
frequency: FrequencyType,
intervals: i32,
eom: bool
) -> usize
pub fn util_date_newi(
event_date: usize,
periods: usize,
frequency: FrequencyType,
intervals: i32,
eom: bool
) -> usize
Calculates a new date based upon a given date and number of intervals. If intervals is positive, the resulting date will be greater than event_date, otherwise the resulting date will be less than event_date.
Arguments
event_date
- Date in YYYYMMDD format.periods
- Number of periods.frequency
- Date frequency.intervals
- Number of intervals of frequency.eom
- Adjust successive dates to end of month.
Return
- New date in YYYYMMDD format.
pub fn util_date_new(
event_date: usize,
periods: usize,
frequency: FrequencyType,
intervals: usize,
eom: bool
) -> usize
pub fn util_date_new(
event_date: usize,
periods: usize,
frequency: FrequencyType,
intervals: usize,
eom: bool
) -> usize
Calculates a new date based upon a given date and number of intervals.
Arguments
event_date
- Date in YYYYMMDD format.periods
- Number of periods.frequency
- Date frequency.intervals
- Number of intervals of frequency.eom
- Adjust successive dates to end of month.
Return
- New date in YYYYMMDD format.
pub fn util_date_now() -> usize
pub fn util_date_now() -> usize
pub fn util_intervals_in_year(frequency: FrequencyType) -> usize
pub fn util_intervals_in_year(frequency: FrequencyType) -> usize
pub fn util_intervals_in_year_by_name(frequency: &str) -> usize
pub fn util_intervals_in_year_by_name(frequency: &str) -> usize
pub fn util_rate_dr_to_nar(dr: Decimal, days_in_year: usize) -> Decimal
pub fn util_rate_dr_to_nar(dr: Decimal, days_in_year: usize) -> Decimal
pub fn util_rate_ear_to_nar(
ear: Decimal,
compound_frequency: FrequencyType,
days_in_year: usize
) -> Decimal
pub fn util_rate_ear_to_nar(
ear: Decimal,
compound_frequency: FrequencyType,
days_in_year: usize
) -> Decimal
pub fn util_rate_nar_to_dr(nar: Decimal, days_in_year: usize) -> Decimal
pub fn util_rate_nar_to_dr(nar: Decimal, days_in_year: usize) -> Decimal
pub fn util_rate_nar_to_ear(
nar: Decimal,
compound_frequency: FrequencyType,
days_in_year: usize
) -> Decimal
pub fn util_rate_nar_to_ear(
nar: Decimal,
compound_frequency: FrequencyType,
days_in_year: usize
) -> Decimal
pub fn util_rate_nar_to_pr(
nar: Decimal,
frequency: FrequencyType,
days_in_year: usize
) -> Decimal
pub fn util_rate_nar_to_pr(
nar: Decimal,
frequency: FrequencyType,
days_in_year: usize
) -> Decimal
pub fn util_rate_pr_to_nar(
pr: Decimal,
frequency: FrequencyType,
days_in_year: usize
) -> Decimal
pub fn util_rate_pr_to_nar(
pr: Decimal,
frequency: FrequencyType,
days_in_year: usize
) -> Decimal
Auto Trait Implementations
impl !RefUnwindSafe for CalcManager
impl !Send for CalcManager
impl !Sync for CalcManager
impl Unpin for CalcManager
impl !UnwindSafe for CalcManager
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more