[][src]Struct trade::api::binance::Client

pub struct Client { /* fields omitted */ }

A binance API client.

The notification stream accessed through <Client as ApiClient>::stream is only valid for 24 hours and will automatically stop after the 24 hours mark. Just call stream again to get a new one.

The listen key is only valid for 60 minutes after its creation (through Client::new). Each <Client as ApiClient>::ping request will extend its validity for 60 minutes. Binance recommends sending a ping every 30 minutes. If the listen key becomes invalid, this client will stop forwarding the user data stream. The only way to fix it will be to drop the client and create a new one.

Methods

impl Client
[src]

Create a new binance API client with given params. If key_pair is not None, this will enable performing requests to the REST API and will request a listen key for the user data stream.

Note

The request may block the thread if requesting a listen key for the user data stream. The method will also block when fetching the available symbols from binance.

Trait Implementations

impl GenerateOrderId for Client
[src]

Use hint for generating an order id. Except for GDAX, this should just be == to_owned. Read more

impl ApiClient for Client
[src]

Type returned by the stream implementor, used for continuously receiving notifications. Read more

Find a symbol by name.

Start streaming notifications, only forward those indicated by flags.

Send an order to the exchange.

Send a cancel order to the exchange. Read more

Send a ping to the exchange. This can be used to measure the whole roundtrip time, including authentication and passage through the various software layers. For binance, the exchange must be pinged regularly in order to keep the listen key alive. Read more

Retrieve balances for this account.

Start streaming notifications.

Auto Trait Implementations

impl Send for Client

impl Sync for Client

Blanket Implementations

impl<T> IntoTimestamped for T
[src]

Add the current timestamp to self.

Add the given timestamp to self.

impl<T> IntoWithSymbol for T
[src]

Add the given symbol to a borrowed &self.

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

Performs the conversion.

impl<T> From for T
[src]

Performs the conversion.

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

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

🔬 This is a nightly-only experimental API. (try_from)

Performs the conversion.

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

Immutably borrows from an owned value. Read more

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

Mutably borrows from an owned value. Read more

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

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

🔬 This is a nightly-only experimental API. (try_from)

Performs the conversion.

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

🔬 This is a nightly-only experimental API. (get_type_id)

this method will likely be replaced by an associated static

Gets the TypeId of self. Read more

impl<T> Erased for T

impl<T> Erased for T