pub trait EnumSqlType<const HAS_EXPLICIT_DISCRIMINANT: bool, DB: Backend>: SqlType {
type Strategy: EnumMapping<DB>;
}Expand description
A marker trait for SQL types representing database side enums
This trait describes how an enum should be mapped to the underlying database storage type by specifying one of a set of different strategies.
The generic constant HAS_EXPLICIT_DISCRIMINANT can be used to enforce that for a given mapping
the user needs to provide explicit discriminant values. The #[derive(Enum)] macro
will pass the true only if this is the case.
The generic type DB represents the database backend for which this mapping is valid
§Deriving
This trait can be automatically derived by using #[derive(SqlType)]
with the #[diesel(enum_type)] attribute
Required Associated Types§
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".