pub trait DbEnum: Sized {
const ENUM_NAME: &'static str;
const VARIANTS: &'static [&'static str];
const SQL_TYPE: SqlType = _;
// Required methods
fn as_db_str(&self) -> &'static str;
fn from_db_str(value: &str) -> Result<Self>;
}Expand description
A Rust enum mapped to a fixed set of stored text values.
Required Associated Constants§
Provided Associated Constants§
Required Methods§
Sourcefn from_db_str(value: &str) -> Result<Self>
fn from_db_str(value: &str) -> Result<Self>
Parses a stored text value back into the enum.
Returns a conversion error when the value is not one of VARIANTS.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".