pub struct FormattedNumberProps {Show 15 fields
pub value: FormattedNumberValue,
pub format: FormattedNumberFormat,
pub currency: Option<String>,
pub currency_display: FormattedNumberCurrencyDisplay,
pub currency_name: FormattedNumberCurrencyName,
pub unit: Option<String>,
pub unit_display: FormattedNumberUnitDisplay,
pub notation: FormattedNumberNotation,
pub sign_display: FormattedNumberSignDisplay,
pub minimum_fraction_digits: Option<f64>,
pub maximum_fraction_digits: Option<f64>,
pub locale: Option<String>,
pub fallback: String,
pub class: Option<String>,
pub attributes: Vec<Attribute>,
}Expand description
Props for FormattedNumber.
Fields§
§value: FormattedNumberValueThe number, or a plain decimal string such as "1234.5" or "2e3".
format: FormattedNumberFormatNumber style.
currency: Option<String>ISO 4217 code such as USD. Required by FormattedNumberFormat::Currency.
currency_display: FormattedNumberCurrencyDisplayHow the currency is shown.
currency_name: FormattedNumberCurrencyNameWhen the full currency name is read to assistive technology.
unit: Option<String>A sanctioned unit such as kilobyte or kilometer-per-hour. Required by
FormattedNumberFormat::Unit.
unit_display: FormattedNumberUnitDisplayHow the unit is shown.
notation: FormattedNumberNotationStandard, scientific, engineering, or compact notation.
sign_display: FormattedNumberSignDisplayWhen to show the sign.
minimum_fraction_digits: Option<f64>Minimum fraction digits, clamped to 0 through 20.
maximum_fraction_digits: Option<f64>Maximum fraction digits, clamped to 0 through 20 and never below the minimum.
locale: Option<String>BCP 47 locale, including a Unicode numbering-system extension. Defaults to English; malformed or unsupported language tags also use English.
fallback: StringText shown when value is not a finite number.
class: Option<String>Extra classes appended after the Lumen class.
attributes: Vec<Attribute>Any other global attribute.
Implementations§
Source§impl FormattedNumberProps
impl FormattedNumberProps
Sourcepub fn builder() -> FormattedNumberPropsBuilder<((), (), (), (), (), (), (), (), (), (), (), (), (), (), ())>
pub fn builder() -> FormattedNumberPropsBuilder<((), (), (), (), (), (), (), (), (), (), (), (), (), (), ())>
Create a builder for building FormattedNumberProps.
On the builder, call .value(...), .format(...)(optional), .currency(...)(optional), .currency_display(...)(optional), .currency_name(...)(optional), .unit(...)(optional), .unit_display(...)(optional), .notation(...)(optional), .sign_display(...)(optional), .minimum_fraction_digits(...)(optional), .maximum_fraction_digits(...)(optional), .locale(...)(optional), .fallback(...)(optional), .class(...)(optional), .attributes(...)(optional) to set the values of the fields.
Finally, call .build() to create the instance of FormattedNumberProps.
Trait Implementations§
Source§impl Clone for FormattedNumberProps
impl Clone for FormattedNumberProps
Source§impl PartialEq for FormattedNumberProps
impl PartialEq for FormattedNumberProps
Source§impl Properties for FormattedNumberPropswhere
Self: Clone,
impl Properties for FormattedNumberPropswhere
Self: Clone,
Source§type Builder = FormattedNumberPropsBuilder<((), (), (), (), (), (), (), (), (), (), (), (), (), (), ())>
type Builder = FormattedNumberPropsBuilder<((), (), (), (), (), (), (), (), (), (), (), (), (), (), ())>
Source§fn memoize(&mut self, new: &Self) -> bool
fn memoize(&mut self, new: &Self) -> bool
Source§fn into_vcomponent<M>(
self,
render_fn: impl ComponentFunction<Self, M>,
) -> VComponentwhere
M: 'static,
fn into_vcomponent<M>(
self,
render_fn: impl ComponentFunction<Self, M>,
) -> VComponentwhere
M: 'static,
impl StructuralPartialEq for FormattedNumberProps
Auto Trait Implementations§
impl !RefUnwindSafe for FormattedNumberProps
impl !Send for FormattedNumberProps
impl !Sync for FormattedNumberProps
impl !UnwindSafe for FormattedNumberProps
impl Forget for FormattedNumberProps
impl Freeze for FormattedNumberProps
impl Move for FormattedNumberProps
impl Unpin for FormattedNumberProps
impl UnsafeUnpin for FormattedNumberPropswhere
*const u8 is !null: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
PhantomData<Attribute>: UnsafeUnpin,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DependencyElement for T
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> InitializeFromFunction<T> for T
impl<T> InitializeFromFunction<T> for T
Source§fn initialize_from_function(f: fn() -> T) -> T
fn initialize_from_function(f: fn() -> T) -> T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more