diff --git a/src/backoff.rs b/src/backoff.rs index e16a63f..2a34abc 100644 --- a/src/backoff.rs +++ b/src/backoff.rs @@ -2,7 +2,7 @@ use std::fmt::Debug; use std::time::Duration; /// BackoffBuilder is used to build a new backoff. -pub trait BackoffBuilder: Default + Debug + Send + Sync + Unpin { +pub trait BackoffBuilder: Clone + Debug + Send + Sync + Unpin { /// The associated backoff that returned by this builder. type Backoff: Backoff; diff --git a/src/constant.rs b/src/constant.rs index 7063ffe..1f8b524 100644 --- a/src/constant.rs +++ b/src/constant.rs @@ -31,7 +31,7 @@ use crate::backoff::BackoffBuilder; /// Ok(()) /// } /// ``` -#[derive(Debug)] +#[derive(Debug, Clone)] pub struct ConstantBuilder { delay: Duration, max_times: Option, diff --git a/src/exponential.rs b/src/exponential.rs index bf949d7..4081c7a 100644 --- a/src/exponential.rs +++ b/src/exponential.rs @@ -36,7 +36,7 @@ use crate::backoff::BackoffBuilder; /// Ok(()) /// } /// ``` -#[derive(Debug)] +#[derive(Debug, Clone)] pub struct ExponentialBuilder { jitter: bool, factor: f32,