Skip to main content

enum_components

Function enum_components 

Source
pub fn enum_components(
    types: &dyn TypeDatabase,
    type_id: TypeId,
) -> Option<(DefId, TypeId)>
Expand description

Extract the enum components (DefId and member type) if this is an Enum type.

Returns Some((def_id, member_type)) where:

  • def_id is the unique identity of the enum for nominal checking
  • member_type is the structural union of member types (e.g., 0 | 1)