Skip to main content

cast_to_enum

Function cast_to_enum 

Source
pub fn cast_to_enum(
    catalog: Option<&dyn EnumLabelCatalog>,
    value: &Value,
    source: Option<&ColumnType>,
    target: &ColumnType,
) -> Result<Option<Value>>
Expand description

Cast a value to an enum type: identity for the same type, enum_in for unknown literals and string-category sources, and 42846 otherwise. Returns None when the target is not an enum.