Skip to main content

Digits

Struct Digits 

Source
pub struct Digits<'n> { /* private fields */ }
Expand description

Digits to show (plans/03-runtime.md §2.7): a resolved number’s rounded display digits (Number::digits), or a number’s exact value (Number::exact_digits) — what mf2-fn-number localizes.

Implementations§

Source§

impl Digits<'_>

Source

pub fn sign(&self) -> Sign

The sign (for display digits, after signDisplay).

Source

pub fn integer_count(&self) -> u16

The number of integer digits shown (≥ 1; for display digits, after minimumIntegerDigits).

Source

pub fn fraction_count(&self) -> u16

The number of fraction digits shown.

Source

pub fn digit(&self, magnitude: i16) -> u8

The digit (0–9) worth 10^magnitude: the integer digits are at magnitudes 0 .. integer_count, the fraction digits at -1 ..= -fraction_count; 0 anywhere else.

Source

pub fn is_zero(&self) -> bool

Whether every digit is 0.

Source

pub fn write_neutral(&self, out: &mut dyn Sink)

Writes the core’s neutral output: ASCII digits, ., -/+, no grouping.

Source

pub fn neutral_parts(&self, out: &mut dyn SubPartSink)

The neutral output as sub-parts (minusSign, plusSign, integer, decimal, fraction).

Source

pub fn operands(&self) -> Operands

The CLDR plural operands of these digits as shown (1.0 has v = 1): what a unit or currency name’s plural form is chosen by ([crate::plural_category]).

Trait Implementations§

Source§

impl<'n> Clone for Digits<'n>

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<'n> Copy for Digits<'n>

Source§

impl Debug for Digits<'_>

The sign and how many integer and fraction digits are shown; not the digits, whose writer a client’s formatting calls.

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<'n> Freeze for Digits<'n>

§

impl<'n> RefUnwindSafe for Digits<'n>

§

impl<'n> Send for Digits<'n>

§

impl<'n> Sync for Digits<'n>

§

impl<'n> Unpin for Digits<'n>

§

impl<'n> UnsafeUnpin for Digits<'n>

§

impl<'n> UnwindSafe for Digits<'n>

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

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

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

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.