retry_predicate/
retry_predicate.rs1use core::fmt;
2
3pub trait RetryPredicate<Params> {
5 fn test(&self, params: &Params) -> bool;
8
9 fn name(&self) -> &str {
10 "_"
11 }
12}
13
14impl<Params> fmt::Debug for dyn RetryPredicate<Params> {
16 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
17 f.debug_tuple("RetryPredicate")
18 .field(&RetryPredicate::name(self))
19 .finish()
20 }
21}
22
23impl<Params> fmt::Debug for dyn RetryPredicate<Params> + Send {
24 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
25 f.debug_tuple("RetryPredicate")
26 .field(&RetryPredicate::name(self))
27 .finish()
28 }
29}
30
31impl<Params> fmt::Debug for dyn RetryPredicate<Params> + Send + Sync {
32 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
33 f.debug_tuple("RetryPredicate")
34 .field(&RetryPredicate::name(self))
35 .finish()
36 }
37}