Debian Codegraph @

src/json_schema_impls/either1.rs

raw symbols SCIP
1 use craterust-analyzer cargo schemars 1.2.2 crate/::SchemaGeneratorrust-analyzer cargo schemars 1.2.2 generate/SchemaGenerator#;
2 use craterust-analyzer cargo schemars 1.2.2 crate/::_alloc_preluderust-analyzer cargo schemars 1.2.2 _alloc_prelude/::*;
3 use craterust-analyzer cargo schemars 1.2.2 crate/::{json_schemarust-analyzer cargo schemars 1.2.2 macros/json_schema!, JsonSchemarust-analyzer cargo schemars 1.2.2 JsonSchema#, Schemarust-analyzer cargo schemars 1.2.2 schema/Schema#};
4 use allocrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc crate/::borrowrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc borrow/::Cowrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc borrow/Cow#;
5 use either1rust-analyzer cargo either 1.17.0 crate/::Eitherrust-analyzer cargo either 1.17.0 Either#;
6
7 impl<L: JsonSchemarust-analyzer cargo schemars 1.2.2 JsonSchema#, R: JsonSchemarust-analyzer cargo schemars 1.2.2 JsonSchema#> JsonSchemarust-analyzer cargo schemars 1.2.2 JsonSchema# for Eitherrust-analyzer cargo either 1.17.0 Either#<L, R> {
8 inline_schemarust-analyzer cargo schemars 1.2.2 json_schema_impls/inline_schema!!();
9
10 fn schema_namerust-analyzer cargo schemars 1.2.2 json_schema_impls/either1/impl#[`Either<L, R>`][JsonSchema]schema_name().() -> Cowrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc borrow/Cow#<'static, str> {
11 formatrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc macros/format!!("Either_{}_or_{}", L::schema_namerust-analyzer cargo schemars 1.2.2 JsonSchema#schema_name().(), R::schema_namerust-analyzer cargo schemars 1.2.2 JsonSchema#schema_name().()).intorust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/impl#[T][`Into<U>`]into().()
12 }
13
14 fn schema_idrust-analyzer cargo schemars 1.2.2 json_schema_impls/either1/impl#[`Either<L, R>`][JsonSchema]schema_id().() -> Cowrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc borrow/Cow#<'static, str> {
15 formatrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc macros/format!!("either::Either<{}, {}>", L::schema_idrust-analyzer cargo schemars 1.2.2 JsonSchema#schema_id().(), R::schema_idrust-analyzer cargo schemars 1.2.2 JsonSchema#schema_id().()).intorust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/impl#[T][`Into<U>`]into().()
16 }
17
18 fn json_schemarust-analyzer cargo schemars 1.2.2 json_schema_impls/either1/impl#[`Either<L, R>`][JsonSchema]json_schema().(generator: &mut SchemaGeneratorrust-analyzer cargo schemars 1.2.2 generate/SchemaGenerator#) -> Schemarust-analyzer cargo schemars 1.2.2 schema/Schema# {
19 json_schemarust-analyzer cargo schemars 1.2.2 macros/json_schema!!({
20 "oneOf": [
21 {
22 "type": "object",
23 "properties": {
24 "Left": generator.subschema_forrust-analyzer cargo schemars 1.2.2 generate/impl#[SchemaGenerator]subschema_for().::<L>()
25 },
26 "additionalProperties": false,
27 "required": [
28 "Left"
29 ]
30 },
31 {
32 "type": "object",
33 "properties": {
34 "Right": generator.subschema_forrust-analyzer cargo schemars 1.2.2 generate/impl#[SchemaGenerator]subschema_for().::<R>()
35 },
36 "additionalProperties": false,
37 "required": [
38 "Right"
39 ]
40 }
41 ]
42 })
43 }
44 }