pub struct AsyncGuardAdapterBuilder<E: ExternalGuard + ?Sized> { /* private fields */ }Expand description
Fluent builder for AsyncGuardAdapter.
Implementations§
Source§impl<E: ExternalGuard + ?Sized> AsyncGuardAdapterBuilder<E>
impl<E: ExternalGuard + ?Sized> AsyncGuardAdapterBuilder<E>
Sourcepub fn circuit(self, circuit: CircuitBreakerConfig) -> Self
pub fn circuit(self, circuit: CircuitBreakerConfig) -> Self
Override the circuit breaker configuration.
Sourcepub fn retry(self, retry: RetryConfig) -> Self
pub fn retry(self, retry: RetryConfig) -> Self
Override retry configuration.
Sourcepub fn cache_capacity(self, capacity: NonZeroUsize) -> Self
pub fn cache_capacity(self, capacity: NonZeroUsize) -> Self
Set the cache capacity (non-zero).
Sourcepub fn rate_limit(self, rate_per_second: f64, burst: u32) -> Self
pub fn rate_limit(self, rate_per_second: f64, burst: u32) -> Self
Set the rate limiter (calls per second + burst).
Sourcepub fn circuit_open_verdict(self, verdict: CircuitOpenVerdict) -> Self
pub fn circuit_open_verdict(self, verdict: CircuitOpenVerdict) -> Self
Set the verdict returned while the breaker is open.
Sourcepub fn rate_limited_verdict(self, verdict: RateLimitedVerdict) -> Self
pub fn rate_limited_verdict(self, verdict: RateLimitedVerdict) -> Self
Set the verdict returned when the rate limiter rejects a call.
Sourcepub fn clock(self, clock: Arc<dyn Clock>) -> Self
pub fn clock(self, clock: Arc<dyn Clock>) -> Self
Override the time source. Primarily for tests.
Sourcepub fn build(self) -> AsyncGuardAdapter<E>
pub fn build(self) -> AsyncGuardAdapter<E>
Finalize the builder.
Auto Trait Implementations§
impl<E> Freeze for AsyncGuardAdapterBuilder<E>where
E: ?Sized,
impl<E> !RefUnwindSafe for AsyncGuardAdapterBuilder<E>
impl<E> Send for AsyncGuardAdapterBuilder<E>where
E: ?Sized,
impl<E> Sync for AsyncGuardAdapterBuilder<E>where
E: ?Sized,
impl<E> Unpin for AsyncGuardAdapterBuilder<E>where
E: ?Sized,
impl<E> UnsafeUnpin for AsyncGuardAdapterBuilder<E>where
E: ?Sized,
impl<E> !UnwindSafe for AsyncGuardAdapterBuilder<E>
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