Derive Clone for RetryLayer (#726)

This commit is contained in:
Adrien Guillo 2023-03-24 18:59:48 -03:00 committed by GitHub
parent 664cb35abb
commit d2f1703c48
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -2,13 +2,13 @@ use super::Retry;
use tower_layer::Layer;
/// Retry requests based on a policy
#[derive(Debug)]
#[derive(Debug, Clone)]
pub struct RetryLayer<P> {
policy: P,
}
impl<P> RetryLayer<P> {
/// Create a new [`RetryLayer`] from a retry policy
/// Creates a new [`RetryLayer`] from a retry policy.
pub fn new(policy: P) -> Self {
RetryLayer { policy }
}