pub enum DisconnectReason {
Dial(Arc<dyn Error + Sync + Send>),
Connection(Arc<dyn Error + Sync + Send>),
Fetch(FetchError),
Session(Error),
Conflict,
SelfConnection,
Command,
}Expand description
Disconnect reason.
Variants§
Dial(Arc<dyn Error + Sync + Send>)
Error while dialing the remote. This error occures before a connection is even established. Errors of this kind are usually not transient.
Connection(Arc<dyn Error + Sync + Send>)
Error with an underlying established connection. Sometimes, reconnecting after such an error is possible.
Fetch(FetchError)
Error with a fetch.
Session(Error)
Session error.
Conflict
Session conflicts with existing session.
SelfConnection
Connection to self.
Command
User requested disconnect
Implementations§
Source§impl DisconnectReason
impl DisconnectReason
pub fn is_dial_err(&self) -> bool
pub fn is_connection_err(&self) -> bool
pub fn connection() -> Self
Trait Implementations§
Source§impl Debug for DisconnectReason
impl Debug for DisconnectReason
Auto Trait Implementations§
impl Freeze for DisconnectReason
impl !RefUnwindSafe for DisconnectReason
impl Send for DisconnectReason
impl Sync for DisconnectReason
impl Unpin for DisconnectReason
impl !UnwindSafe for DisconnectReason
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> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more