map-enum

Crates.iomap-enum
lib.rsmap-enum
version0.1.1
sourcesrc
created_at2024-10-21 11:21:33.577207
updated_at2024-10-21 11:23:13.5195
descriptionThis package introduces a procedural macro for generating typed enums.
homepagehttps://github.com/cargotoly/strenum
repositoryhttps://github.com/cargotoly/strenum
max_upload_size
id1417279
size13,396
Anatoly Weinstein (Anatoly03)

documentation

README

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.

Commit count: 13

cargo fmt