pub struct InvoiceLine { /* private fields */ }Expand description
A single invoice line.
Implementations§
Source§impl InvoiceLine
impl InvoiceLine
Sourcepub fn new(
description: impl AsRef<str>,
amount: Money,
) -> Result<Self, InvoiceError>
pub fn new( description: impl AsRef<str>, amount: Money, ) -> Result<Self, InvoiceError>
Creates an invoice line with a non-empty description.
§Errors
Returns InvoiceError::EmptyLineDescription when the trimmed description is empty.
Sourcepub fn description(&self) -> &str
pub fn description(&self) -> &str
Returns the line description.
Trait Implementations§
Source§impl Clone for InvoiceLine
impl Clone for InvoiceLine
Source§fn clone(&self) -> InvoiceLine
fn clone(&self) -> InvoiceLine
Returns a duplicate of the value. Read more
1.0.0 · 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 InvoiceLine
impl Debug for InvoiceLine
Source§impl PartialEq for InvoiceLine
impl PartialEq for InvoiceLine
impl Eq for InvoiceLine
impl StructuralPartialEq for InvoiceLine
Auto Trait Implementations§
impl Freeze for InvoiceLine
impl RefUnwindSafe for InvoiceLine
impl Send for InvoiceLine
impl Sync for InvoiceLine
impl Unpin for InvoiceLine
impl UnsafeUnpin for InvoiceLine
impl UnwindSafe for InvoiceLine
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