[][src]Struct coinbase_rs::public::Public

pub struct Public<Adapter> { /* fields omitted */ }

Methods

impl<A> Public<A>[src]

pub fn new_with_keep_alive(uri: &str, keep_alive: bool) -> Self where
    A: AdapterNew
[src]

pub fn new(uri: &str) -> Self where
    A: AdapterNew
[src]

pub fn currencies(&self) -> A::Result where
    A: Adapter<Vec<Currency>> + 'static, 
[src]

Get currencies

List known currencies. Currency codes will conform to the ISO 4217 standard where possible. Currencies which have or had no representation in ISO 4217 may use a custom code (e.g. BTC).

https://developers.coinbase.com/api/v2#currencies

pub fn exchange_rates(&self) -> A::Result where
    A: Adapter<ExchangeRates> + 'static, 
[src]

Get exchange rates

Get current exchange rates. Default base currency is USD but it can be defined as any supported currency. Returned rates will define the exchange rate for one unit of the base currency.

https://developers.coinbase.com/api/v2#exchange-rates

pub fn buy_price(&self, currency_pair: &str) -> A::Result where
    A: Adapter<CurrencyPrice> + 'static, 
[src]

Get buy price

Get the total price to buy one bitcoin or ether.

https://developers.coinbase.com/api/v2#get-buy-price

pub fn sell_price(&self, currency_pair: &str) -> A::Result where
    A: Adapter<CurrencyPrice> + 'static, 
[src]

Get sell price

Get the total price to sell one bitcoin or ether.

https://developers.coinbase.com/api/v2#get-sell-price

pub fn spot_price(
    &self,
    currency_pair: &str,
    _date: Option<NaiveDate>
) -> A::Result where
    A: Adapter<CurrencyPrice> + 'static, 
[src]

Get spot price

Get the current market price for a currency pair. This is usually somewhere in between the buy and sell price.

https://developers.coinbase.com/api/v2#get-spot-price

pub fn current_time(&self) -> A::Result where
    A: Adapter<DateTime> + 'static, 
[src]

Get current time

Get the API server time.

https://developers.coinbase.com/api/v2#time

Auto Trait Implementations

impl<Adapter> Sync for Public<Adapter> where
    Adapter: Sync

impl<Adapter> Send for Public<Adapter> where
    Adapter: Send

impl<Adapter> Unpin for Public<Adapter> where
    Adapter: Unpin

impl<Adapter> !RefUnwindSafe for Public<Adapter>

impl<Adapter> !UnwindSafe for Public<Adapter>

Blanket Implementations

impl<T> From<T> for T[src]

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

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

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> 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> BorrowMut<T> for T where
    T: ?Sized
[src]

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

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

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> Erased for T