pub struct Operation { /* private fields */ }Expand description
Operation
Implementations§
Source§impl Operation
impl Operation
Sourcepub fn new(
id: Uuid,
kind: OperationKind,
total_issued: Amount,
total_redeemed: Amount,
fee_collected: Amount,
complete_at: Option<u64>,
payment_method: Option<PaymentMethod>,
) -> Self
pub fn new( id: Uuid, kind: OperationKind, total_issued: Amount, total_redeemed: Amount, fee_collected: Amount, complete_at: Option<u64>, payment_method: Option<PaymentMethod>, ) -> Self
New
Sourcepub fn new_mint(total_issued: Amount, payment_method: PaymentMethod) -> Self
pub fn new_mint(total_issued: Amount, payment_method: PaymentMethod) -> Self
Mint
Sourcepub fn new_melt(
total_redeemed: Amount,
fee_collected: Amount,
payment_method: PaymentMethod,
) -> Self
pub fn new_melt( total_redeemed: Amount, fee_collected: Amount, payment_method: PaymentMethod, ) -> Self
Melt
In the context of a melt total_issued refrests to the change
Sourcepub fn new_swap(
total_issued: Amount,
total_redeemed: Amount,
fee_collected: Amount,
) -> Self
pub fn new_swap( total_issued: Amount, total_redeemed: Amount, fee_collected: Amount, ) -> Self
Swap
Sourcepub fn kind(&self) -> OperationKind
pub fn kind(&self) -> OperationKind
Operation kind
Sourcepub fn total_issued(&self) -> Amount
pub fn total_issued(&self) -> Amount
Total issued
Sourcepub fn total_redeemed(&self) -> Amount
pub fn total_redeemed(&self) -> Amount
Total redeemed
Sourcepub fn fee_collected(&self) -> Amount
pub fn fee_collected(&self) -> Amount
Fee collected
Sourcepub fn completed_at(&self) -> &Option<u64>
pub fn completed_at(&self) -> &Option<u64>
Completed time
Sourcepub fn add_change(&mut self, change: Amount)
pub fn add_change(&mut self, change: Amount)
Add change
Sourcepub fn payment_amount(&self) -> Option<Amount>
pub fn payment_amount(&self) -> Option<Amount>
Payment amount (only for melt operations)
Sourcepub fn payment_fee(&self) -> Option<Amount>
pub fn payment_fee(&self) -> Option<Amount>
Payment fee (only for melt operations)
Sourcepub fn set_payment_details(
&mut self,
payment_amount: Amount,
payment_fee: Amount,
)
pub fn set_payment_details( &mut self, payment_amount: Amount, payment_fee: Amount, )
Set payment details for melt operations
Sourcepub fn payment_method(&self) -> Option<PaymentMethod>
pub fn payment_method(&self) -> Option<PaymentMethod>
Payment method (only for mint/melt operations)
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Operation
impl RefUnwindSafe for Operation
impl Send for Operation
impl Sync for Operation
impl Unpin for Operation
impl UnsafeUnpin for Operation
impl UnwindSafe for Operation
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