enumx icon indicating copy to clipboard operation
enumx copied to clipboard

Document the generated enum

Open droundy opened this issue 5 years ago • 2 comments

It would be nice in the documentation to have some mention of the types that are generated by the macros. This seems relevant when considering this crate, in particular to see how a downstream user would be able to access errors without resorting to cex macros or impl Trait. It is the idea that any users of a crate that uses cex must also use cex macros?

droundy avatar Nov 17 '20 16:11 droundy

It might also be nice to simply link to the docs of a crate that uses cex, so we could see how the resulting type appears to a user.

droundy avatar Nov 17 '20 16:11 droundy

Documents about types generated by macros are scattered among enumx and cex's documents:

  1. The cex's Result!() macro

  2. The enumx's Enum!() macro

It is possible to use enumx crate directly rather than resorting to cex's Result!(), ret!() and throw!(). However, cex macros provide encapsulation of backtrace support.

I will add a separate section in enumx book, to explain the macro expansions.

oooutlk avatar Nov 22 '20 07:11 oooutlk