pub struct CurrencyOperations { /* private fields */ }Expand description
Currency and exchange rate operations API
Implementations§
Source§impl CurrencyOperations
impl CurrencyOperations
pub fn into_reference( val: CurrencyOperations, env: Env, ) -> Result<Reference<CurrencyOperations>>
pub fn into_instance( self, env: Env, ) -> Result<ClassInstance<CurrencyOperations>>
Source§impl CurrencyOperations
impl CurrencyOperations
Sourcepub async fn get_rate(
&self,
from: String,
to: String,
) -> Result<Option<ExchangeRateOutput>>
pub async fn get_rate( &self, from: String, to: String, ) -> Result<Option<ExchangeRateOutput>>
Get exchange rate between two currencies
Sourcepub async fn get_rates_for(
&self,
base_currency: String,
) -> Result<Vec<ExchangeRateOutput>>
pub async fn get_rates_for( &self, base_currency: String, ) -> Result<Vec<ExchangeRateOutput>>
Get all exchange rates for a base currency
Sourcepub async fn list_rates(
&self,
filter: Option<ExchangeRateFilterInput>,
) -> Result<Vec<ExchangeRateOutput>>
pub async fn list_rates( &self, filter: Option<ExchangeRateFilterInput>, ) -> Result<Vec<ExchangeRateOutput>>
List exchange rates with optional filtering
Sourcepub async fn set_rate(
&self,
input: SetExchangeRateInput,
) -> Result<ExchangeRateOutput>
pub async fn set_rate( &self, input: SetExchangeRateInput, ) -> Result<ExchangeRateOutput>
Set an exchange rate
Sourcepub async fn set_rates(
&self,
inputs: Vec<SetExchangeRateInput>,
) -> Result<Vec<ExchangeRateOutput>>
pub async fn set_rates( &self, inputs: Vec<SetExchangeRateInput>, ) -> Result<Vec<ExchangeRateOutput>>
Set multiple exchange rates at once
Sourcepub async fn delete_rate(&self, id: String) -> Result<bool>
pub async fn delete_rate(&self, id: String) -> Result<bool>
Delete an exchange rate by ID
Sourcepub async fn convert(
&self,
input: ConvertCurrencyInput,
) -> Result<ConversionResultOutput>
pub async fn convert( &self, input: ConvertCurrencyInput, ) -> Result<ConversionResultOutput>
Convert an amount from one currency to another
Sourcepub async fn get_settings(&self) -> Result<StoreCurrencySettingsOutput>
pub async fn get_settings(&self) -> Result<StoreCurrencySettingsOutput>
Get store currency settings
Sourcepub async fn update_settings(
&self,
input: StoreCurrencySettingsInput,
) -> Result<StoreCurrencySettingsOutput>
pub async fn update_settings( &self, input: StoreCurrencySettingsInput, ) -> Result<StoreCurrencySettingsOutput>
Update store currency settings
Sourcepub async fn set_base_currency(
&self,
currency_code: String,
) -> Result<StoreCurrencySettingsOutput>
pub async fn set_base_currency( &self, currency_code: String, ) -> Result<StoreCurrencySettingsOutput>
Set the store’s base currency
Sourcepub async fn enable_currencies(
&self,
currency_codes: Vec<String>,
) -> Result<StoreCurrencySettingsOutput>
pub async fn enable_currencies( &self, currency_codes: Vec<String>, ) -> Result<StoreCurrencySettingsOutput>
Enable currencies for the store
Sourcepub async fn is_enabled(&self, currency_code: String) -> Result<bool>
pub async fn is_enabled(&self, currency_code: String) -> Result<bool>
Check if a currency is enabled
Sourcepub async fn get_base_currency(&self) -> Result<String>
pub async fn get_base_currency(&self) -> Result<String>
Get the store’s base currency
Sourcepub async fn get_enabled_currencies(&self) -> Result<Vec<String>>
pub async fn get_enabled_currencies(&self) -> Result<Vec<String>>
Get all enabled currencies
Trait Implementations§
Source§impl FromNapiMutRef for CurrencyOperations
impl FromNapiMutRef for CurrencyOperations
Source§unsafe fn from_napi_mut_ref(
env: napi_env,
napi_val: napi_value,
) -> Result<&'static mut Self>
unsafe fn from_napi_mut_ref( env: napi_env, napi_val: napi_value, ) -> Result<&'static mut Self>
Safety Read more
Source§impl FromNapiRef for CurrencyOperations
impl FromNapiRef for CurrencyOperations
Source§unsafe fn from_napi_ref(
env: napi_env,
napi_val: napi_value,
) -> Result<&'static Self>
unsafe fn from_napi_ref( env: napi_env, napi_val: napi_value, ) -> Result<&'static Self>
Safety Read more
Source§impl FromNapiValue for &CurrencyOperations
impl FromNapiValue for &CurrencyOperations
Source§unsafe fn from_napi_value(env: napi_env, napi_val: napi_value) -> Result<Self>
unsafe fn from_napi_value(env: napi_env, napi_val: napi_value) -> Result<Self>
Safety Read more
fn from_unknown(value: JsUnknown) -> Result<Self, Error>
Source§impl FromNapiValue for &mut CurrencyOperations
impl FromNapiValue for &mut CurrencyOperations
Source§unsafe fn from_napi_value(env: napi_env, napi_val: napi_value) -> Result<Self>
unsafe fn from_napi_value(env: napi_env, napi_val: napi_value) -> Result<Self>
Safety Read more
fn from_unknown(value: JsUnknown) -> Result<Self, Error>
Source§impl ObjectFinalize for CurrencyOperations
impl ObjectFinalize for CurrencyOperations
Source§impl ToNapiValue for CurrencyOperations
impl ToNapiValue for CurrencyOperations
Source§unsafe fn to_napi_value(
env: napi_env,
val: CurrencyOperations,
) -> Result<napi_value>
unsafe fn to_napi_value( env: napi_env, val: CurrencyOperations, ) -> Result<napi_value>
Safety Read more
Source§impl TypeName for &CurrencyOperations
impl TypeName for &CurrencyOperations
Source§impl TypeName for &mut CurrencyOperations
impl TypeName for &mut CurrencyOperations
Source§impl TypeName for CurrencyOperations
impl TypeName for CurrencyOperations
Source§impl ValidateNapiValue for &CurrencyOperations
impl ValidateNapiValue for &CurrencyOperations
Source§unsafe fn validate(env: napi_env, napi_val: napi_value) -> Result<napi_value>
unsafe fn validate(env: napi_env, napi_val: napi_value) -> Result<napi_value>
Safety Read more
Source§impl ValidateNapiValue for &mut CurrencyOperations
impl ValidateNapiValue for &mut CurrencyOperations
Source§unsafe fn validate(env: napi_env, napi_val: napi_value) -> Result<napi_value>
unsafe fn validate(env: napi_env, napi_val: napi_value) -> Result<napi_value>
Safety Read more
Auto Trait Implementations§
impl Freeze for CurrencyOperations
impl !RefUnwindSafe for CurrencyOperations
impl Send for CurrencyOperations
impl Sync for CurrencyOperations
impl Unpin for CurrencyOperations
impl UnsafeUnpin for CurrencyOperations
impl !UnwindSafe for CurrencyOperations
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