pub enum NetworkError {
BindFailed {
addr: SocketAddr,
source: Error,
},
ConnectionFailed {
addr: SocketAddr,
source: Error,
},
PeerBanned {
addr: SocketAddr,
expires_at: DateTime<Utc>,
},
MessageTooLarge {
size: usize,
max_size: usize,
},
InvalidMessage {
reason: String,
},
Timeout {
duration: Duration,
},
NoPeersAvailable,
}
Expand description
Network-specific error types
Variants§
BindFailed
Failed to bind to socket
ConnectionFailed
Failed to connect to peer
PeerBanned
Peer is banned
MessageTooLarge
Message too large
InvalidMessage
Invalid message format
Timeout
Timeout occurred
NoPeersAvailable
No peers available
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
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 ChaincraftError
impl From<NetworkError> for ChaincraftError
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
Source§impl<E> Fail for E
impl<E> Fail for E
Source§fn cause(&self) -> Option<&(dyn Fail + 'static)>
fn cause(&self) -> Option<&(dyn Fail + 'static)>
Returns a reference to the underlying cause of this failure, if it
is an error that wraps other errors. Read more
Source§fn backtrace(&self) -> Option<&Backtrace>
fn backtrace(&self) -> Option<&Backtrace>
Returns a reference to the
Backtrace
carried by this failure, if it
carries one. Read more