Struct rust_icu_unum::UNumberFormat[][src]

pub struct UNumberFormat { /* fields omitted */ }
Expand description

The struct for number formatting.

Implementations

impl UNumberFormat[src]

pub fn try_new_decimal_pattern_ustring(
    pattern: &UChar,
    locale: &ULoc
) -> Result<UNumberFormat, Error>
[src]

Implements unum_open, with a pattern. Since 0.3.1.

pub fn try_new_decimal_rule_based_ustring(
    rule: &UChar,
    locale: &ULoc
) -> Result<UNumberFormat, Error>
[src]

Implements unum_open, with rule-based formatting. Since 0.3.1

pub fn try_new_with_style(
    style: UNumberFormatStyle,
    locale: &ULoc
) -> Result<UNumberFormat, Error>
[src]

Implements unum_open, with style-based formatting. Since 0.3.1.

pub fn try_clone(&self) -> Result<UNumberFormat, Error>[src]

Implements unum_clone. Since 0.3.1.

pub fn format(&self, number: i32) -> Result<String, Error>[src]

Implements $function_name.

pub fn format_ustring(&self, param: i32) -> Result<UChar, Error>[src]

Implements $function_name.

pub fn format_i64(&self, number: i64) -> Result<String, Error>[src]

Implements $function_name.

pub fn format_i64_ustring(&self, param: i64) -> Result<UChar, Error>[src]

Implements $function_name.

pub fn format_f64(&self, number: f64) -> Result<String, Error>[src]

Implements $function_name.

pub fn format_f64_ustring(&self, param: f64) -> Result<UChar, Error>[src]

Implements $function_name.

pub fn format_double_for_fields_ustring<'a>(
    &'a self,
    number: f64
) -> Result<(UChar, UFieldPositionIterator<'a, *const UNumberFormat>), Error>
[src]

Implements unum_formatDoubleForFields. Since 0.3.1.

Returns a formatted Unicode string, with a field position iterator yielding the ranges of each individual formatted field as indexes into the returned string. An UTF8 version of this is not provided because the field position iterator does not give UTF8 compatible character indices.

pub fn format_decimal(&self, decimal: &str) -> Result<String, Error>[src]

Implements unum_formatDecimal. Since 0.3.1.

pub fn format_decimal_ustring(&self, decimal: &str) -> Result<UChar, Error>[src]

Implements unum_formatDecimal. Since 0.3.1.

pub fn format_double_currency(
    &self,
    number: f64,
    currency: &str
) -> Result<String, Error>
[src]

Implements unum_formatDoubleCurrency. Since 0.3.1.

pub fn format_double_currency_ustring(
    &self,
    number: f64,
    currency: &UChar
) -> Result<UChar, Error>
[src]

Implements unum_formatDoubleCurrency. Since 0.3.1

pub fn parse_to_formattable<'a>(
    &'a self,
    text: &str,
    parse_position: Option<i32>
) -> Result<UFormattable<'a>, Error>
[src]

Implements unum_parseToUFormattable. Since 0.3.1.

WARNING the parse_position parameter is with respect to the number index in the UChar string. This won’t work exactly for multibyte UTF8 values of text. If you think you will have multibyte values, use instead UNumberFormat::parse_to_formattable_ustring.

pub fn parse_to_formattable_ustring<'a>(
    &'a self,
    text: &UChar,
    parse_position: Option<i32>
) -> Result<UFormattable<'a>, Error>
[src]

Implements unum_parseToUFormattable. Since 0.3.1.

pub fn format_formattable<'a>(
    &self,
    fmt: &UFormattable<'a>
) -> Result<String, Error>
[src]

Implements unum_formatUFormattable. Since 0.3.1.

pub fn format_formattable_ustring<'a>(
    &self,
    fmt: &UFormattable<'a>
) -> Result<UChar, Error>
[src]

Implements unum_formatUFormattable. Since 0.3.1.

pub fn get_attribute(&self, attr: UNumberFormatAttribute) -> i32[src]

Implements $original_method_name. Since 0.3.1.

pub fn set_attribute(&mut self, attr: UNumberFormatAttribute, value: i32)[src]

Implements $original_method_name. Since 0.3.1.

pub fn get_double_attribute(&self, attr: UNumberFormatAttribute) -> f64[src]

Implements $original_method_name. Since 0.3.1.

pub fn set_double_attribute(&mut self, attr: UNumberFormatAttribute, value: f64)[src]

Implements $original_method_name. Since 0.3.1.

pub fn get_text_attribute(
    &self,
    tag: UNumberFormatTextAttribute
) -> Result<String, Error>
[src]

Implements unum_getTextAttribute. Since 0.3.1.

pub fn get_text_attribute_ustring(
    &self,
    tag: UNumberFormatTextAttribute
) -> Result<UChar, Error>
[src]

Implements unum_getTextAttribute. Since 0.3.1.

pub fn set_text_attribute(
    &mut self,
    tag: UNumberFormatTextAttribute,
    new_value: &str
) -> Result<(), Error>
[src]

Implements unum_setTextAttribute. Since 0.3.1.

pub fn set_text_attribute_ustring(
    &mut self,
    tag: UNumberFormatTextAttribute,
    new_value: &UChar
) -> Result<(), Error>
[src]

Implements unum_setTextAttribute. Since 0.3.1.

pub fn get_pattern(&self, is_localized: bool) -> Result<String, Error>[src]

Implements unum_toPattern. Since 0.3.1.

pub fn get_pattern_ustring(&self, is_localized: bool) -> Result<UChar, Error>[src]

Implements unum_toPattern. Since 0.3.1.

pub fn get_symbol(&self, symbol: UNumberFormatSymbol) -> Result<String, Error>[src]

Implements unum_getSymbol. Since 0.3.1.

pub fn get_symbol_ustring(
    &self,
    symbol: UNumberFormatSymbol
) -> Result<UChar, Error>
[src]

Implements unum_getSymbol. Since 0.3.1.

pub fn set_symbol(
    &mut self,
    symbol: UNumberFormatSymbol,
    value: &str
) -> Result<(), Error>
[src]

Implements unum_setSymbol. Since 0.3.1.

pub fn set_symbol_ustring(
    &mut self,
    symbol: UNumberFormatSymbol,
    value: &UChar
) -> Result<(), Error>
[src]

Implements unum_setSymbol. Since 0.3.1.

pub fn get_locale_by_type<'a>(
    &'a self,
    data_loc_type: ULocDataLocaleType
) -> Result<&'a str, Error>
[src]

Implements unum_getLocaleByType. Since 0.3.1.

pub fn get_context(
    &self,
    context_type: UDisplayContextType
) -> Result<UDisplayContext, Error>
[src]

Implements $impl_name.

pub fn set_context(&self, value: UDisplayContext) -> Result<(), Error>[src]

Implements $impl_name.

Trait Implementations

impl Debug for UNumberFormat[src]

fn fmt(&self, f: &mut Formatter<'_>) -> Result[src]

Formats the value using the given formatter. Read more

impl Drop for UNumberFormat[src]

fn drop(&mut self)[src]

Implements $impl_function_name.

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

impl<T> From<T> for T[src]

pub fn from(t: T) -> T[src]

Performs the conversion.

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

pub fn into(self) -> U[src]

Performs the conversion.

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.

pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]

Performs the conversion.

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.

pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]

Performs the conversion.