| Crates.io | maybe |
| lib.rs | maybe |
| version | 0.1.1 |
| created_at | 2025-05-05 04:12:50.935808+00 |
| updated_at | 2025-05-10 21:55:51.326267+00 |
| description | An enum similar to Option but can also represent undefined values |
| homepage | |
| repository | https://github.com/taennan/maybe |
| max_upload_size | |
| id | 1660135 |
| size | 29,427 |
A simple enum similar to Option<T> but with three variants:
Some(T): Contains a value of type TNone: Explicitly set to null/noneVoid: Not set/undefined (default state)This is particularly useful when working with APIs or data formats that need to distinguish between undefined fields and fields explicitly set to null, such as GraphQL, JSON, or other protocols where this distinction matters
This crate has optional support for serde and async-graphql through features:
[dependencies]
maybe = { version = "0.1", features = [
"serde", # Enables serialization/deserialization support via serde
"async_graphql" # Enables integration with async-graphql for use in GraphQL schemas
] }