pub trait Storage: Send + Sync {
// Required methods
fn get_cached_item<'life0, 'async_trait>(
&'life0 self,
key: String,
) -> Pin<Box<dyn Future<Output = Result<Option<String>, StorageError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn set_cached_item<'life0, 'async_trait>(
&'life0 self,
key: String,
value: String,
) -> Pin<Box<dyn Future<Output = Result<(), StorageError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn list_payments<'life0, 'async_trait>(
&'life0 self,
offset: Option<u32>,
limit: Option<u32>,
) -> Pin<Box<dyn Future<Output = Result<Vec<Payment>, StorageError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn insert_payment<'life0, 'async_trait>(
&'life0 self,
payment: Payment,
) -> Pin<Box<dyn Future<Output = Result<(), StorageError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn set_payment_metadata<'life0, 'async_trait>(
&'life0 self,
payment_id: String,
metadata: PaymentMetadata,
) -> Pin<Box<dyn Future<Output = Result<(), StorageError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn get_payment_by_id<'life0, 'async_trait>(
&'life0 self,
id: String,
) -> Pin<Box<dyn Future<Output = Result<Payment, StorageError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn add_deposit<'life0, 'async_trait>(
&'life0 self,
txid: String,
vout: u32,
amount_sats: u64,
) -> Pin<Box<dyn Future<Output = Result<(), StorageError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn delete_deposit<'life0, 'async_trait>(
&'life0 self,
txid: String,
vout: u32,
) -> Pin<Box<dyn Future<Output = Result<(), StorageError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn list_deposits<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<DepositInfo>, StorageError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn update_deposit<'life0, 'async_trait>(
&'life0 self,
txid: String,
vout: u32,
payload: UpdateDepositPayload,
) -> Pin<Box<dyn Future<Output = Result<(), StorageError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
}
Expand description
Trait for persistent storage