pub trait ErrorCodewhere
Self: Sized,{
// Required methods
fn to_code(&self) -> u16;
fn from_code(code: u16) -> Option<Self>;
fn message(&self) -> &'static str;
}Expand description
Trait definable on enun to define error codes and their messages.
Required Methods§
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.