#[non_exhaustive]pub struct PurchaseTransaction {
pub id: String,
pub revenue: f32,
pub tax: f32,
pub cost: f32,
pub currency_code: String,
/* private fields */
}Expand description
A transaction represents the entire purchase transaction.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.id: StringThe transaction ID with a length limit of 128 characters.
revenue: f32Required. Total non-zero revenue or grand total associated with the transaction. This value include shipping, tax, or other adjustments to total revenue that you want to include as part of your revenue calculations.
tax: f32All the taxes associated with the transaction.
cost: f32All the costs associated with the products. These can be manufacturing costs, shipping expenses not borne by the end user, or any other costs, such that:
currency_code: StringRequired. Currency code. Use three-character ISO-4217 code.
Implementations§
Source§impl PurchaseTransaction
impl PurchaseTransaction
pub fn new() -> Self
Sourcepub fn set_revenue<T: Into<f32>>(self, v: T) -> Self
pub fn set_revenue<T: Into<f32>>(self, v: T) -> Self
Sourcepub fn set_currency_code<T: Into<String>>(self, v: T) -> Self
pub fn set_currency_code<T: Into<String>>(self, v: T) -> Self
Sets the value of currency_code.
§Example
ⓘ
let x = PurchaseTransaction::new().set_currency_code("example");Trait Implementations§
Source§impl Clone for PurchaseTransaction
impl Clone for PurchaseTransaction
Source§fn clone(&self) -> PurchaseTransaction
fn clone(&self) -> PurchaseTransaction
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 PurchaseTransaction
impl Debug for PurchaseTransaction
Source§impl Default for PurchaseTransaction
impl Default for PurchaseTransaction
Source§fn default() -> PurchaseTransaction
fn default() -> PurchaseTransaction
Returns the “default value” for a type. Read more
Source§impl Message for PurchaseTransaction
impl Message for PurchaseTransaction
Source§impl PartialEq for PurchaseTransaction
impl PartialEq for PurchaseTransaction
impl StructuralPartialEq for PurchaseTransaction
Auto Trait Implementations§
impl Freeze for PurchaseTransaction
impl RefUnwindSafe for PurchaseTransaction
impl Send for PurchaseTransaction
impl Sync for PurchaseTransaction
impl Unpin for PurchaseTransaction
impl UnwindSafe for PurchaseTransaction
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