pub enum VCLError {
Show 15 variants
CryptoError(String),
SignatureInvalid,
InvalidKey(String),
ChainValidationFailed,
ReplayDetected(String),
InvalidPacket(String),
ConnectionClosed,
Timeout,
NoPeerAddress,
NoSharedSecret,
HandshakeFailed(String),
ExpectedClientHello,
ExpectedServerHello,
SerializationError(String),
IoError(String),
}Expand description
The main error type for VCL Protocol operations.
Every public method that can fail returns Result<_, VCLError>.
§Example
use vcl_protocol::VCLError;
fn handle(err: VCLError) {
match err {
VCLError::ConnectionClosed => println!("Connection was closed"),
VCLError::Timeout => println!("Timed out"),
other => println!("Other error: {}", other),
}
}Variants§
CryptoError(String)
Encryption or decryption operation failed.
SignatureInvalid
Ed25519 signature verification failed — packet may be tampered.
InvalidKey(String)
A key has wrong length or invalid format.
ChainValidationFailed
The prev_hash field does not match the expected value — chain is broken.
ReplayDetected(String)
A packet with this sequence number or nonce was already received.
InvalidPacket(String)
Packet has unexpected structure or payload.
ConnectionClosed
Operation attempted on a closed connection.
Timeout
No activity for longer than the configured timeout_secs.
NoPeerAddress
send() called before a peer address is known.
send() or recv() called before the handshake completed.
HandshakeFailed(String)
X25519 handshake could not be completed.
ExpectedClientHello
Server received a non-ClientHello message during handshake.
ExpectedServerHello
Client received a non-ServerHello message during handshake.
SerializationError(String)
Bincode serialization or deserialization failed.
IoError(String)
UDP socket error or address parse failure.
Trait Implementations§
Source§impl Error for VCLError
impl Error for VCLError
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()