PartCurrencySymbolBuilder

Struct PartCurrencySymbolBuilder 

Source
pub struct PartCurrencySymbolBuilder<'vf, T: ValueFormatTrait> { /* private fields */ }
Expand description

The number:currency-symbol element specifies whether a currency symbol is displayed in a currency style. The content of this element is the text that is displayed as the currency symbol. If the element is empty or contains white space characters only, the default currency symbol for the currency style or the language and country of the currency style is displayed.

The number:currency-symbol element is usable within the following element:

  • number:currency-style 16.27.7.

The number:currency-symbol element has the following attributes:

  • number:country 19.342,
  • number:language 19.349,
  • number:rfc-language-tag 19.356 and
  • number:script 19.357.

The number:currency-symbol element has no child elements. The number:currency-symbol element has character data content.

Implementations§

Source§

impl<'vf, T: ValueFormatTrait> PartCurrencySymbolBuilder<'vf, T>

Source

pub fn new<'a>(valueformat: &'a mut T) -> Self
where 'a: 'vf,

New builder for the valueformat.

Source

pub fn build(self)

Appends the constructed FormatPart to the original value format.

Source

pub fn if_then<F>(self, test: bool, build: F) -> Self
where F: Fn(Self) -> Self,

Only applies the builder if the test is true.

Source

pub fn locale(self, v: Locale) -> Self

The number:language attribute specifies a language code. The country code is used for formatting properties whose evaluation is locale-dependent. If a language code is not specified, either the system settings or the setting for the system’s language are used, depending on the property whose value should be evaluated.

The number:country attribute specifies a country code for a data style. The country code is used for formatting properties whose evaluation is locale-dependent. If a country is not specified, the system settings are used. The number:country attribute on a number:currency-symbol element, specifies the country of a currency symbol.

The number:script attribute specifies a script code. The script code is used for formatting properties whose evaluation is locale-dependent. The attribute should be used only if necessary according to the rules of §2.2.3 of RFC5646, or its successors.

Source

pub fn symbol<S: Into<String>>(self, v: S) -> Self

Symbol text that is used for the currency symbol. If not set the default according to the country is used.

Trait Implementations§

Source§

impl<'vf, T: Debug + ValueFormatTrait> Debug for PartCurrencySymbolBuilder<'vf, T>

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<'vf, T> Freeze for PartCurrencySymbolBuilder<'vf, T>

§

impl<'vf, T> RefUnwindSafe for PartCurrencySymbolBuilder<'vf, T>
where T: RefUnwindSafe,

§

impl<'vf, T> Send for PartCurrencySymbolBuilder<'vf, T>
where T: Send,

§

impl<'vf, T> Sync for PartCurrencySymbolBuilder<'vf, T>
where T: Sync,

§

impl<'vf, T> Unpin for PartCurrencySymbolBuilder<'vf, T>

§

impl<'vf, T> !UnwindSafe for PartCurrencySymbolBuilder<'vf, T>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

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

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

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

Performs the conversion.