pub struct ExceptionPolicyBuilder { /* private fields */ }Expand description
Builder for a single ExceptionPolicy attached to an ErrorHandlerConfig.
Implementations§
Source§impl ExceptionPolicyBuilder
impl ExceptionPolicyBuilder
Sourcepub fn retry(self, max_attempts: u32) -> Self
pub fn retry(self, max_attempts: u32) -> Self
Configure retry with the given maximum number of attempts (exponential backoff defaults).
Sourcepub fn with_backoff(
self,
initial: Duration,
multiplier: f64,
max: Duration,
) -> Self
pub fn with_backoff( self, initial: Duration, multiplier: f64, max: Duration, ) -> Self
Override backoff parameters for the retry (call after .retry()).
Sourcepub fn with_jitter(self, jitter_factor: f64) -> Self
pub fn with_jitter(self, jitter_factor: f64) -> Self
Set jitter factor for retry delays (call after .retry()).
Valid range: 0.0 (no jitter) to 1.0 (±100% randomization).
Sourcepub fn handled_by(self, uri: impl Into<String>) -> Self
pub fn handled_by(self, uri: impl Into<String>) -> Self
Route failed exchanges matching this policy to the given URI instead of the DLC.
Sourcepub fn build(self) -> ErrorHandlerConfig
pub fn build(self) -> ErrorHandlerConfig
Finish this policy and return the updated config.
Auto Trait Implementations§
impl Freeze for ExceptionPolicyBuilder
impl !RefUnwindSafe for ExceptionPolicyBuilder
impl Send for ExceptionPolicyBuilder
impl Sync for ExceptionPolicyBuilder
impl Unpin for ExceptionPolicyBuilder
impl UnsafeUnpin for ExceptionPolicyBuilder
impl !UnwindSafe for ExceptionPolicyBuilder
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