CommonLibrary/Transport/
Retry.rs1#![allow(non_snake_case, non_camel_case_types, non_upper_case_globals)]
2use std::time::Duration;
7
8#[derive(Debug, Clone)]
10pub struct RetryConfiguration {
11 pub MaximumAttempts:u32,
13
14 pub BaseDelay:Duration,
16
17 pub MaximumDelay:Duration,
19
20 pub JitterEnabled:bool,
22}
23
24impl Default for RetryConfiguration {
25 fn default() -> Self {
26 Self {
27 MaximumAttempts:3,
28
29 BaseDelay:Duration::from_millis(100),
30
31 MaximumDelay:Duration::from_secs(10),
32
33 JitterEnabled:true,
34 }
35 }
36}
37
38#[derive(Debug, Clone, Copy, PartialEq, Eq)]
40pub enum RetryStrategy {
41 None,
43
44 Fixed,
46
47 Exponential,
49
50 ExponentialJitter,
52}