| 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 serde_jsonrust-analyzer cargo serde_json 1.0.151 crate/::jsonrust-analyzer cargo serde_json 1.0.151 macros/json!; |
| 6 | use stdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std crate/::ffirust-analyzer cargo std https://github.com/rust-lang/rust/library/std ffi/::{CStrrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ffi/c_str/CStr#, CStringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc ffi/c_str/CString#, OsStrrust-analyzer cargo std https://github.com/rust-lang/rust/library/std ffi/os_str/OsStr#, OsStringrust-analyzer cargo std https://github.com/rust-lang/rust/library/std ffi/os_str/OsString#}; |
| 7 | |
| 8 | impl JsonSchemarust-analyzer cargo schemars 1.2.2 JsonSchema# for OsStringrust-analyzer cargo std https://github.com/rust-lang/rust/library/std ffi/os_str/OsString# { |
| 9 | fn schema_namerust-analyzer cargo schemars 1.2.2 json_schema_impls/ffi/impl#[OsString][JsonSchema]schema_name().() -> Cowrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc borrow/Cow#<'static, str> { |
| 10 | "OsString".intorust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/impl#[T][`Into<U>`]into().() |
| 11 | } |
| 12 | |
| 13 | fn schema_idrust-analyzer cargo schemars 1.2.2 json_schema_impls/ffi/impl#[OsString][JsonSchema]schema_id().() -> Cowrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc borrow/Cow#<'static, str> { |
| 14 | "std::ffi::OsString".intorust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/impl#[T][`Into<U>`]into().() |
| 15 | } |
| 16 | |
| 17 | fn json_schemarust-analyzer cargo schemars 1.2.2 json_schema_impls/ffi/impl#[OsString][JsonSchema]json_schema().(generator: &mut SchemaGeneratorrust-analyzer cargo schemars 1.2.2 generate/SchemaGenerator#) -> Schemarust-analyzer cargo schemars 1.2.2 schema/Schema# { |
| 18 | json_schemarust-analyzer cargo schemars 1.2.2 macros/json_schema!!({ |
| 19 | "oneOf": [ |
| 20 | { |
| 21 | "type": "object", |
| 22 | "properties": { |
| 23 | "Unix": <Vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/Vec#<u8>>::json_schemarust-analyzer cargo schemars 1.2.2 json_schema_impls/sequences/impl#[`Vec<T>`][JsonSchema]json_schema().(generator) |
| 24 | }, |
| 25 | "required": ["Unix"] |
| 26 | }, |
| 27 | { |
| 28 | "type": "object", |
| 29 | "properties": { |
| 30 | "Windows": <Vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/Vec#<u16>>::json_schemarust-analyzer cargo schemars 1.2.2 json_schema_impls/sequences/impl#[`Vec<T>`][JsonSchema]json_schema().(generator) |
| 31 | }, |
| 32 | "required": ["Windows"] |
| 33 | }, |
| 34 | ] |
| 35 | }) |
| 36 | } |
| 37 | } |
| 38 | |
| 39 | forward_implrust-analyzer cargo schemars 1.2.2 json_schema_impls/forward_impl!!(OsStrrust-analyzer cargo std https://github.com/rust-lang/rust/library/std ffi/os_str/OsStr# => OsStringrust-analyzer cargo std https://github.com/rust-lang/rust/library/std ffi/os_str/OsString#); |
| 40 | |
| 41 | impl JsonSchemarust-analyzer cargo schemars 1.2.2 JsonSchema# for CStringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc ffi/c_str/CString# { |
| 42 | fn schema_namerust-analyzer cargo schemars 1.2.2 json_schema_impls/ffi/impl#[CString][JsonSchema]schema_name().() -> Cowrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc borrow/Cow#<'static, str> { |
| 43 | "CString".intorust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/impl#[T][`Into<U>`]into().() |
| 44 | } |
| 45 | |
| 46 | fn schema_idrust-analyzer cargo schemars 1.2.2 json_schema_impls/ffi/impl#[CString][JsonSchema]schema_id().() -> Cowrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc borrow/Cow#<'static, str> { |
| 47 | "std::ffi::CString".intorust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/impl#[T][`Into<U>`]into().() |
| 48 | } |
| 49 | |
| 50 | fn json_schemarust-analyzer cargo schemars 1.2.2 json_schema_impls/ffi/impl#[CString][JsonSchema]json_schema().(generator: &mut SchemaGeneratorrust-analyzer cargo schemars 1.2.2 generate/SchemaGenerator#) -> Schemarust-analyzer cargo schemars 1.2.2 schema/Schema# { |
| 51 | let ty = if generator.contractrust-analyzer cargo schemars 1.2.2 generate/impl#[SchemaGenerator]contract().().is_deserializerust-analyzer cargo schemars 1.2.2 generate/impl#[Contract]is_deserialize().() { |
| 52 | jsonrust-analyzer cargo serde_json 1.0.151 macros/json!!(["array", "string"]) |
| 53 | } else { |
| 54 | jsonrust-analyzer cargo serde_json 1.0.151 macros/json!!("array") |
| 55 | }; |
| 56 | |
| 57 | json_schemarust-analyzer cargo schemars 1.2.2 macros/json_schema!!({ |
| 58 | "type": ty, |
| 59 | "items": { |
| 60 | "type": "integer", |
| 61 | "minimum": 1, |
| 62 | "maximum": 255 |
| 63 | }, |
| 64 | }) |
| 65 | } |
| 66 | } |
| 67 | |
| 68 | forward_implrust-analyzer cargo schemars 1.2.2 json_schema_impls/forward_impl!!(CStrrust-analyzer cargo core https://github.com/rust-lang/rust/library/core ffi/c_str/CStr# => CStringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc ffi/c_str/CString#); |