pub fn parse_enum<E>(input: &str, param: &str) -> PyResult<E>
Expand description
Converts a raw string to the enum E
, returning a nicely‑formatted
PyValueError
if the string does not match any variant.
The helper is aimed at Python‑exposed functions that still accept plain
&str
parameters internally: call parse_enum
instead of writing repetitive
str::parse()
+ error‑formatting logic yourself.
§Errors
Returns an error if input
does not match any known variant of E
.