pub enum NetworkError {
ConnectionFailed {
addr: String,
reason: String,
},
ConnectionTimeout {
addr: String,
timeout_ms: u64,
},
ConnectionClosed {
addr: String,
},
SendFailed {
addr: String,
reason: String,
},
ReceiveFailed {
addr: String,
reason: String,
},
InvalidAddress {
addr: String,
},
DnsResolutionFailed {
host: String,
reason: String,
},
TooManyRequests {
addr: String,
limit: usize,
},
RequestTimeout {
addr: String,
timeout_ms: u64,
},
}Expand description
Network operation errors
Variants§
ConnectionFailed
Connection to remote address failed
ConnectionTimeout
Connection timeout
ConnectionClosed
Connection was closed unexpectedly
SendFailed
Failed to send data
ReceiveFailed
Failed to receive data
InvalidAddress
Invalid address format
DnsResolutionFailed
DNS resolution failed
TooManyRequests
Too many requests (backpressure)
RequestTimeout
Request timeout
Implementations§
Source§impl NetworkError
impl NetworkError
Sourcepub fn connection_failed(
addr: impl Into<String>,
reason: impl Into<String>,
) -> Self
pub fn connection_failed( addr: impl Into<String>, reason: impl Into<String>, ) -> Self
Create a connection failed error
Sourcepub fn connection_timeout(addr: impl Into<String>, timeout_ms: u64) -> Self
pub fn connection_timeout(addr: impl Into<String>, timeout_ms: u64) -> Self
Create a connection timeout error
Sourcepub fn send_failed(addr: impl Into<String>, reason: impl Into<String>) -> Self
pub fn send_failed(addr: impl Into<String>, reason: impl Into<String>) -> Self
Create a send failed error
Sourcepub fn request_timeout(addr: impl Into<String>, timeout_ms: u64) -> Self
pub fn request_timeout(addr: impl Into<String>, timeout_ms: u64) -> Self
Create a request timeout error
Trait Implementations§
Source§impl Debug for NetworkError
impl Debug for NetworkError
Source§impl Display for NetworkError
impl Display for NetworkError
Source§impl Error for NetworkError
impl Error for NetworkError
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()
Source§impl From<NetworkError> for RocketMQError
impl From<NetworkError> for RocketMQError
Source§fn from(source: NetworkError) -> Self
fn from(source: NetworkError) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for NetworkError
impl RefUnwindSafe for NetworkError
impl Send for NetworkError
impl Sync for NetworkError
impl Unpin for NetworkError
impl UnwindSafe for NetworkError
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