pub struct PaymentGuard<const CAP: usize> {
pub supported: [VendorPaymentConfig; CAP],
}Expand description
A guard that accepts a user-specified payment type, providing the vendor supports it.
Fields§
§supported: [VendorPaymentConfig; CAP]Implementations§
Source§impl<const CAP: usize> PaymentGuard<CAP>
impl<const CAP: usize> PaymentGuard<CAP>
pub async fn deduct( &self, payment: PaymentType, fee: TokenAmount, ) -> Result<(), PaymentError>
Source§impl<const CAP: usize> PaymentGuard<CAP>
impl<const CAP: usize> PaymentGuard<CAP>
Sourcepub fn config(&self, payment: PaymentType) -> Option<PaymentWithConfig>
pub fn config(&self, payment: PaymentType) -> Option<PaymentWithConfig>
Find the vendor configuration for the offered payment type.
Auto Trait Implementations§
impl<const CAP: usize> Freeze for PaymentGuard<CAP>
impl<const CAP: usize> RefUnwindSafe for PaymentGuard<CAP>
impl<const CAP: usize> Send for PaymentGuard<CAP>
impl<const CAP: usize> Sync for PaymentGuard<CAP>
impl<const CAP: usize> Unpin for PaymentGuard<CAP>
impl<const CAP: usize> UnwindSafe for PaymentGuard<CAP>
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