2 releases
0.1.1 | Oct 21, 2024 |
---|---|
0.1.0 | Oct 21, 2024 |
#356 in Procedural macros
272 downloads per month
10KB
105 lines
Typed Enum
String Enum
use map_enum::*;
#[derive(Default)]
#[StringEnum]
pub enum HTTPVersion {
Http0_9 = "HTTP/0.9",
Http1_0 = "HTTP/1.0",
#[default]
Http1_1 = "HTTP/1.1",
Http2 = "HTTP/2",
Http3 = "HTTP/3",
}
Introduces new enum grammar under the #[StringEnum]
macro, which implements string serialization and deserialization methods.
lib.rs
:
This module contains the procedural macro implementation
for the StringEnum
attribute.
Dependencies
~225–670KB
~16K SLoC