Struct amfnengine::core::list_locale::ListLocale[]

pub struct ListLocale { /* fields omitted */ }

Implementations

impl ListLocale

List of locales implementation.

pub fn new() -> ListLocale

Create and return a new list of locale elements.

Return

  • See description.

pub fn add_locale(
    &mut self,
    locale_str_param: &str,
    currency_code_param: &str,
    decimal_digits_param: usize,
    date_in_format_param: ElemLocaleFormat,
    date_out_format_param: ElemLocaleFormat,
    resources_param: HashMap<String, String>
)

Add a new locale to the locale list.

Arguments

  • locale_str_param - ISO language code (ISO 639)_ISO country code (ISO 3166).
  • currency_code_param - ISO currency code (ISO 4217).
  • decimal_digits_param - Currency decimal digits.
  • date_in_format - Date in format.
  • date_out_format - Date out format.
  • resources_param - Resources hash map.

pub fn copy(&self) -> ListLocale

Copy the locale list and return a new locale list.

Arguments

  • event - Check event level.

Return

  • See description.

pub fn list(&self) -> &Vec<ElemLocale>

Get the list of locales.

Return

  • See description.

pub fn list_mut(&mut self) -> &mut Vec<ElemLocale>

Get the mut list of locales.

Return

  • See description.

pub fn clear(&mut self)

Clear all locales selects.

pub fn locale_str(&self, event: bool) -> &str

Get the locale string.

Arguments

  • event - Check event level.

Return

  • See description.

pub fn currency_code(&self, event: bool) -> &str

Get the currency code.

Arguments

  • event - Check event level.

Return

  • See description.

pub fn decimal_digits(&self, event: bool) -> usize

Get the decimal digits.

Arguments

  • event - Check event level.

Return

  • See description.

pub fn format_in(&self, event: bool) -> &ElemLocaleFormat

Get the format in.

Arguments

  • event - Check event level.

Return

  • See description.

pub fn format_out(&self, event: bool) -> &ElemLocaleFormat

Get the format out.

Arguments

  • event - Check event level.

Return

  • See description.

pub fn resources(&self, event: bool) -> &HashMap<String, String>

Get the resources.

Arguments

  • event - Check event level.

Return

  • See description.

pub fn user_locale(&self) -> &ElemLocale

Get the user locale.

Return

  • See description.

pub fn cashflow_locale(&self) -> &ElemLocale

Get the cashflow locale.

Return

  • See description.

pub fn event_locale(&self) -> &ElemLocale

Get the event locale.

Return

  • See description.

pub fn cashflow_currency_code(&self) -> &str

Return the cashflow currency code.

Return

  • See description.

pub fn event_currency_code(&self) -> &str

Return the event currency code.

Return

  • See description.

pub fn format_date(&self, val: usize) -> String

Format and return a date string.

Arguments

  • val - The usize date value to format.

Return

  • See description.

pub fn format_integeri(&self, val: i32) -> String

Format and return an integer string.

Arguments

  • val - The i32 value to format.

Return

  • See description.

pub fn format_integer(&self, val: usize) -> String

Format and return an integer string.

Arguments

  • val - The usize value to format.

Return

  • See description.

pub fn format_decimal(&self, val: Decimal) -> String

Format and return a decimal string.

Arguments

  • val - The decimal value to format.

Return

  • See description.

pub fn format_currency(&self, val: Decimal, decimal_digits: usize) -> String

Format and return a currency string.

Arguments

  • val - The decimal value to format.
  • decimal_digits - The number of decimal digits to round.

Return

  • See description.

pub fn get_locale_index(&self, event: bool) -> usize

Get the most relevant locale index.

Arguments

  • event - Check event level.

Return

  • See description.

pub fn get_locale(&self, event: bool) -> &ElemLocale

Get the most relevant locale.

Arguments

  • event - Check event level.

Return

  • See description.

pub fn get_locale_str(&self, event: bool) -> &str

Get the most relevant locale string.

Arguments

  • event - Check event level.

Return

  • See description.

pub fn get_resource(&self, key: &str) -> &str

Get the resource string for the locale.

Arguments

  • key - The resource key.

Return

  • See description.

pub fn select_user_locale(&mut self, locale_str_param: &str)

Select a user locale parameter.

Arguments

  • locale_str_param - Locale string to select.

pub fn select_cashflow_locale(&mut self, locale_str_param: &str)

Select a cashflow locale parameter.

Arguments

  • locale_str_param - Locale string to select.

pub fn select_event_locale(&mut self, locale_str_param: &str)

Select an event locale parameter.

Arguments

  • locale_str_param - Locale string to select.

Trait Implementations

impl Default for ListLocale

List of locales default implementation.

fn default() -> Self

Create and return a new list of locale elements.

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.