[−][src]Macro activitystreams::kind
Generate an enum implementing serde's Serialize and Deserialize with a single variant
This is useful for describing constants
use activitystreams::kind; kind!(CustomType, Custom); #[derive(serde::Deserialize)] struct MyStruct { #[serde(rename = "type")] kind: CustomType, } let s: MyStruct = serde_json::from_str(r#"{"type":"Custom"}"#)?; assert_eq!(s.kind, CustomType::Custom);