Skip to main content

enum_partial_cmp

Function enum_partial_cmp 

Source
pub fn enum_partial_cmp(
    a: &dyn Enum,
    b: &dyn PartialReflect,
) -> Option<Ordering>
Expand description

Compares two Enum values (by variant) and returns their ordering.

Returns None if the comparison couldn’t be performed (e.g., kinds mismatch or an element comparison returns None).

The ordering is same with derive macro. First order by variant index, then by fields.