#[non_exhaustive]pub enum ReceiptLine {
Title(String),
Centered(String),
Text(String),
Field {
label: String,
value: String,
},
Item {
name: String,
amount: String,
},
Amount {
label: String,
value: String,
emphasize: bool,
},
Divider,
}Expand description
One semantic line of a rendered receipt. Carries meaning, not geometry — width, alignment, and
emphasis are applied by a renderer (ReceiptLayout::to_plain_text or a consumer’s own).
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Title(String)
Centred, emphasised heading (the taxpayer name, the fiscal-number footer).
Centered(String)
Centred plain text (the taxpayer address).
Text(String)
Left-aligned plain text.
Field
A labelled identifier: label on the left, value on the right.
Item
A goods line: name on the left, line total on the right.
Fields
Amount
A money row: caption on the left, amount on the right. emphasize marks the grand total.
Fields
Divider
A horizontal separator spanning the receipt width.
Trait Implementations§
Source§impl Clone for ReceiptLine
impl Clone for ReceiptLine
Source§fn clone(&self) -> ReceiptLine
fn clone(&self) -> ReceiptLine
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 ReceiptLine
impl Debug for ReceiptLine
impl Eq for ReceiptLine
Source§impl PartialEq for ReceiptLine
impl PartialEq for ReceiptLine
Source§fn eq(&self, other: &ReceiptLine) -> bool
fn eq(&self, other: &ReceiptLine) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for ReceiptLine
Auto Trait Implementations§
impl Freeze for ReceiptLine
impl RefUnwindSafe for ReceiptLine
impl Send for ReceiptLine
impl Sync for ReceiptLine
impl Unpin for ReceiptLine
impl UnsafeUnpin for ReceiptLine
impl UnwindSafe for ReceiptLine
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