pub const fn variant_index_of<T>(variant: &T, variants: &[T]) -> usizeExpand description
Finds the index of variant in the variants slice using const-compatible equality.
This function is intended to be called inside const { } blocks in the derive macro,
so its O(N) cost is paid at compile time, not runtime.