wait_utils/errors/
wait_strategy_error.rs1use std::error::Error;
7use std::fmt;
8
9#[derive(Debug, Clone)]
10pub struct WaitStrategyError(pub String);
11
12impl WaitStrategyError {
13 #[must_use]
14 pub fn new(field0: &str) -> Self {
15 Self(field0.to_string())
16 }
17}
18
19impl From<&str> for WaitStrategyError {
20 fn from(field0: &str) -> Self {
21 Self(field0.to_string())
22 }
23}
24
25impl From<String> for WaitStrategyError {
26 fn from(field0: String) -> Self {
27 Self(field0)
28 }
29}
30
31impl Error for WaitStrategyError {}
32
33impl fmt::Display for WaitStrategyError {
34 #[inline]
35 fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
36 write!(f, "WaitStrategyError: {}", self.0)
37 }
38}