Skip to content

Commit

Permalink
feat: Allow clone on backoff builder (#30)
Browse files Browse the repository at this point in the history
Signed-off-by: Xuanwo <github@xuanwo.io>
  • Loading branch information
Xuanwo committed Feb 8, 2023
1 parent d073d88 commit 5bc8c6e
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/backoff.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
2 changes: 1 addition & 1 deletion src/constant.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ use crate::backoff::BackoffBuilder;
/// Ok(())
/// }
/// ```
#[derive(Debug)]
#[derive(Debug, Clone)]
pub struct ConstantBuilder {
delay: Duration,
max_times: Option<usize>,
Expand Down
2 changes: 1 addition & 1 deletion src/exponential.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ use crate::backoff::BackoffBuilder;
/// Ok(())
/// }
/// ```
#[derive(Debug)]
#[derive(Debug, Clone)]
pub struct ExponentialBuilder {
jitter: bool,
factor: f32,
Expand Down

0 comments on commit 5bc8c6e

Please sign in to comment.