Struct bcheck::Transaction
source[−]pub struct Transaction {
pub date: DateTime<Local>,
pub check_number: Option<u32>,
pub category: Option<String>,
pub vendor: String,
pub memo: String,
pub amount: OrderedFloat<f64>,
pub transaction_type: TransactionType,
pub is_reconciled: bool,
}
Expand description
Represent a transaction made.
Fields
date: DateTime<Local>
check_number: Option<u32>
category: Option<String>
vendor: String
memo: String
amount: OrderedFloat<f64>
transaction_type: TransactionType
is_reconciled: bool
Implementations
create empty Transaction object.
- Create a transaction object with given values.
- This function will throw an Error if a given date string is not in the proper format, which is “yyyy-mm-dd” or “yyyy-m-d”.
Example
let transaction = Transaction::from(None, Some(1260), "Sam Hill Credit Union", "Open Account", 500 as f64, TransactionType::Deposit, false);
Trait Implementations
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
This method returns an ordering between self
and other
values if one exists. Read more
This method tests less than (for self
and other
) and is used by the <
operator. Read more
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
Auto Trait Implementations
impl RefUnwindSafe for Transaction
impl Send for Transaction
impl Sync for Transaction
impl Unpin for Transaction
impl UnwindSafe for Transaction
Blanket Implementations
Mutably borrows from an owned value. Read more