maybe

Crates.iomaybe
lib.rsmaybe
version0.1.1
created_at2025-05-05 04:12:50.935808+00
updated_at2025-05-10 21:55:51.326267+00
descriptionAn enum similar to Option but can also represent undefined values
homepage
repositoryhttps://github.com/taennan/maybe
max_upload_size
id1660135
size29,427
taennan (taennan)

documentation

README

Maybe

A simple enum similar to Option<T> but with three variants:

  • Some(T): Contains a value of type T
  • None: Explicitly set to null/none
  • Void: 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

Features

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
] }
Commit count: 5

cargo fmt