pub struct WeightedRequest<T> { /* private fields */ }Expand description
A REST request that knows its weight. Call send.
Implementations§
Source§impl<T> WeightedRequest<T>
impl<T> WeightedRequest<T>
Source§impl<T: DeserializeOwned> WeightedRequest<T>
impl<T: DeserializeOwned> WeightedRequest<T>
Sourcepub async fn send(self) -> Result<T, BinanceError>
pub async fn send(self) -> Result<T, BinanceError>
Waits for the budget, sends, and decodes the response.
A 429 starts a cooldown every request on the budget waits out, then
this request is retried on core’s schedule; with no retry left and no
Retry-After, the cooldown runs to the next UTC minute. A 418 starts a
cooldown for its Retry-After, or 2 minutes, and is not retried.
The wait has no deadline of its own: a request can wait out a minute’s
spent budget or a ban, which Binance documents at up to 3 days. Wrap the
call in tokio::time::timeout where a caller needs a deadline.
Auto Trait Implementations§
impl<T> !RefUnwindSafe for WeightedRequest<T>
impl<T> !UnwindSafe for WeightedRequest<T>
impl<T> Freeze for WeightedRequest<T>
impl<T> Send for WeightedRequest<T>
impl<T> Sync for WeightedRequest<T>
impl<T> Unpin for WeightedRequest<T>
impl<T> UnsafeUnpin for WeightedRequest<T>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more