This is a meta issue to collect the steps needed to move this crate forward. While it is currently "maintained", in that severe bugs will be merged, it's otherwise rotting. I'm hopeful we can revive it, but I'll need your help.
Related to
Previous Attempts
0.1: Mime(TopLevel::Plain, SubLevel::Text, [])
This allowed "expressive" matching like Mime(TopLevel::Text, SubLevel::Plain, _).
Cons:
- Needs several imports to construct and to match.
- The
SubLevel enum contained variants that only made sense for some top-level types.
- The +suffix (
application/text+xml) was conflated with the sub-level type.
- Exposed representation, so no optimizations were possible.
- A
SubLevel::Other(String) is a backwards-compatibility hazard for adding new variants that used to parse as Other.
0.3: struct Mime, mime::TEXT_PLAIN constants
Still allowed matching, (mime::TEXT, mime::PLAIN).
Cons:
- Couldn't create constant
Mimes
- Conflates types and ranges
- Conflates
Names and Values
0.4 (never released): MediaType, MediaRange, and mime! macro.
Separated Mime into type and range. The mime! macro was meant to allow easier constant creation. It could also allow nicer syntax, such as mime!("text" / "plain"), without any extra imports.
Cons:
- Macro required exposing an "__private_dont_use" field that the macro could set.
const fn has advanced that we probably could live without a macro.
This is a meta issue to collect the steps needed to move this crate forward. While it is currently "maintained", in that severe bugs will be merged, it's otherwise rotting. I'm hopeful we can revive it, but I'll need your help.
Related to
Previous Attempts
0.1:
Mime(TopLevel::Plain, SubLevel::Text, [])This allowed "expressive" matching like
Mime(TopLevel::Text, SubLevel::Plain, _).Cons:
SubLevelenum contained variants that only made sense for some top-level types.application/text+xml) was conflated with the sub-level type.SubLevel::Other(String)is a backwards-compatibility hazard for adding new variants that used to parse asOther.0.3:
struct Mime,mime::TEXT_PLAINconstantsStill allowed matching,
(mime::TEXT, mime::PLAIN).Cons:
MimesNames andValues0.4 (never released):
MediaType,MediaRange, andmime!macro.Separated
Mimeinto type and range. Themime!macro was meant to allow easier constant creation. It could also allow nicer syntax, such asmime!("text" / "plain"), without any extra imports.Cons:
const fnhas advanced that we probably could live without a macro.