Registry / serialization / serde-variant

serde-variant

JSON →
library0.1.3rscratesunverified

Retrieve serde provided variant names for enum objects.

# Cargo.toml [dependencies] serde_variant = "0.1.3"
INSTALL
IMPORT
SIG · SERDE-VARIANT
S
serde-variant
serializationrustv0.1.3
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

to_variant_name
use serde_variant::to_variant_name;

Get the serde variant name of an enum variant.

use serde_variant::to_variant_name; use serde::Serialize; #[derive(Serialize)] enum MyEnum { Foo, Bar, } fn main() { let val = MyEnum::Foo; println!("{}", to_variant_name(&val).unwrap()); }
Debug
Known issues

No known issues recorded.

Upgrade
Version history
0.1.3latest on crates.io
Audit
Dependencies

No dependency data recorded yet.

Agent activity
11 hits · last 30 days
node
10
Resources
serde-variant — cargo add serde-variant · libregistry