#enums #content #uuid #maybe-multiple #place-of-option #establishes

jdt_maybe_multiple

MaybeMultiple is a utility crate that establishes an enum to use in place of Option where the content may be singular, multiple, or None

7 releases

0.1.6 Jun 26, 2025
0.1.5 Jun 25, 2025
0.1.4 May 20, 2025
0.1.2 Jan 22, 2025

#67 in #content

Download history 33/week @ 2025-07-09 1/week @ 2025-07-16 8/week @ 2025-07-23 13/week @ 2025-07-30 9/week @ 2025-08-06 15/week @ 2025-08-20 3/week @ 2025-08-27 13/week @ 2025-09-03 1/week @ 2025-09-10 4/week @ 2025-09-24 16/week @ 2025-10-01 33/week @ 2025-10-15 8/week @ 2025-10-22

57 downloads per month
Used in 3 crates (2 directly)

MIT license

8KB
185 lines

MaybeMultiple

This is a utility crate that establishes an enum to use in place of Option where the content may be singular, multiple (a Vec) or None. It is particularly useful in situations where a JSON object is being deserialized and may take these types of forms:

"https://example.com/id/uuid"
["https://example.com/id/uuid1", "https://example.com/id/uuid2"]
null

These would all match to MaybeMultiple as ::Single, ::Multiple, ::None, respectively.

Dependencies

~2.7–5MB
~88K SLoC