pub struct Posting { /* private fields */ }Expand description
A single account posting.
Implementations§
Source§impl Posting
impl Posting
Sourcepub fn new(
account_id: impl AsRef<str>,
amount: Money,
side: DebitCredit,
) -> Result<Self, LedgerError>
pub fn new( account_id: impl AsRef<str>, amount: Money, side: DebitCredit, ) -> Result<Self, LedgerError>
Creates a posting with a non-empty account identifier.
§Errors
Returns LedgerError::EmptyAccountId when the trimmed account identifier is empty.
Sourcepub fn account_id(&self) -> &str
pub fn account_id(&self) -> &str
Returns the account identifier.
Sourcepub const fn side(&self) -> DebitCredit
pub const fn side(&self) -> DebitCredit
Returns the debit or credit side.
Trait Implementations§
impl Eq for Posting
impl StructuralPartialEq for Posting
Auto Trait Implementations§
impl Freeze for Posting
impl RefUnwindSafe for Posting
impl Send for Posting
impl Sync for Posting
impl Unpin for Posting
impl UnsafeUnpin for Posting
impl UnwindSafe for Posting
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