pub struct Paced { /* private fields */ }Expand description
Spaces request starts at least min_interval apart, across all tasks
sharing it. Slots are handed out in arrival order, so waiting is fair.
In-process only; the cross-process limiter (DESIGN §6) is deferred.
Logs each request (at info, target aspero::http) with the provider
label, status, duration and time spent waiting for a slot.
Implementations§
Trait Implementations§
Source§impl HttpClient for Paced
impl HttpClient for Paced
Source§fn send<'life0, 'async_trait>(
&'life0 self,
request: HttpRequest,
) -> Pin<Box<dyn Future<Output = Result<HttpResponse, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn send<'life0, 'async_trait>(
&'life0 self,
request: HttpRequest,
) -> Pin<Box<dyn Future<Output = Result<HttpResponse, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Sends one request.
Ok for every HTTP status; Err only for transport
failures (Network, Timeout).Auto Trait Implementations§
impl !Freeze for Paced
impl !RefUnwindSafe for Paced
impl !UnwindSafe for Paced
impl Forget for Paced
impl Send for Paced
impl Sync for Paced
impl Unpin for Paced
impl UnsafeUnpin for Paced
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