pub struct TransactionElement {
pub account_id: AccountID,
pub amount: Option<Commodity>,
pub exchange_rate: Option<ExchangeRate>,
}Expand description
An element of a Transaction.
Fields§
§account_id: AccountIDThe 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.
Implementations§
Source§impl TransactionElement
impl TransactionElement
Sourcepub fn new(
account_id: AccountID,
amount: Option<Commodity>,
exchange_rate: Option<ExchangeRate>,
) -> TransactionElement
pub fn new( account_id: AccountID, amount: Option<Commodity>, exchange_rate: Option<ExchangeRate>, ) -> TransactionElement
Create a new TransactionElement.
Trait Implementations§
Source§impl Clone for TransactionElement
impl Clone for TransactionElement
Source§fn clone(&self) -> TransactionElement
fn clone(&self) -> TransactionElement
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 TransactionElement
impl Debug for TransactionElement
Source§impl<'de> Deserialize<'de> for TransactionElement
impl<'de> Deserialize<'de> for TransactionElement
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for TransactionElement
impl PartialEq for TransactionElement
Source§impl Serialize for TransactionElement
impl Serialize for TransactionElement
impl StructuralPartialEq for TransactionElement
Auto Trait Implementations§
impl Freeze for TransactionElement
impl RefUnwindSafe for TransactionElement
impl Send for TransactionElement
impl Sync for TransactionElement
impl Unpin for TransactionElement
impl UnwindSafe for TransactionElement
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