[][src]Struct alpha_vantage::user::APIKey

pub struct APIKey { /* fields omitted */ }

Struct for initializing apikey value as well as contain different method for API call

Methods

impl APIKey[src]

pub fn set_api(api: &str) -> Self[src]

Method for initializing APIKey struct

pub fn set_with_timeout(api: &str, timeout: u64) -> Self[src]

Set API value with timeout period

pub fn get_api(&self) -> String[src]

Method to get api key

pub fn get_timeout(&self) -> u64[src]

Get API value timeout period

pub fn crypto(
    &self,
    function: CryptoFunction,
    symbol: &str,
    market: &str
) -> Crypto
[src]

Crypto method for calling cryptography function

Example

let api = alpha_vantage::set_api("demo");
let crypto = api.crypto(alpha_vantage::util::CryptoFunction::Daily, "BTC", "CNY");
let digital_name = crypto.digital_name();
assert_eq!(digital_name.unwrap(), String::from("Bitcoin"));

pub fn exchange(&self, from_currency: &str, to_currency: &str) -> Exchange[src]

Method for exchanging currency value from one currency to another currency.

Example

let api = alpha_vantage::set_api("demo");
assert_eq!(
    api.exchange("BTC", "CNY").name_from().unwrap(),
    String::from("Bitcoin")
);

pub fn forex(
    &self,
    function: ForexFunction,
    from_symbol: &str,
    to_symbol: &str,
    interval: Interval,
    output_size: OutputSize
) -> Forex
[src]

Forex method for calling stock time series

Example

use alpha_vantage::util::*;
let api = alpha_vantage::set_api("demo");
let forex = api.forex(
    ForexFunction::Weekly,
    "EUR",
    "USD",
    Interval::None,
    OutputSize::None,
);
assert_eq!(forex.symbol_from().unwrap(), "EUR".to_string());

pub fn quote(&self, symbol: &str) -> Quote[src]

Method for returning Quote Struct

Example

let api = alpha_vantage::set_api("demo");
let quote = api.quote("MSFT");
assert_eq!(quote.open().is_ok(), true);

pub fn search(&self, keywords: &str) -> Search[src]

Search method for searching keyword or company

Example

let api = alpha_vantage::set_api("demo");
let search = api.search("BA");
assert_eq!(search.result().is_ok(), true);

pub fn sector(&self) -> Sector[src]

Method for returning out a sector data as struct

Example

let api = alpha_vantage::set_api("demo");
let sector = api.sector();
assert_eq!(sector.information().is_ok(), true);

pub fn stock_time(
    &self,
    function: StockFunction,
    symbol: &str,
    interval: Interval,
    output_size: OutputSize
) -> TimeSeries
[src]

Stock time method for calling stock time series API

Example

use alpha_vantage::util::*;
let api = alpha_vantage::set_api("demo");
let stock = api.stock_time(
    StockFunction::Weekly,
    "MSFT",
    Interval::None,
    OutputSize::None,
);
assert_eq!(stock.symbol().unwrap(), "MSFT".to_string());

pub fn technical_indicator(
    &self,
    function: &str,
    symbol: &str,
    interval: &str,
    series_type: Option<&str>,
    time_period: Option<&str>,
    temporary_value: Vec<TechnicalIndicator>
) -> Indicator
[src]

Technical indicator API caller method

Example

let api = alpha_vantage::set_api("demo");
let technical =
    api.technical_indicator("SEMA", "MSFT", "1min", Some("open"), Some("10"), vec![]);
assert_eq!(technical.data().is_ok(), true);

Auto Trait Implementations

impl Send for APIKey

impl Sync for APIKey

Blanket Implementations

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T> From for T[src]

impl<T, U> TryFrom for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Erased for T