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§
Sourcefn error_code(&self) -> &'static str
fn error_code(&self) -> &'static str
Returns a unique error code string for this error variant.
Sourcefn suggestion(&self) -> Option<&'static str>
fn suggestion(&self) -> Option<&'static str>
Returns an optional actionable suggestion for resolving the error.