pub struct NiceU32 { /* private fields */ }Expand description
Implementations§
Source§impl NiceU32
impl NiceU32
Source§impl NiceU32
impl NiceU32
Sourcepub fn with_separator(src: u32, sep: NiceSeparator) -> Self
pub fn with_separator(src: u32, sep: NiceSeparator) -> Self
§New (w/ Alternative Thousands Separator).
Nicely stringify a u32 with a specific thousands separator (instead of the default comma).
§Examples
use dactyl::{NiceSeparator, NiceU32};
let num: u32 = 54321;
// Commas are used by default.
assert_eq!(
NiceU32::from(num).as_str(),
"54,321",
);
// Other contexts might prefer, say, underscores…
assert_eq!(
NiceU32::with_separator(
num,
NiceSeparator::Underscore,
).as_str(),
"54_321",
);Trait Implementations§
impl Copy for NiceU32
impl Eq for NiceU32
Source§impl From<NonZero<u32>> for NiceU32
impl From<NonZero<u32>> for NiceU32
Source§fn from(src: NonZeroU32) -> Self
fn from(src: NonZeroU32) -> Self
Converts to this type from the input type.
Source§impl From<Option<NonZero<u32>>> for NiceU32
impl From<Option<NonZero<u32>>> for NiceU32
Source§fn from(src: Option<NonZeroU32>) -> Self
fn from(src: Option<NonZeroU32>) -> Self
Converts to this type from the input type.
Source§impl<T: Inflection> NiceInflection<NiceU32> for T
impl<T: Inflection> NiceInflection<NiceU32> for T
Source§impl NiceInflection<NiceU32> for i32
impl NiceInflection<NiceU32> for i32
Source§impl Ord for NiceU32
impl Ord for NiceU32
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Auto Trait Implementations§
impl Freeze for NiceU32
impl RefUnwindSafe for NiceU32
impl Send for NiceU32
impl Sync for NiceU32
impl Unpin for NiceU32
impl UnsafeUnpin for NiceU32
impl UnwindSafe for NiceU32
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