Skip to main content

PaymentStore

Trait PaymentStore 

Source
pub trait PaymentStore: Send + Sync {
    // Required methods
    fn read_ledger<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = Result<WebLedger, PaymentError>> + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn write_ledger<'life0, 'life1, 'async_trait>(
        &'life0 self,
        ledger: &'life1 WebLedger,
    ) -> Pin<Box<dyn Future<Output = Result<(), PaymentError>> + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn check_replay<'life0, 'life1, 'async_trait>(
        &'life0 self,
        key: &'life1 str,
    ) -> Pin<Box<dyn Future<Output = Result<bool, PaymentError>> + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn record_replay<'life0, 'life1, 'async_trait>(
        &'life0 self,
        key: &'life1 str,
    ) -> Pin<Box<dyn Future<Output = Result<(), PaymentError>> + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
}
Expand description

Abstract payment storage — backends implement this for KV/DO/FS.

Required Methods§

Source

fn read_ledger<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<WebLedger, PaymentError>> + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source

fn write_ledger<'life0, 'life1, 'async_trait>( &'life0 self, ledger: &'life1 WebLedger, ) -> Pin<Box<dyn Future<Output = Result<(), PaymentError>> + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source

fn check_replay<'life0, 'life1, 'async_trait>( &'life0 self, key: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<bool, PaymentError>> + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source

fn record_replay<'life0, 'life1, 'async_trait>( &'life0 self, key: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<(), PaymentError>> + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§