pub struct SqliteCurrencyRepository { /* private fields */ }Available on crate feature
sqlite only.Expand description
SQLite currency repository
Implementations§
Source§impl SqliteCurrencyRepository
impl SqliteCurrencyRepository
pub const fn new(pool: Pool<SqliteConnectionManager>) -> Self
Trait Implementations§
Source§impl CurrencyRepository for SqliteCurrencyRepository
impl CurrencyRepository for SqliteCurrencyRepository
Source§fn get_rate(&self, from: Currency, to: Currency) -> Result<Option<ExchangeRate>>
fn get_rate(&self, from: Currency, to: Currency) -> Result<Option<ExchangeRate>>
Get current exchange rate between two currencies
Source§fn get_rates_for(&self, base: Currency) -> Result<Vec<ExchangeRate>>
fn get_rates_for(&self, base: Currency) -> Result<Vec<ExchangeRate>>
Get all exchange rates for a base currency
Source§fn list_rates(&self, filter: ExchangeRateFilter) -> Result<Vec<ExchangeRate>>
fn list_rates(&self, filter: ExchangeRateFilter) -> Result<Vec<ExchangeRate>>
List all exchange rates with optional filter
Source§fn set_rate(&self, input: SetExchangeRate) -> Result<ExchangeRate>
fn set_rate(&self, input: SetExchangeRate) -> Result<ExchangeRate>
Set an exchange rate
Source§fn set_rates(&self, rates: Vec<SetExchangeRate>) -> Result<Vec<ExchangeRate>>
fn set_rates(&self, rates: Vec<SetExchangeRate>) -> Result<Vec<ExchangeRate>>
Set multiple exchange rates at once
Source§fn convert(&self, input: ConvertCurrency) -> Result<ConversionResult>
fn convert(&self, input: ConvertCurrency) -> Result<ConversionResult>
Convert money between currencies
Source§fn get_settings(&self) -> Result<StoreCurrencySettings>
fn get_settings(&self) -> Result<StoreCurrencySettings>
Get store currency settings
Source§fn update_settings(
&self,
settings: StoreCurrencySettings,
) -> Result<StoreCurrencySettings>
fn update_settings( &self, settings: StoreCurrencySettings, ) -> Result<StoreCurrencySettings>
Update store currency settings
Source§fn set_rates_atomic(
&self,
rates: Vec<SetExchangeRate>,
) -> Result<Vec<ExchangeRate>>
fn set_rates_atomic( &self, rates: Vec<SetExchangeRate>, ) -> Result<Vec<ExchangeRate>>
Set multiple exchange rates - atomic (all-or-nothing)
Note:
set_rates already exists as a partial-success batch operationSource§fn delete_rates_batch(&self, ids: Vec<Uuid>) -> Result<BatchResult<Uuid>>
fn delete_rates_batch(&self, ids: Vec<Uuid>) -> Result<BatchResult<Uuid>>
Delete multiple exchange rates - partial success allowed
Source§fn delete_rates_atomic(&self, ids: Vec<Uuid>) -> Result<()>
fn delete_rates_atomic(&self, ids: Vec<Uuid>) -> Result<()>
Delete multiple exchange rates - atomic (all-or-nothing)
Source§fn get_rates_batch(
&self,
pairs: Vec<(Currency, Currency)>,
) -> Result<Vec<ExchangeRate>>
fn get_rates_batch( &self, pairs: Vec<(Currency, Currency)>, ) -> Result<Vec<ExchangeRate>>
Get multiple exchange rates by currency pairs
Auto Trait Implementations§
impl !RefUnwindSafe for SqliteCurrencyRepository
impl !UnwindSafe for SqliteCurrencyRepository
impl Freeze for SqliteCurrencyRepository
impl Send for SqliteCurrencyRepository
impl Sync for SqliteCurrencyRepository
impl Unpin for SqliteCurrencyRepository
impl UnsafeUnpin for SqliteCurrencyRepository
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