[][src]Struct doublecount::TransactionElement

pub struct TransactionElement {
    pub account_id: AccountID,
    pub amount: Option<Commodity>,
    pub exchange_rate: Option<ExchangeRate>,
}

An element of a Transaction.

Fields

account_id: AccountID

The account to perform the transaction to

amount: Option<Commodity>

The amount of Commodity to add to the account.

This may be None, if it is the only element within a Transaction, which is None. If it is None, it's amount will be automatically calculated from the amounts in the other elements present in the transaction.

exchange_rate: Option<ExchangeRate>

The exchange rate to use for converting the amount in this element to a different CommodityType.

Methods

impl TransactionElement[src]

pub fn new(
    account_id: AccountID,
    amount: Option<Commodity>,
    exchange_rate: Option<ExchangeRate>
) -> TransactionElement
[src]

Create a new TransactionElement.

Trait Implementations

impl Clone for TransactionElement[src]

impl Debug for TransactionElement[src]

impl<'de> Deserialize<'de> for TransactionElement[src]

impl Serialize for TransactionElement[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> DeserializeOwned for T where
    T: Deserialize<'de>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.