I don't have a good name for this but a lot of enums have methods for each variant that return an Option<...> for that variant's data. Both Result and Option in the standard library do that for example. Could easily be derivable. Also there's fn is_<variant>(&self) -> bool for all of these variants too.
I don't have a good name for this but a lot of enums have methods for each variant that return an
Option<...>
for that variant's data. BothResult
andOption
in the standard library do that for example. Could easily be derivable. Also there'sfn is_<variant>(&self) -> bool
for all of these variants too.