| 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/::_privaterust-analyzer cargo schemars 1.2.2 _private/::allow_nullrust-analyzer cargo schemars 1.2.2 _private/allow_null().; |
| 4 | 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#}; |
| 5 | 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#; |
| 6 | use corerust-analyzer cargo core https://github.com/rust-lang/rust/library/core crate/::opsrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/::{Boundrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/Bound#, Rangerust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/Range#, RangeInclusiverust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/RangeInclusive#}; |
| 7 | |
| 8 | impl<T: JsonSchemarust-analyzer cargo schemars 1.2.2 JsonSchema#> JsonSchemarust-analyzer cargo schemars 1.2.2 JsonSchema# for Optionrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#<T> { |
| 9 | inline_schemarust-analyzer cargo schemars 1.2.2 json_schema_impls/inline_schema!!(); |
| 10 | |
| 11 | fn schema_namerust-analyzer cargo schemars 1.2.2 json_schema_impls/core/impl#[`Option<T>`][JsonSchema]schema_name().() -> Cowrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc borrow/Cow#<'static, str> { |
| 12 | formatrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc macros/format!!("Nullable_{}", T::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().() |
| 13 | } |
| 14 | |
| 15 | fn schema_idrust-analyzer cargo schemars 1.2.2 json_schema_impls/core/impl#[`Option<T>`][JsonSchema]schema_id().() -> Cowrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc borrow/Cow#<'static, str> { |
| 16 | formatrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc macros/format!!("Option<{}>", T::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().() |
| 17 | } |
| 18 | |
| 19 | fn json_schemarust-analyzer cargo schemars 1.2.2 json_schema_impls/core/impl#[`Option<T>`][JsonSchema]json_schema().(generator: &mut SchemaGeneratorrust-analyzer cargo schemars 1.2.2 generate/SchemaGenerator#) -> Schemarust-analyzer cargo schemars 1.2.2 schema/Schema# { |
| 20 | let mut schema = generator.subschema_forrust-analyzer cargo schemars 1.2.2 generate/impl#[SchemaGenerator]subschema_for().::<T>(); |
| 21 | |
| 22 | allow_nullrust-analyzer cargo schemars 1.2.2 _private/allow_null().(generator, &mut schema); |
| 23 | |
| 24 | schema |
| 25 | } |
| 26 | |
| 27 | fn _schemars_private_non_optional_json_schemarust-analyzer cargo schemars 1.2.2 json_schema_impls/core/impl#[`Option<T>`][JsonSchema]_schemars_private_non_optional_json_schema().(generator: &mut SchemaGeneratorrust-analyzer cargo schemars 1.2.2 generate/SchemaGenerator#) -> Schemarust-analyzer cargo schemars 1.2.2 schema/Schema# { |
| 28 | T::_schemars_private_non_optional_json_schemarust-analyzer cargo schemars 1.2.2 JsonSchema#_schemars_private_non_optional_json_schema().(generator) |
| 29 | } |
| 30 | |
| 31 | fn _schemars_private_is_optionrust-analyzer cargo schemars 1.2.2 json_schema_impls/core/impl#[`Option<T>`][JsonSchema]_schemars_private_is_option().() -> bool { |
| 32 | true |
| 33 | } |
| 34 | } |
| 35 | |
| 36 | impl<T: JsonSchemarust-analyzer cargo schemars 1.2.2 JsonSchema#, E: JsonSchemarust-analyzer cargo schemars 1.2.2 JsonSchema#> JsonSchemarust-analyzer cargo schemars 1.2.2 JsonSchema# for Resultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#<T, E> { |
| 37 | fn schema_namerust-analyzer cargo schemars 1.2.2 json_schema_impls/core/impl#[`Result<T, E>`][JsonSchema]schema_name().() -> Cowrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc borrow/Cow#<'static, str> { |
| 38 | formatrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc macros/format!!("Result_of_{}_or_{}", T::schema_namerust-analyzer cargo schemars 1.2.2 JsonSchema#schema_name().(), E::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().() |
| 39 | } |
| 40 | |
| 41 | fn schema_idrust-analyzer cargo schemars 1.2.2 json_schema_impls/core/impl#[`Result<T, E>`][JsonSchema]schema_id().() -> Cowrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc borrow/Cow#<'static, str> { |
| 42 | formatrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc macros/format!!("Result<{}, {}>", T::schema_idrust-analyzer cargo schemars 1.2.2 JsonSchema#schema_id().(), E::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().() |
| 43 | } |
| 44 | |
| 45 | fn json_schemarust-analyzer cargo schemars 1.2.2 json_schema_impls/core/impl#[`Result<T, E>`][JsonSchema]json_schema().(generator: &mut SchemaGeneratorrust-analyzer cargo schemars 1.2.2 generate/SchemaGenerator#) -> Schemarust-analyzer cargo schemars 1.2.2 schema/Schema# { |
| 46 | json_schemarust-analyzer cargo schemars 1.2.2 macros/json_schema!!({ |
| 47 | "oneOf": [ |
| 48 | { |
| 49 | "type": "object", |
| 50 | "properties": { |
| 51 | "Ok": generator.subschema_forrust-analyzer cargo schemars 1.2.2 generate/impl#[SchemaGenerator]subschema_for().::<T>() |
| 52 | }, |
| 53 | "required": ["Ok"] |
| 54 | }, |
| 55 | { |
| 56 | "type": "object", |
| 57 | "properties": { |
| 58 | "Err": generator.subschema_forrust-analyzer cargo schemars 1.2.2 generate/impl#[SchemaGenerator]subschema_for().::<E>() |
| 59 | }, |
| 60 | "required": ["Err"] |
| 61 | } |
| 62 | ] |
| 63 | }) |
| 64 | } |
| 65 | } |
| 66 | |
| 67 | impl<T: JsonSchemarust-analyzer cargo schemars 1.2.2 JsonSchema#> JsonSchemarust-analyzer cargo schemars 1.2.2 JsonSchema# for Boundrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/Bound#<T> { |
| 68 | fn schema_namerust-analyzer cargo schemars 1.2.2 json_schema_impls/core/impl#[`Bound<T>`][JsonSchema]schema_name().() -> Cowrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc borrow/Cow#<'static, str> { |
| 69 | formatrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc macros/format!!("Bound_of_{}", T::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().() |
| 70 | } |
| 71 | |
| 72 | fn schema_idrust-analyzer cargo schemars 1.2.2 json_schema_impls/core/impl#[`Bound<T>`][JsonSchema]schema_id().() -> Cowrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc borrow/Cow#<'static, str> { |
| 73 | formatrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc macros/format!!("Bound<{}>", T::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().() |
| 74 | } |
| 75 | |
| 76 | fn json_schemarust-analyzer cargo schemars 1.2.2 json_schema_impls/core/impl#[`Bound<T>`][JsonSchema]json_schema().(generator: &mut SchemaGeneratorrust-analyzer cargo schemars 1.2.2 generate/SchemaGenerator#) -> Schemarust-analyzer cargo schemars 1.2.2 schema/Schema# { |
| 77 | json_schemarust-analyzer cargo schemars 1.2.2 macros/json_schema!!({ |
| 78 | "oneOf": [ |
| 79 | { |
| 80 | "type": "object", |
| 81 | "properties": { |
| 82 | "Included": generator.subschema_forrust-analyzer cargo schemars 1.2.2 generate/impl#[SchemaGenerator]subschema_for().::<T>() |
| 83 | }, |
| 84 | "required": ["Included"] |
| 85 | }, |
| 86 | { |
| 87 | "type": "object", |
| 88 | "properties": { |
| 89 | "Excluded": generator.subschema_forrust-analyzer cargo schemars 1.2.2 generate/impl#[SchemaGenerator]subschema_for().::<T>() |
| 90 | }, |
| 91 | "required": ["Excluded"] |
| 92 | }, |
| 93 | { |
| 94 | "type": "string", |
| 95 | "const": "Unbounded" |
| 96 | } |
| 97 | ] |
| 98 | }) |
| 99 | } |
| 100 | } |
| 101 | |
| 102 | impl<T: JsonSchemarust-analyzer cargo schemars 1.2.2 JsonSchema#> JsonSchemarust-analyzer cargo schemars 1.2.2 JsonSchema# for Rangerust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/Range#<T> { |
| 103 | fn schema_namerust-analyzer cargo schemars 1.2.2 json_schema_impls/core/impl#[`Range<T>`][JsonSchema]schema_name().() -> Cowrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc borrow/Cow#<'static, str> { |
| 104 | formatrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc macros/format!!("Range_of_{}", T::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().() |
| 105 | } |
| 106 | |
| 107 | fn schema_idrust-analyzer cargo schemars 1.2.2 json_schema_impls/core/impl#[`Range<T>`][JsonSchema]schema_id().() -> Cowrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc borrow/Cow#<'static, str> { |
| 108 | formatrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc macros/format!!("Range<{}>", T::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().() |
| 109 | } |
| 110 | |
| 111 | fn json_schemarust-analyzer cargo schemars 1.2.2 json_schema_impls/core/impl#[`Range<T>`][JsonSchema]json_schema().(generator: &mut SchemaGeneratorrust-analyzer cargo schemars 1.2.2 generate/SchemaGenerator#) -> Schemarust-analyzer cargo schemars 1.2.2 schema/Schema# { |
| 112 | let subschema = generator.subschema_forrust-analyzer cargo schemars 1.2.2 generate/impl#[SchemaGenerator]subschema_for().::<T>(); |
| 113 | json_schemarust-analyzer cargo schemars 1.2.2 macros/json_schema!!({ |
| 114 | "type": "object", |
| 115 | "properties": { |
| 116 | "start": subschema, |
| 117 | "end": subschema |
| 118 | }, |
| 119 | "required": ["start", "end"] |
| 120 | }) |
| 121 | } |
| 122 | } |
| 123 | |
| 124 | forward_implrust-analyzer cargo schemars 1.2.2 json_schema_impls/forward_impl!!((<T: JsonSchemarust-analyzer cargo schemars 1.2.2 JsonSchema#> JsonSchemarust-analyzer cargo schemars 1.2.2 JsonSchema# for RangeInclusiverust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/RangeInclusive#<T>) => Rangerust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/Range#<T>); |
| 125 | |
| 126 | forward_implrust-analyzer cargo schemars 1.2.2 json_schema_impls/forward_impl!!((<T: ?Sizedrust-analyzer cargo core https://github.com/rust-lang/rust/library/core marker/Sized#> JsonSchemarust-analyzer cargo schemars 1.2.2 JsonSchema# for corerust-analyzer cargo core https://github.com/rust-lang/rust/library/core crate/::markerrust-analyzer cargo core https://github.com/rust-lang/rust/library/core marker/::PhantomDatarust-analyzer cargo core https://github.com/rust-lang/rust/library/core marker/PhantomData#<T>) => ()); |
| 127 | |
| 128 | forward_implrust-analyzer cargo schemars 1.2.2 json_schema_impls/forward_impl!!((<'a> JsonSchemarust-analyzer cargo schemars 1.2.2 JsonSchema# for corerust-analyzer cargo core https://github.com/rust-lang/rust/library/core crate/::fmtrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/::Argumentsrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/Arguments#<'a>) => Stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/String#); |