Skip to main content

default_limits

Function default_limits 

pub fn default_limits() -> BrokerLimits
Expand description

The bundled Bybit limits, parsed.

A method with no route of its own spends the default route "*", so no call is free. Placing goes through a soft bucket of its own that cancel does not pass.

§Panics

Never in practice: the bundled file is checked by a test of this crate.

§Examples

use brokapi_bybit::limits::default_limits;
use brokapi_runtime::BrokerLimiter;
use std::time::Instant;

let limiter = BrokerLimiter::new(&default_limits());
assert!(limiter.acquire("PlaceOrder", Instant::now()).is_ok());