Debian Codegraph @

examples/enum_repr.rs

raw symbols SCIP
1 use schemars::{schema_for, JsonSchema_repr};
2
3 #[derive(JsonSchema_repr)]
4 #[repr(u8)]
5 enum SmallPrime {
6 Two = 2,
7 Three = 3,
8 Five = 5,
9 Seven = 7,
10 }
11
12 fn main() {
13 let schema = schema_for!(SmallPrime);
14 println!("{}", serde_json::to_string_pretty(&schema).unwrap());
15 }