pub enum ConnectError {
MaximumConnectionsReached {
limit: u16,
},
AlreadyConnecting {
address: SocketAddr,
},
AlreadyConnected {
address: SocketAddr,
},
SelfConnect {
address: SocketAddr,
},
BannedIp {
ip: IpAddr,
},
IoError(Error),
ApplicationError(Box<dyn ApplicationError>),
Other(Box<dyn Error + Send + Sync>),
}Expand description
Error types for the Tcp::connect function.
Variants§
MaximumConnectionsReached
AlreadyConnecting
Fields
§
address: SocketAddrAlreadyConnected
Fields
§
address: SocketAddrSelfConnect
Fields
§
address: SocketAddrBannedIp
IoError(Error)
ApplicationError(Box<dyn ApplicationError>)
Other(Box<dyn Error + Send + Sync>)
An unexpected error at the application layer and certain deserialization errors. TODO(kaimast): (some of) these should be treated with higher severity, as they indicate a bug or corrupted state, and deserialization errors should not be included in this “other” category.
Implementations§
Source§impl ConnectError
impl ConnectError
Sourcepub fn application<E: ApplicationError>(err: E) -> Self
pub fn application<E: ApplicationError>(err: E) -> Self
Pass an application-level error to the Tcp stack.
Trait Implementations§
Source§impl Debug for ConnectError
impl Debug for ConnectError
Source§impl Display for ConnectError
impl Display for ConnectError
Source§impl Error for ConnectError
impl Error for ConnectError
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()
Source§impl From<ConnectError> for Error
impl From<ConnectError> for Error
Source§fn from(err: ConnectError) -> Self
fn from(err: ConnectError) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for ConnectError
impl !RefUnwindSafe for ConnectError
impl Send for ConnectError
impl Sync for ConnectError
impl Unpin for ConnectError
impl UnsafeUnpin for ConnectError
impl !UnwindSafe for ConnectError
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