#[non_exhaustive]pub struct PrettyDecimal {
pub format: Option<Format>,
pub value: Decimal,
}Expand description
Decimal with the original format information encoded.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.format: Option<Format>Format of the decimal, None means there’s no associated information.
value: DecimalImplementations§
Source§impl PrettyDecimal
impl PrettyDecimal
Sourcepub const fn unformatted(value: Decimal) -> Self
pub const fn unformatted(value: Decimal) -> Self
Constructs unformatted PrettyDecimal.
Sourcepub fn set_sign_positive(&mut self, positive: bool)
pub fn set_sign_positive(&mut self, positive: bool)
Sets the sign positive.
Sourcepub const fn is_sign_positive(&self) -> bool
pub const fn is_sign_positive(&self) -> bool
Returns true if the value is positive.
Trait Implementations§
Source§impl Clone for PrettyDecimal
impl Clone for PrettyDecimal
Source§fn clone(&self) -> PrettyDecimal
fn clone(&self) -> PrettyDecimal
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for PrettyDecimal
impl Debug for PrettyDecimal
Source§impl Default for PrettyDecimal
impl Default for PrettyDecimal
Source§fn default() -> PrettyDecimal
fn default() -> PrettyDecimal
Returns the “default value” for a type. Read more
Source§impl Display for PrettyDecimal
impl Display for PrettyDecimal
Source§impl From<PrettyDecimal> for Decimal
impl From<PrettyDecimal> for Decimal
Source§fn from(value: PrettyDecimal) -> Self
fn from(value: PrettyDecimal) -> Self
Converts to this type from the input type.
Source§impl FromStr for PrettyDecimal
impl FromStr for PrettyDecimal
Source§impl IntoBoundedStatic for PrettyDecimal
impl IntoBoundedStatic for PrettyDecimal
Source§type Static = PrettyDecimal
type Static = PrettyDecimal
The target type is bounded by the
'static lifetime.Source§fn into_static(self) -> <Self as IntoBoundedStatic>::Static
fn into_static(self) -> <Self as IntoBoundedStatic>::Static
Convert an owned
T into an owned T such that T: 'static.Source§impl Neg for PrettyDecimal
impl Neg for PrettyDecimal
Source§impl PartialEq for PrettyDecimal
impl PartialEq for PrettyDecimal
Source§impl ToBoundedStatic for PrettyDecimal
impl ToBoundedStatic for PrettyDecimal
Source§type Static = PrettyDecimal
type Static = PrettyDecimal
The target type is bounded by the
'static lifetime.Source§fn to_static(&self) -> <Self as ToBoundedStatic>::Static
fn to_static(&self) -> <Self as ToBoundedStatic>::Static
Convert an
&T to an owned T such that T: 'static.impl Eq for PrettyDecimal
impl StructuralPartialEq for PrettyDecimal
Auto Trait Implementations§
impl Freeze for PrettyDecimal
impl RefUnwindSafe for PrettyDecimal
impl Send for PrettyDecimal
impl Sync for PrettyDecimal
impl Unpin for PrettyDecimal
impl UnwindSafe for PrettyDecimal
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