Debian Codegraph @

examples/enum_repr.rs

raw symbols SCIP
1 use schemarsrust-analyzer cargo schemars 1.2.2 crate/::{schema_forrust-analyzer cargo schemars 1.2.2 macros/schema_for!, JsonSchema_reprrust-analyzer cargo schemars_derive 1.2.2 JsonSchema_repr:};
2
3 #[deriverust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/derive:(JsonSchema_reprrust-analyzer cargo schemars_derive 1.2.2 JsonSchema_repr:)]
4 #[repr(u8)]
5 enum SmallPrimerust-analyzer cargo schemars 1.2.2 SmallPrime# {
6 Tworust-analyzer cargo schemars 1.2.2 SmallPrime#Two# = 2,
7 Threerust-analyzer cargo schemars 1.2.2 SmallPrime#Three# = 3,
8 Fiverust-analyzer cargo schemars 1.2.2 SmallPrime#Five# = 5,
9 Sevenrust-analyzer cargo schemars 1.2.2 SmallPrime#Seven# = 7,
10 }
11
12 fn mainrust-analyzer cargo schemars 1.2.2 main().() {
13 let schema = schema_forrust-analyzer cargo schemars 1.2.2 macros/schema_for!!(SmallPrimerust-analyzer cargo schemars 1.2.2 SmallPrime#);
14 printlnrust-analyzer cargo std https://github.com/rust-lang/rust/library/std macros/println!!("{}", serde_jsonrust-analyzer cargo serde_json 1.0.151 crate/::to_string_prettyrust-analyzer cargo serde_json 1.0.151 ser/to_string_pretty().(&schema).unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap().());
15 }