#[non_exhaustive]pub enum Error {
Random(Error),
MissingSecret,
HandshakeTooLarge,
MalformedHandshake(Error),
UnsupportedVersion(u8),
InvalidServerProof,
InvalidClientProof,
InvalidFrame,
FrameTooLarge,
OutOfSequence,
InvalidMac,
SequenceExhausted,
}Expand description
Why a handshake or envelope was rejected
Every variant is terminal for the connection: the caller closes the socket and, for handshake failures, reports the message so a developer can tell a stale app or a version mismatch apart from a missing server.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Random(Error)
The operating system could not supply random bytes
MissingSecret
No session secret was provisioned
HandshakeTooLarge
A handshake message exceeded MAX_HANDSHAKE
MalformedHandshake(Error)
A handshake message was not valid for this protocol version
UnsupportedVersion(u8)
The peer announced a different PROTOCOL_VERSION
InvalidServerProof
The server could not prove it holds this app’s session secret
InvalidClientProof
The client could not prove it holds this server’s session secret
InvalidFrame
An envelope had an unknown version or kind, or was truncated
FrameTooLarge
An envelope or its payload exceeded the size limits
OutOfSequence
An envelope did not carry the next expected sequence number
InvalidMac
An envelope’s tag did not verify
SequenceExhausted
A direction used every available sequence number
Trait Implementations§
Source§impl Error for Error
impl Error for Error
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()