Skip to main content

AuthsErrorInfo

Trait AuthsErrorInfo 

Source
pub trait AuthsErrorInfo {
    // Required methods
    fn error_code(&self) -> &'static str;
    fn suggestion(&self) -> Option<&'static str>;
}
Expand description

Trait for error metadata providing structured error codes and actionable suggestions.

All user-facing Auths error types implement this trait to provide:

  • A unique error code for programmatic handling (e.g., AUTHS-E3001)
  • An optional human-readable suggestion for how to resolve the error

Args: (no arguments — this is a trait definition)

Usage:

use auths_crypto::AuthsErrorInfo;

impl AuthsErrorInfo for MyError {
    fn error_code(&self) -> &'static str { "AUTHS-E0001" }
    fn suggestion(&self) -> Option<&'static str> { None }
}

Required Methods§

Source

fn error_code(&self) -> &'static str

Returns a unique error code string for this error variant.

Source

fn suggestion(&self) -> Option<&'static str>

Returns an optional actionable suggestion for resolving the error.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl AuthsErrorInfo for AttestationError

Source§

fn error_code(&self) -> &'static str

Source§

fn suggestion(&self) -> Option<&'static str>

Source§

impl AuthsErrorInfo for CommitVerificationError

Source§

fn error_code(&self) -> &'static str

Source§

fn suggestion(&self) -> Option<&'static str>

Source§

impl AuthsErrorInfo for KeriDecodeError

Source§

fn error_code(&self) -> &'static str

Source§

fn suggestion(&self) -> Option<&'static str>

Implementors§