pub struct ConfiguredClient { /* private fields */ }Expand description
A configured Dukascopy client instance with its own cache and settings.
Implementations§
Source§impl ConfiguredClient
impl ConfiguredClient
Sourcepub fn config(&self) -> &ClientConfig
pub fn config(&self) -> &ClientConfig
Returns the client configuration.
Sourcepub fn default_quote_currency(&self) -> Option<&str>
pub fn default_quote_currency(&self) -> Option<&str>
Returns configured default quote currency if set.
Sourcepub fn get_instrument_config(&self, from: &str, to: &str) -> InstrumentConfig
pub fn get_instrument_config(&self, from: &str, to: &str) -> InstrumentConfig
Returns the instrument configuration for a currency pair.
Sourcepub async fn get_tick_data(
&self,
pair: &CurrencyPair,
timestamp: DateTime<Utc>,
) -> Result<Vec<u8>, DukascopyError>
pub async fn get_tick_data( &self, pair: &CurrencyPair, timestamp: DateTime<Utc>, ) -> Result<Vec<u8>, DukascopyError>
Fetches tick data for a currency pair at a specific time.
Sourcepub async fn get_exchange_rate(
&self,
pair: &CurrencyPair,
timestamp: DateTime<Utc>,
) -> Result<CurrencyExchange, DukascopyError>
pub async fn get_exchange_rate( &self, pair: &CurrencyPair, timestamp: DateTime<Utc>, ) -> Result<CurrencyExchange, DukascopyError>
Fetches the exchange rate for a currency pair at a specific timestamp.
Sourcepub async fn get_exchange_rate_for_request(
&self,
request: &RateRequest,
timestamp: DateTime<Utc>,
) -> Result<CurrencyExchange, DukascopyError>
pub async fn get_exchange_rate_for_request( &self, request: &RateRequest, timestamp: DateTime<Utc>, ) -> Result<CurrencyExchange, DukascopyError>
Fetches exchange rate for unified request type (pair or symbol).
Sourcepub async fn get_exchange_rate_for_symbol(
&self,
symbol: &str,
timestamp: DateTime<Utc>,
) -> Result<CurrencyExchange, DukascopyError>
pub async fn get_exchange_rate_for_symbol( &self, symbol: &str, timestamp: DateTime<Utc>, ) -> Result<CurrencyExchange, DukascopyError>
Fetches exchange rate for a symbol using configured default quote currency.
Sourcepub async fn get_exchange_rate_for_symbol_with_path(
&self,
symbol: &str,
timestamp: DateTime<Utc>,
) -> Result<ResolvedExchange, DukascopyError>
pub async fn get_exchange_rate_for_symbol_with_path( &self, symbol: &str, timestamp: DateTime<Utc>, ) -> Result<ResolvedExchange, DukascopyError>
Fetches exchange rate for a symbol and returns conversion path metadata.
Sourcepub async fn get_exchange_rate_in_quote(
&self,
symbol: &str,
quote: &str,
timestamp: DateTime<Utc>,
) -> Result<CurrencyExchange, DukascopyError>
pub async fn get_exchange_rate_in_quote( &self, symbol: &str, quote: &str, timestamp: DateTime<Utc>, ) -> Result<CurrencyExchange, DukascopyError>
Fetches exchange rate for a symbol in target quote currency.
Sourcepub async fn get_exchange_rate_in_quote_with_path(
&self,
symbol: &str,
quote: &str,
timestamp: DateTime<Utc>,
) -> Result<ResolvedExchange, DukascopyError>
pub async fn get_exchange_rate_in_quote_with_path( &self, symbol: &str, quote: &str, timestamp: DateTime<Utc>, ) -> Result<ResolvedExchange, DukascopyError>
Fetches exchange rate for a symbol in target quote currency with path metadata.
Sourcepub async fn get_exchange_rates_range(
&self,
pair: &CurrencyPair,
start: DateTime<Utc>,
end: DateTime<Utc>,
interval: Duration,
) -> Result<Vec<CurrencyExchange>, DukascopyError>
pub async fn get_exchange_rates_range( &self, pair: &CurrencyPair, start: DateTime<Utc>, end: DateTime<Utc>, interval: Duration, ) -> Result<Vec<CurrencyExchange>, DukascopyError>
Fetches exchange rates over a time range.
Sourcepub fn build_url(
&self,
pair_symbol: &str,
year: i32,
month: u32,
day: u32,
hour: u32,
) -> String
pub fn build_url( &self, pair_symbol: &str, year: i32, month: u32, day: u32, hour: u32, ) -> String
Builds a URL for fetching tick data.
Sourcepub fn clear_cache(&self) -> Result<(), DukascopyError>
pub fn clear_cache(&self) -> Result<(), DukascopyError>
Clears the cache.
Sourcepub fn cache_len(&self) -> Result<usize, DukascopyError>
pub fn cache_len(&self) -> Result<usize, DukascopyError>
Returns the current number of cached entries.