Debian Codegraph @

examples/main.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!, JsonSchemarust-analyzer cargo schemars 1.2.2 JsonSchema#};
2
3 #[deriverust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/derive:(JsonSchemarust-analyzer cargo schemars_derive 1.2.2 JsonSchema:)]
4 pub struct MyStructrust-analyzer cargo schemars 1.2.2 MyStruct# {
5 pub my_intrust-analyzer cargo schemars 1.2.2 MyStruct#my_int.: i32,
6 pub my_boolrust-analyzer cargo schemars 1.2.2 MyStruct#my_bool.: bool,
7 pub my_nullable_enumrust-analyzer cargo schemars 1.2.2 MyStruct#my_nullable_enum.: Optionrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#<MyEnumrust-analyzer cargo schemars 1.2.2 MyEnum#>,
8 }
9
10 #[deriverust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/derive:(JsonSchemarust-analyzer cargo schemars_derive 1.2.2 JsonSchema:)]
11 pub enum MyEnumrust-analyzer cargo schemars 1.2.2 MyEnum# {
12 StringNewTyperust-analyzer cargo schemars 1.2.2 MyEnum#StringNewType#(Stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/String#),
13 StructVariantrust-analyzer cargo schemars 1.2.2 MyEnum#StructVariant# { floatsrust-analyzer cargo schemars 1.2.2 MyEnum#StructVariant#floats.: Vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/Vec#<f32> },
14 }
15
16 fn mainrust-analyzer cargo schemars 1.2.2 main().() {
17 let schema = schema_forrust-analyzer cargo schemars 1.2.2 macros/schema_for!!(MyStructrust-analyzer cargo schemars 1.2.2 MyStruct#);
18 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().());
19 }