Expand description
Option<EmbeddedEnum> model fields.
A nullable embedded enum reuses its discriminant column as the head: NULL
= None, a variant value = Some(variant). The data-enum decode Match
gets a null else branch so a NULL (unmatched) discriminant decodes to
None; a unit-only enum’s discriminant column reads back as None directly.
Variant-only predicates (.is_email()) on the optional path are not yet
exposed — that needs the same Field path-machinery work deferred for
nested-field access on Option<struct>. Whole-value .eq(Some(Variant))
covers variant matching here.
Functions§
- option_
enum_ create_ ops - Driver-op coverage for create. A
Some(variant)writes the variant discriminant to the (shared) discriminant column and the variant’s fields to their columns (other variants’ columnsNULL); aNonewritesNULLto the discriminant and every variant column. - option_
enum_ crud - Round-trip
Some(variant)andNonefor both a data enum and a unit enum. - option_
enum_ db_ schema - The DB schema: nullable discriminant columns (named after the field) plus nullable variant-field columns for the data enum.
- option_
enum_ filter_ eq - Whole-value
.eq(Some(variant))matches the equalSomerow and neverNone, for both a data variant and a unit variant. - option_
enum_ filter_ ops - Driver-op coverage for filters.
.is_none()/.is_some()emit a predicate on the single discriminant column (IS NULL/NOT (.. IS NULL)), never a check distributed across the variant columns. - option_
enum_ filter_ presence .is_none()/.is_some()on anOption<enum>filter the discriminant column’s null-ness.- option_
enum_ update - Updating the whole value in both directions for a data and a unit enum.
- option_
enum_ update_ ops - Driver-op coverage for updates. Setting
Some(variant)assigns the variant discriminant + that variant’s column (othersNULL); settingNoneassignsNULLto the discriminant and every variant column.