auto_enums
auto_enums copied to clipboard
A library for to allow multiple return types by automatically generated enum.
I've got a situation where a function returns something like `Result`, and it would be very useful to be able to use `auto_enum` on it. Is this technically possible, or...
The basic implementation of [`type_analysis` feature](https://docs.rs/auto_enums/0.7.6/auto_enums/#type_analysis-feature-disabled-by-default) is almost complete, but there are still some limitations.
Currently, [we can use proc-macro-derive to extend the supported traits](https://github.com/taiki-e/auto_enums#supported-traits), but we can consider providing another way.
https://github.com/taiki-e/auto_enums/issues/14#issuecomment-483672675 > Another problem is that the current `?` operator support generates the same number of variants as the `?` operators are used. This may generate code that is less...
Would it be possible to support tuples of iterators? (Basically doing it per tuple component.) So that this would work: 
My repro is unfortunately private code, so sorry...if it's not obvious what's going on I'll work up something else for you. But if you do something like this: ``` #[auto_enum(Iterator)]...
Fixes #163 Currently a WIP, the implementation works but isn't pretty nor clean. Refactor in progress, mostly moving code around, adding the feature gate, add tests, remove the `'convert'` as...
Example: ```rust use auto_enums::auto_enum; #[auto_enum(Fn)] fn make_operation(name: &str, operand: f64) -> impl Fn(f64) -> f64 { match name { "add" => move |x| x + operand, "sub" => move |x|...
Assuming all code paths implements the same `Into`/`From` "destination" it could be nice to let `auto_enums` generate those traits impls. This can, I think, theorically be done in the custom...