Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Allow clone on backoff builder #30

Merged
merged 1 commit into from
Feb 8, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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