pub struct ExecutionPolicyBuilder<T, E> { /* private fields */ }Expand description
Fluent builder for an ExecutionPolicy.
Implementations§
Source§impl<T, E> ExecutionPolicyBuilder<T, E>
impl<T, E> ExecutionPolicyBuilder<T, E>
pub fn new() -> Self
pub fn retry(self, retry: Retry<T, E>) -> Self
pub fn attempt_timeout(self, d: Duration) -> Self
pub fn total_timeout(self, d: Duration) -> Self
pub fn circuit_breaker(self, breaker: CircuitBreaker<E>) -> Self
pub fn concurrency_limit(self, limit: impl Into<ConcurrencyLimit>) -> Self
Sourcepub fn on_event(self, hook: impl Fn(&Event) + Send + Sync + 'static) -> Self
pub fn on_event(self, hook: impl Fn(&Event) + Send + Sync + 'static) -> Self
Register a synchronous, cheap event hook. Not catch_unwind-wrapped — a
panicking hook surfaces as a bug (fail fast).
Sourcepub fn with_tracing(self) -> Self
pub fn with_tracing(self) -> Self
Bridge events to tracing at debug level.
Sourcepub fn build(self) -> ExecutionPolicy<DefaultCore, T, E>
pub fn build(self) -> ExecutionPolicy<DefaultCore, T, E>
Validate and build with the default core. Panics on invalid config.
Sourcepub fn try_build(self) -> Result<ExecutionPolicy<DefaultCore, T, E>, BuildError>
pub fn try_build(self) -> Result<ExecutionPolicy<DefaultCore, T, E>, BuildError>
Validate and build with the default core, returning an error on bad config.
Sourcepub fn build_with<C: Core>(self, core: C) -> ExecutionPolicy<C, T, E>
pub fn build_with<C: Core>(self, core: C) -> ExecutionPolicy<C, T, E>
Validate and build with a custom Core. Panics on invalid config.
Trait Implementations§
Source§impl<T, E> Debug for ExecutionPolicyBuilder<T, E>
impl<T, E> Debug for ExecutionPolicyBuilder<T, E>
Auto Trait Implementations§
impl<T, E> !RefUnwindSafe for ExecutionPolicyBuilder<T, E>
impl<T, E> !UnwindSafe for ExecutionPolicyBuilder<T, E>
impl<T, E> Freeze for ExecutionPolicyBuilder<T, E>
impl<T, E> Send for ExecutionPolicyBuilder<T, E>
impl<T, E> Sync for ExecutionPolicyBuilder<T, E>
impl<T, E> Unpin for ExecutionPolicyBuilder<T, E>
impl<T, E> UnsafeUnpin for ExecutionPolicyBuilder<T, 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