#[non_exhaustive]pub enum HandshakeError {
NoData,
InvalidMarker(u8),
EncryptionProtocolMismatch(&'static str),
MalformedFrame,
MacFailure,
Crypto(String),
Aborted,
}Expand description
Failures while establishing a connection or performing the encryption handshake. All of these are returned before the read/write loops start.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
NoData
No bytes were received on a freshly accepted connection (for example, a port probe that connects and immediately closes).
InvalidMarker(u8)
The first byte was neither 0 (plaintext) nor 1 (encrypted).
EncryptionProtocolMismatch(&'static str)
The peer and this device disagree on transport encryption: one side offered plaintext while the other requires (or forbids) an encrypted connection. The contained string describes which side mismatched.
MalformedFrame
The peer sent a handshake frame that is too short to be valid.
MacFailure
The noise handshake failed its MAC check (wrong encryption key).
Crypto(String)
The noise handshake produced a cryptographic error while building our response. Unexpected; indicates a protocol or state problem rather than a peer disconnect.
Aborted
The peer went away mid-handshake, before it could complete.
Trait Implementations§
Source§impl Debug for HandshakeError
impl Debug for HandshakeError
Source§impl Display for HandshakeError
impl Display for HandshakeError
Source§impl Error for HandshakeError
impl Error for HandshakeError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()