pub struct GroupingStyle<'a> { /* private fields */ }Expand description
How numerals are grouped, resolved per currency.
Copy on purpose: it is threaded as a sibling of PostingAlignment
through the width pre-pass and the emitters, which must agree about a
numeral’s width or the currency column drifts — the #1290 failure. It is
NOT a field of PostingAlignment: that type is pub, Eq and cached on
ParseResult, so it cannot carry a lifetime. The invariant that pairs a
cached alignment with the style it was measured under is stated on
format_node_with_style (crate-internal).
Implementations§
Source§impl<'a> GroupingStyle<'a>
impl<'a> GroupingStyle<'a>
Sourcepub fn from_context(ctx: &'a DisplayContext) -> Self
pub fn from_context(ctx: &'a DisplayContext) -> Self
Grouping as declared by a ledger’s display context.
Returns the no-grouping style when the context groups nothing, so the overwhelmingly common case costs no per-numeral lookups.
Sourcepub const fn groups_anything(self) -> bool
pub const fn groups_anything(self) -> bool
Whether this style groups anything at all.
Lets a caller keep the fast precomputed-alignment path when nothing is declared, which is the overwhelming majority of ledgers.
Trait Implementations§
Source§impl<'a> Clone for GroupingStyle<'a>
impl<'a> Clone for GroupingStyle<'a>
Source§fn clone(&self) -> GroupingStyle<'a>
fn clone(&self) -> GroupingStyle<'a>
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl<'a> Copy for GroupingStyle<'a>
Source§impl<'a> Debug for GroupingStyle<'a>
impl<'a> Debug for GroupingStyle<'a>
Source§impl<'a> Default for GroupingStyle<'a>
impl<'a> Default for GroupingStyle<'a>
Source§fn default() -> GroupingStyle<'a>
fn default() -> GroupingStyle<'a>
Auto Trait Implementations§
impl<'a> Freeze for GroupingStyle<'a>
impl<'a> RefUnwindSafe for GroupingStyle<'a>
impl<'a> Send for GroupingStyle<'a>
impl<'a> Sync for GroupingStyle<'a>
impl<'a> Unpin for GroupingStyle<'a>
impl<'a> UnsafeUnpin for GroupingStyle<'a>
impl<'a> UnwindSafe for GroupingStyle<'a>
Blanket Implementations§
Source§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
Source§type ArchivedMetadata = ()
type ArchivedMetadata = ()
Source§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
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,
Source§impl<T> LayoutRaw for T
impl<T> LayoutRaw for T
Source§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
Source§impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
Source§unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
Source§fn resolve_niched(out: Place<NichedOption<T, N1>>)
fn resolve_niched(out: Place<NichedOption<T, N1>>)
out indicating that a T is niched.