[][src]Struct alpha_vantage::forex::Forex

pub struct Forex { /* fields omitted */ }

Struct to store Forex data after forex API call

Methods

impl Forex[src]

pub fn information(&self) -> Result<String, String>[src]

Return information of data

use alpha_vantage::util::*;
let api = alpha_vantage::set_api("demo");
let forex = api.forex(
    ForexFunction::IntraDay,
    "EUR",
    "USD",
    Interval::FiveMin,
    OutputSize::Full,
);
let information = forex.information();
assert_eq!(information.unwrap(), "FX Intraday (5min) Time Series");

pub fn symbol_from(&self) -> Result<String, String>[src]

Retrun from symbol

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

pub fn symbol_to(&self) -> Result<String, String>[src]

Return to symbol

use alpha_vantage::util::*;
let api = alpha_vantage::set_api("demo");
let forex = api.forex(
    ForexFunction::IntraDay,
    "EUR",
    "USD",
    Interval::FiveMin,
    OutputSize::Full,
);
let symbol_to = forex.symbol_to();
assert_eq!(symbol_to.unwrap(), "USD");

pub fn last_refreshed(&self) -> Result<String, String>[src]

Return last refreshed time with time zone

pub fn interval(&self) -> Result<String, String>[src]

Return out interval for intraday

use alpha_vantage::util::*;
let api = alpha_vantage::set_api("demo");
let forex = api.forex(
    ForexFunction::IntraDay,
    "EUR",
    "USD",
    Interval::FiveMin,
    OutputSize::Full,
);
let interval = forex.interval();
assert_eq!(interval.unwrap(), "5min");

pub fn output_size(&self) -> Result<String, String>[src]

Return output size which can be full or compact

use alpha_vantage::util::*;
let api = alpha_vantage::set_api("demo");
let forex = api.forex(
    ForexFunction::IntraDay,
    "EUR",
    "USD",
    Interval::FiveMin,
    OutputSize::Full,
);
let output_size = forex.output_size();
assert_eq!(output_size.unwrap(), "Full size");

pub fn entry(&self) -> Result<Vec<Entry>, String>[src]

Method return Entry

Trait Implementations

impl Default for Forex[src]

impl Debug for Forex[src]

Auto Trait Implementations

impl Send for Forex

impl Sync for Forex

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