Struct bcheck::Transaction [−][src]
pub struct Transaction { pub date: DateTime<Local>, pub check_number: Option<u32>, 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>
vendor: String
memo: String
amount: OrderedFloat<f64>
transaction_type: TransactionType
is_reconciled: bool
Implementations
create empty Transaction object.
pub fn from(
date: DateTime<Local>,
check_number: Option<u32>,
vendor: String,
memo: String,
amount: OrderedFloat<f64>,
transaction_type: TransactionType,
is_reconciled: bool
) -> Transaction
pub fn from(
date: DateTime<Local>,
check_number: Option<u32>,
vendor: String,
memo: String,
amount: OrderedFloat<f64>,
transaction_type: TransactionType,
is_reconciled: bool
) -> Transaction
Create a transaction object with given values.
Example
let transaction = Transaction::from(Local.ymd(2021, 7, 8).and_hms(0, 0, 0), Some(1260 as u32), String::from("Sam Hill Credit Union"), String::from("Open Account"), OrderedFloat::<f64>(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