pub enum Error {
InvalidLength(&'static str),
InvalidEncoding(&'static str),
ParseFailure(&'static str),
UnsupportedFeature(&'static str),
CryptoFailure(&'static str),
StateError(&'static str),
}Expand description
Library-wide error type for length, encoding, parse, state, crypto, and feature failures.
Each variant carries a static diagnostic string suitable for logging and user-facing output.
Variants§
InvalidLength(&'static str)
Buffer or value length is outside the allowed range for the operation.
InvalidEncoding(&'static str)
Encoding rules (for example DER or wire format) were violated.
ParseFailure(&'static str)
Parsing failed for structural or syntactic reasons.
UnsupportedFeature(&'static str)
The requested capability is disabled or incompatible with current configuration.
CryptoFailure(&'static str)
A cryptographic primitive returned a verification or computation failure.
StateError(&'static str)
The operation is not valid in the current protocol or object state.
Trait Implementations§
Source§impl Display for Error
impl Display for Error
Source§fn fmt(&self, f: &mut Formatter<'_>) -> Result
fn fmt(&self, f: &mut Formatter<'_>) -> Result
Writes the embedded static message for this error variant into f.
§Arguments
self— Error whose message string is written.f— Formatter destination for the human-readable message.
§Returns
Ok(()) when the message is written successfully.
§Errors
Returns core::fmt::Error if the formatter rejects output (for example, a full buffer).
§Panics
This function does not panic.
Source§impl Error for Error
Available on crate feature std only.Bridges Error into std::error::Error for interoperability when the std feature is enabled.
impl Error for Error
std only.Bridges Error into std::error::Error for interoperability when the std feature is enabled.
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()