pub struct FormatConfig {
pub alignment: Alignment,
pub indent: String,
pub number_display: Option<DisplayContext>,
}Expand description
Formatter configuration.
Fields§
§alignment: AlignmentHow to align amounts (default: Alignment::Auto, matching
bean-format).
indent: StringIndentation for postings and metadata (default: 2 spaces).
number_display: Option<DisplayContext>Optional number rendering context (#1766): when set, amount,
cost, price, tolerance, and amount-typed metadata numbers render
through crate::DisplayContext::format_plain — per-currency
PRECISION padding (option "display_precision", observed
distributions) that never rounds an over-precise value away
(quantizing a balance amount would change its meaning), and
leaves currencies the context does not track byte-faithful to
their own scale. Thousands separators are deliberately never
emitted even when the context has render_commas set: canonical
ledger text carries no separators (the CST canonicalizer strips
them by definition, matching bean-format) — commas remain a
report/query display concern, honored where they always were.
None preserves each value’s own scale byte-for-byte (the
historical behavior, and what source-preserving formatters
want).
Implementations§
Source§impl FormatConfig
impl FormatConfig
Sourcepub fn with_column(column: usize) -> Self
pub fn with_column(column: usize) -> Self
Create a config that aligns currencies to a fixed column
(bean-format’s -c mode).
Sourcepub fn with_indent(indent_width: usize) -> Self
pub fn with_indent(indent_width: usize) -> Self
Create a config with the specified indent width (auto alignment).
Trait Implementations§
Source§impl Clone for FormatConfig
impl Clone for FormatConfig
Source§fn clone(&self) -> FormatConfig
fn clone(&self) -> FormatConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for FormatConfig
impl Debug for FormatConfig
Auto Trait Implementations§
impl Freeze for FormatConfig
impl RefUnwindSafe for FormatConfig
impl Send for FormatConfig
impl Sync for FormatConfig
impl Unpin for FormatConfig
impl UnsafeUnpin for FormatConfig
impl UnwindSafe for FormatConfig
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.