pub struct GroupingSizes {
pub primary: u8,
pub secondary: u8,
pub min_grouping: u8,
}
Expand description
A collection of settings expressing where to put grouping separators in a decimal number.
For example, 1,000,000
has two grouping separators, positioned along every 3 digits.
🚧 This code is considered unstable; it may change at any time, in breaking or non-breaking ways,
including in SemVer minor releases. While the serde representation of data structs is guaranteed
to be stable, their Rust representation might not be. Use with caution.
Fields§
§primary: u8
The size of the first (lowest-magnitude) group.
If 0, grouping separators will never be shown.
secondary: u8
The size of groups after the first group.
If 0, defaults to be the same as primary
.
min_grouping: u8
The minimum number of digits required before the first group. For example, if primary=3
and min_grouping=2
, grouping separators will be present on 10,000 and above.
Trait Implementations§
Source§impl Bake for GroupingSizes
impl Bake for GroupingSizes
Source§fn bake(&self, env: &CrateEnv) -> TokenStream
fn bake(&self, env: &CrateEnv) -> TokenStream
Source§impl BakeSize for GroupingSizes
impl BakeSize for GroupingSizes
Source§fn borrows_size(&self) -> usize
fn borrows_size(&self) -> usize
Returns the size
Source§impl Clone for GroupingSizes
impl Clone for GroupingSizes
Source§fn clone(&self) -> GroupingSizes
fn clone(&self) -> GroupingSizes
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 GroupingSizes
impl Debug for GroupingSizes
Source§impl<'de> Deserialize<'de> for GroupingSizes
impl<'de> Deserialize<'de> for GroupingSizes
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for GroupingSizes
impl PartialEq for GroupingSizes
Source§impl Serialize for GroupingSizes
impl Serialize for GroupingSizes
Source§impl<'a> Yokeable<'a> for GroupingSizeswhere
Self: Sized,
impl<'a> Yokeable<'a> for GroupingSizeswhere
Self: Sized,
Source§type Output = GroupingSizes
type Output = GroupingSizes
This type MUST be
Self
with the 'static
replaced with 'a
, i.e. Self<'a>
Source§fn transform_owned(self) -> Self::Output
fn transform_owned(self) -> Self::Output
Source§unsafe fn make(this: Self::Output) -> Self
unsafe fn make(this: Self::Output) -> Self
This method can be used to cast away
Self<'a>
’s lifetime. Read moreSource§fn transform_mut<F>(&'a mut self, f: F)where
F: 'static + for<'b> FnOnce(&'b mut Self::Output),
fn transform_mut<F>(&'a mut self, f: F)where
F: 'static + for<'b> FnOnce(&'b mut Self::Output),
This method must cast
self
between &'a mut Self<'static>
and &'a mut Self<'a>
,
and pass it to f
. Read moreSource§impl<'zf> ZeroFrom<'zf, GroupingSizes> for GroupingSizes
impl<'zf> ZeroFrom<'zf, GroupingSizes> for GroupingSizes
impl Copy for GroupingSizes
impl StructuralPartialEq for GroupingSizes
Auto Trait Implementations§
impl Freeze for GroupingSizes
impl RefUnwindSafe for GroupingSizes
impl Send for GroupingSizes
impl Sync for GroupingSizes
impl Unpin for GroupingSizes
impl UnwindSafe for GroupingSizes
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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