This makes it cheaper to introduce new features that might require
amending the list of variants by allowing us to introduce previously
uncovered causes or more specialized representations.
It encapsulates the implementation detail of holding a miniz_oxide
status within. The derived traits are not too extensive for other
possible representations as well.
Avoids leaking the dependency on `miniz_oxide` into the public interface
by making a constructor taking a status argument crate internal. It
would otherwise not be possible to replace the deflate decoder without
breaking that interface.
The discriminant of some enum types can be retrieved with the `as`
operator and in C style enums it is also possible to set a specific
discriminant. However, that may silently change—breaking the value
written to the file. It is better to use that technique mostly for ffi
purposes.
Several other uses that currently rely on num-traits for conversion have
no Unknown representation. Thus, the converter now outputs only known
variants or an error and the exposing function then can put the error
value into an Unknown variant instead.
Factor out parts that are unique to instantiations such as the name, the
documentation, the underlying type, the public conversion methods.
Also adds the ability to document individual items and remodels the
syntax to more closely resemble ordinary enum definitions.
There are no function changes from 0.3 but the compiler requirements
have been lowered. This avoids having to make a decision on `image`
right now, which would delay valuable bug fixes and improvements.