pub struct SqliteX402CreditRepository { /* private fields */ }Available on crate feature
sqlite only.Expand description
SQLite implementation of X402CreditRepository
Implementations§
Source§impl SqliteX402CreditRepository
impl SqliteX402CreditRepository
pub const fn new(pool: Pool<SqliteConnectionManager>) -> Self
Trait Implementations§
Source§impl Debug for SqliteX402CreditRepository
impl Debug for SqliteX402CreditRepository
Source§impl X402CreditRepository for SqliteX402CreditRepository
impl X402CreditRepository for SqliteX402CreditRepository
Source§fn get_account(
&self,
payer_address: &str,
asset: X402Asset,
network: X402Network,
) -> Result<Option<X402CreditAccount>>
fn get_account( &self, payer_address: &str, asset: X402Asset, network: X402Network, ) -> Result<Option<X402CreditAccount>>
Get a credit account for payer/asset/network
Source§fn get_or_create_account(
&self,
payer_address: &str,
asset: X402Asset,
network: X402Network,
) -> Result<X402CreditAccount>
fn get_or_create_account( &self, payer_address: &str, asset: X402Asset, network: X402Network, ) -> Result<X402CreditAccount>
Get or create a credit account (balance default = 0)
Source§fn get_balance(
&self,
payer_address: &str,
asset: X402Asset,
network: X402Network,
) -> Result<u64>
fn get_balance( &self, payer_address: &str, asset: X402Asset, network: X402Network, ) -> Result<u64>
Get current balance for payer/asset/network
Source§fn adjust_balance(
&self,
input: X402CreditAdjustment,
) -> Result<X402CreditTransaction>
fn adjust_balance( &self, input: X402CreditAdjustment, ) -> Result<X402CreditTransaction>
Apply a credit or debit adjustment
Source§fn list_transactions(
&self,
filter: X402CreditTransactionFilter,
) -> Result<Vec<X402CreditTransaction>>
fn list_transactions( &self, filter: X402CreditTransactionFilter, ) -> Result<Vec<X402CreditTransaction>>
List credit transactions with optional filter
Auto Trait Implementations§
impl !RefUnwindSafe for SqliteX402CreditRepository
impl !UnwindSafe for SqliteX402CreditRepository
impl Freeze for SqliteX402CreditRepository
impl Send for SqliteX402CreditRepository
impl Sync for SqliteX402CreditRepository
impl Unpin for SqliteX402CreditRepository
impl UnsafeUnpin for SqliteX402CreditRepository
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