pub trait ToPublicError {
// Required methods
fn to_public_error(&self) -> PublicError;
fn to_error_code(&self) -> ErrorCode;
fn to_public_message(&self) -> String;
}Expand description
conversion trait of internal errors to external errors
Implementing this trait can convert internal errors into external errors and filter sensitive information
Required Methods§
Sourcefn to_public_error(&self) -> PublicError
fn to_public_error(&self) -> PublicError
Convert to external error
Sourcefn to_error_code(&self) -> ErrorCode
fn to_error_code(&self) -> ErrorCode
Get external error codes
Sourcefn to_public_message(&self) -> String
fn to_public_message(&self) -> String
Get external error messages (filter sensitive information)
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".