#[non_exhaustive]pub struct PostingAlignment {
pub number_col: usize,
pub number_width: usize,
}Expand description
Pre-computed alignment data for a whole source file.
Bean-format-style two-axis alignment. The number field is a
fixed-width slot starting at column number_col and number_width
chars wide, into which each posting’s number / arithmetic
expression is right-justified. Shorter numbers are left-padded
with spaces, so the currency column (right after the field) is
uniform across the whole file even when individual numbers have
different widths or signs.
number_col= INDENT + max(account width with optionalflag) + 2number_width= max rendered width of any posting’s number / arithmetic expression (sign included)
PostingAlignment is Copy and Default (the all-zero state);
the default is the alignment used for files that contain no
postings (no transactions, or transactions with no AMOUNT).
Marked #[non_exhaustive] so that a future column-derivation
rule can add fields without breaking downstream consumers.
Name choice. The type is qualified by its semantic purpose
(posting layout column widths) so the public path
rustledger_parser::format::PostingAlignment doesn’t compete
with future generic “alignment” types (text justification,
memory layout, etc.).
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.number_col: usize0-indexed column at which the right-justified number field starts.
number_width: usizeWidth of the number field; shorter numbers are left-padded with spaces so the currency column stays uniform.
Trait Implementations§
Source§impl Clone for PostingAlignment
impl Clone for PostingAlignment
Source§fn clone(&self) -> PostingAlignment
fn clone(&self) -> PostingAlignment
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for PostingAlignment
Source§impl Debug for PostingAlignment
impl Debug for PostingAlignment
Source§impl Default for PostingAlignment
impl Default for PostingAlignment
Source§fn default() -> PostingAlignment
fn default() -> PostingAlignment
impl Eq for PostingAlignment
Source§impl PartialEq for PostingAlignment
impl PartialEq for PostingAlignment
Source§fn eq(&self, other: &PostingAlignment) -> bool
fn eq(&self, other: &PostingAlignment) -> bool
self and other values to be equal, and is used by ==.impl StructuralPartialEq for PostingAlignment
Auto Trait Implementations§
impl Freeze for PostingAlignment
impl RefUnwindSafe for PostingAlignment
impl Send for PostingAlignment
impl Sync for PostingAlignment
impl Unpin for PostingAlignment
impl UnsafeUnpin for PostingAlignment
impl UnwindSafe for PostingAlignment
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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.