Crates.io | map-enum |
lib.rs | map-enum |
version | 0.1.1 |
source | src |
created_at | 2024-10-21 11:21:33.577207 |
updated_at | 2024-10-21 11:23:13.5195 |
description | This package introduces a procedural macro for generating typed enums. |
homepage | https://github.com/cargotoly/strenum |
repository | https://github.com/cargotoly/strenum |
max_upload_size | |
id | 1417279 |
size | 13,396 |
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.