Trait Endpoint

Source
pub trait Endpoint {
    // Required methods
    fn as_endpoint(&self) -> String;
    fn http_verb(&self) -> HttpVerb;
    fn ip_weight(&self) -> Option<u16>;
    fn order_weight(&self) -> Option<u16>;
    fn security_type(&self) -> SecurityType;
}
Expand description

Fully describes the HTTP endpoint:

  • path;
  • HTTP method (verb);
  • weight (how much API limits will be affected by the query);
  • additional security to access the endpoint.

Required Methods§

Source

fn as_endpoint(&self) -> String

The HTTP path for the given request.

Source

fn http_verb(&self) -> HttpVerb

HTTP method (verb) used to access the endpoint. The most common are:

  • GET
  • POST
  • PUT
  • DELETE
Source

fn ip_weight(&self) -> Option<u16>

The API weight regarding IP limits for the given request.

Endpoints share the 1200 per minute limit based on IP.

Responses contain the header X-MBX-USED-WEIGHT-(intervalNum)(intervalLetter), defining the weight used by the current IP.

Source

fn order_weight(&self) -> Option<u16>

The API weight regarding UID (account) limits for the given request.

The order rate limit is counted against each account.

Successful order responses contain the header X-MBX-ORDER-COUNT-(intervalNum)(intervalLetter), defining the order limit used by the UID.

To monitor order count usage, refer to GET api/v3/rateLimit/order.

Source

fn security_type(&self) -> SecurityType

Determines access to the endpoint.

Implementors§

Source§

impl Endpoint for binance_api::FuturesApi

Source§

impl Endpoint for binance_api::SpotApi