Skip to main content

ToPublicError

Trait ToPublicError 

Source
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§

Source

fn to_public_error(&self) -> PublicError

Convert to external error

Source

fn to_error_code(&self) -> ErrorCode

Get external error codes

Source

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".

Implementors§