Open fu5ha opened 3 days ago
I took a stab at implementing this in this branch: https://github.com/EmbarkStudios/open-enum/tree/with_closed but in actually trying to use it in our FFI layer it proved less ergonomic than I thought, so I'm not going to go ahead with cleaning it up and PRing unless some more design work happens.
In implementing #24 and using it in our code based, the
TryFromKnownRepr
is useful but only moderately, since you still can't get an exhaustive match on just the known variants afterwards. It would be nice to somehow expose the original closed form of the enum as well, either as justOriginalIdentClosed
or perhaps some traitthen you can
OriginalIdent::Closed
?And provide infallible
From<Closed> for Open
and fallibleTryFrom<Closed> for Open
, as replacement forTryFromKnownRepr
.