pub struct PriceFormatterBuilder { /* private fields */ }Expand description
Builder for creating price formatters
Implementations§
Source§impl PriceFormatterBuilder
impl PriceFormatterBuilder
Sourcepub fn with_precision(self, precision: usize) -> Self
pub fn with_precision(self, precision: usize) -> Self
Set precision
Sourcepub fn with_currency(self, symbol: impl Into<String>) -> Self
pub fn with_currency(self, symbol: impl Into<String>) -> Self
Set currency symbol
Sourcepub fn as_percentage(self) -> Self
pub fn as_percentage(self) -> Self
Enable percentage formatting
Sourcepub fn build(self) -> Box<dyn PriceFormatter>
pub fn build(self) -> Box<dyn PriceFormatter>
Build the formatter
Trait Implementations§
Auto Trait Implementations§
impl Freeze for PriceFormatterBuilder
impl RefUnwindSafe for PriceFormatterBuilder
impl Send for PriceFormatterBuilder
impl Sync for PriceFormatterBuilder
impl Unpin for PriceFormatterBuilder
impl UnsafeUnpin for PriceFormatterBuilder
impl UnwindSafe for PriceFormatterBuilder
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
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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> ⓘ
Converts
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> ⓘ
Converts
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