pub struct ReceiptLayout {
pub lines: Vec<ReceiptLine>,
}Expand description
A complete receipt as an ordered list of semantic lines. Width- and locale-agnostic; render it
with ReceiptLayout::to_plain_text or consume the lines directly.
Fields§
§lines: Vec<ReceiptLine>The receipt’s lines, top to bottom.
Implementations§
Source§impl ReceiptLayout
impl ReceiptLayout
Sourcepub fn to_plain_text(&self, width: usize) -> String
pub fn to_plain_text(&self, width: usize) -> String
Render the layout as a monospace text block width columns wide. Centring and right-aligning
count Unicode scalar values, not bytes, so the Armenian script lays out correctly. Lines that
do not fit fall back to a single space between the two halves rather than truncating.
Trait Implementations§
Source§impl Clone for ReceiptLayout
impl Clone for ReceiptLayout
Source§fn clone(&self) -> ReceiptLayout
fn clone(&self) -> ReceiptLayout
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 ReceiptLayout
impl Debug for ReceiptLayout
Source§impl Display for ReceiptLayout
Renders the default 32-column monospace block — the common 80 mm thermal width for the Armenian
raster font. Use ReceiptLayout::to_plain_text for any other width.
impl Display for ReceiptLayout
Renders the default 32-column monospace block — the common 80 mm thermal width for the Armenian
raster font. Use ReceiptLayout::to_plain_text for any other width.
impl Eq for ReceiptLayout
Source§impl PartialEq for ReceiptLayout
impl PartialEq for ReceiptLayout
Source§fn eq(&self, other: &ReceiptLayout) -> bool
fn eq(&self, other: &ReceiptLayout) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for ReceiptLayout
Auto Trait Implementations§
impl Freeze for ReceiptLayout
impl RefUnwindSafe for ReceiptLayout
impl Send for ReceiptLayout
impl Sync for ReceiptLayout
impl Unpin for ReceiptLayout
impl UnsafeUnpin for ReceiptLayout
impl UnwindSafe for ReceiptLayout
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