pub struct Pacer { /* private fields */ }Implementations§
Source§impl Pacer
impl Pacer
pub fn new(pacing: PacingLimits) -> Self
pub const fn pacing(&self) -> &PacingLimits
Sourcepub async fn acquire_patiently(
&self,
host: &str,
budget: Duration,
) -> Result<RequestPermit, PausedHost>
pub async fn acquire_patiently( &self, host: &str, budget: Duration, ) -> Result<RequestPermit, PausedHost>
@docgen The breaker is fail-fast, so without waiting out its own pause a single refusal turns a whole zone unknown.
pub async fn acquire(&self, host: &str) -> Result<RequestPermit, PausedHost>
Sourcepub async fn record_success(&self, host: &str)
pub async fn record_success(&self, host: &str)
@docgen Concurrency climbs one step per run of successes but is cut hard on any refusal, so recovery cannot re-trigger a block.
pub async fn record_refusal(&self, host: &str, refusal: &Refusal) -> Duration
pub async fn breaker(&self, host: &str) -> BreakerState
pub async fn paused(&self, host: &str) -> Option<PausedHost>
pub async fn paused_hosts(&self) -> Vec<PausedHost>
pub async fn host_concurrency(&self, host: &str) -> usize
Sourcepub async fn prune_settled_hosts(&self)
pub async fn prune_settled_hosts(&self)
@docgen A long sweep would otherwise keep a map entry for every endpoint it ever touched.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for Pacer
impl !RefUnwindSafe for Pacer
impl Send for Pacer
impl Sync for Pacer
impl Unpin for Pacer
impl UnsafeUnpin for Pacer
impl UnwindSafe for Pacer
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more