pub struct CurrencySeries {
    pub ytl_mode: bool,
    pub exchange_type: ExchangeType,
    pub currency_code: CurrencyCode,
    pub date_preference: DatePreference,
}
Expand description

supplies reliable and well structured required details about currency and date/s to the functions making single currency operations such as get_data and get_advanced_data.

This struct accepts both Single and Multiple date options.

It is recommended CurrencySeries variable to be created via from.

Use of this struct and its implemented functions seems complicated, however it is safe and makes some required error prone operations automatically without any problem.

Fields

ytl_mode: boolexchange_type: ExchangeTypecurrency_code: CurrencyCodedate_preference: DatePreference

Implementations

creates currency series with detailed information.

Example
    use tcmb_evds::date::{Date, DatePreference};        
    use tcmb_evds::evds_currency::{ExchangeType, CurrencyCode, CurrencySeries};
 
 
    let exchange_type = ExchangeType::new();

    let currency_code = CurrencyCode::Qar;

    let date_result = Date::from("13-12-2011");
    let date = 
        if let Ok(date) = date_result { date } 
        else { return };     
    let date_preference = DatePreference::Single(date);
     
    // Ytl mode adds "YTL" to currency series, when it is true.
    let ytl_mode = true;
    
    
    let currency_series = CurrencySeries::from(exchange_type, currency_code, date_preference, ytl_mode);

returns data about just one currency.

Single date or multiple dates can be used for this function.

This function is used as a method of CurrencySeries because of decreasing amount of function parameters user entering.

Error

This function returns error if internet connection is lost.

Example

Follow Evds for detailed implementation of evds.

    // requesting currency data.
    let result = currency_series.get_data(&evds);


    let currency_data = match result {
        Ok(response) => response,
        Err(error) => {
            println!("{}", error.to_string());
            return
        }
    };

returns data about just one currency with frequency formulas.

Single date or multiple dates can be used for this function.

This function is used as a method of CurrencySeries because of decreasing amount of function parameters user entering.

Error

This function returns error if internet connection is lost.

Example

Follow Evds and AdvancedProcesses for detailed implementation of evds and advanced_processes.

    // requesting currency data with frequency formulas.
    let result = currency_series.get_advanced_data(&evds, &advanced_processes);
 
 
    let advanced_currency_data = match result {
        Ok(response) => response,
        Err(error) => {
            println!("{}", error.to_string());
            return
        }
    };

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.