#[non_exhaustive]pub enum Failure {
Attempt(String),
Timeout(Duration),
Exhausted {
after: Duration,
last: Option<String>,
},
Loop,
Redirected,
Refused(&'static str),
Fixed,
Unanswered,
Taken,
}Expand description
A failure the policy itself decides on.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Attempt(String)
An address with another to fall back on did not connect in time.
Timeout(Duration)
A dial and its handshake outlasted Config::timeout.
Exhausted
The retry window ran out; carries the last failure’s message.
Fields
Loop
Peers redirected the connection around in a loop.
Redirected
The peer redirected a session elsewhere before it was healthy.
Refused(&'static str)
The redirect a GOAWAY named breaks the Redirect policy; carries why.
Fixed
A GOAWAY named a redirect for a target dialing fixed socket addresses.
Unanswered
A Dial was dropped without an answer.
Taken
The Dials given to Reconnect::with_dials already serve another policy.
Trait Implementations§
impl Eq for Failure
Source§impl Error for Failure
impl Error for Failure
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0:
use the Display impl or to_string()
impl StructuralPartialEq for Failure
Auto Trait Implementations§
impl Freeze for Failure
impl RefUnwindSafe for Failure
impl Send for Failure
impl Sync for Failure
impl Unpin for Failure
impl UnsafeUnpin for Failure
impl UnwindSafe for Failure
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.