13 releases
| 0.1.12 | Jul 15, 2025 |
|---|---|
| 0.1.11 | Jul 4, 2025 |
| 0.1.10 | Jun 25, 2025 |
| 0.1.9 | Jan 22, 2025 |
#880 in Encoding
36 downloads per month
Used in 3 crates
(2 directly)
7KB
114 lines
MaybeReference
This is a utility crate that establishes an enum to use to match a JSON value that may be a single string (a "reference"), a reference in the form of {"id": "reference"} or an object.
"https://example.com/id/uuid"
{"id": "reference"}
{"id": "reference", "content": "somecontent"}
These would all match to MaybeReference<String> as ::Reference, ::Identifier, ::Actual, respectively.
Dependencies
~2.7–5MB
~89K SLoC