mirror of
https://github.com/tower-rs/tower.git
synced 2025-09-30 22:41:17 +00:00
Derive Clone
for RetryLayer
(#726)
This commit is contained in:
parent
664cb35abb
commit
d2f1703c48
@ -2,13 +2,13 @@ use super::Retry;
|
|||||||
use tower_layer::Layer;
|
use tower_layer::Layer;
|
||||||
|
|
||||||
/// Retry requests based on a policy
|
/// Retry requests based on a policy
|
||||||
#[derive(Debug)]
|
#[derive(Debug, Clone)]
|
||||||
pub struct RetryLayer<P> {
|
pub struct RetryLayer<P> {
|
||||||
policy: P,
|
policy: P,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<P> RetryLayer<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 {
|
pub fn new(policy: P) -> Self {
|
||||||
RetryLayer { policy }
|
RetryLayer { policy }
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user