Debian Codegraph @

src/json_schema_impls/bytes1.rs

raw symbols SCIP
1 use craterust-analyzer cargo schemars 1.2.2 crate/::_alloc_preluderust-analyzer cargo schemars 1.2.2 _alloc_prelude/::*;
2 use craterust-analyzer cargo schemars 1.2.2 crate/::generaterust-analyzer cargo schemars 1.2.2 generate/::Contractrust-analyzer cargo schemars 1.2.2 generate/Contract#;
3 use craterust-analyzer cargo schemars 1.2.2 crate/::{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/::Valuerust-analyzer cargo serde_json 1.0.151 value/Value#;
6
7 impl JsonSchemarust-analyzer cargo schemars 1.2.2 JsonSchema# for bytes1rust-analyzer cargo bytes 1.12.1 crate/::Bytesrust-analyzer cargo bytes 1.12.1 bytes/Bytes# {
8 fn schema_namerust-analyzer cargo schemars 1.2.2 json_schema_impls/bytes1/impl#[`bytes1::Bytes`][JsonSchema]schema_name().() -> Cowrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc borrow/Cow#<'static, str> {
9 "Bytes".intorust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/impl#[T][`Into<U>`]into().()
10 }
11
12 fn schema_idrust-analyzer cargo schemars 1.2.2 json_schema_impls/bytes1/impl#[`bytes1::Bytes`][JsonSchema]schema_id().() -> Cowrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc borrow/Cow#<'static, str> {
13 "bytes::Bytes".intorust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/impl#[T][`Into<U>`]into().()
14 }
15
16 fn json_schemarust-analyzer cargo schemars 1.2.2 json_schema_impls/bytes1/impl#[`bytes1::Bytes`][JsonSchema]json_schema().(generator: &mut craterust-analyzer cargo schemars 1.2.2 crate/::SchemaGeneratorrust-analyzer cargo schemars 1.2.2 generate/SchemaGenerator#) -> craterust-analyzer cargo schemars 1.2.2 crate/::Schemarust-analyzer cargo schemars 1.2.2 schema/Schema# {
17 let ty = match generator.contractrust-analyzer cargo schemars 1.2.2 generate/impl#[SchemaGenerator]contract().() {
18 Contractrust-analyzer cargo schemars 1.2.2 generate/Contract#::Deserializerust-analyzer cargo schemars 1.2.2 generate/Contract#Deserialize# => Valuerust-analyzer cargo serde_json 1.0.151 value/Value#::Arrayrust-analyzer cargo serde_json 1.0.151 value/Value#Array#(vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc macros/vec!!["array".intorust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/impl#[T][`Into<U>`]into().(), "string".intorust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/impl#[T][`Into<U>`]into().()]),
19 Contractrust-analyzer cargo schemars 1.2.2 generate/Contract#::Serializerust-analyzer cargo schemars 1.2.2 generate/Contract#Serialize# => "array".intorust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/impl#[T][`Into<U>`]into().(),
20 };
21
22 let mut result = Schemarust-analyzer cargo schemars 1.2.2 schema/Schema#::defaultrust-analyzer cargo schemars 1.2.2 schema/impl#[Schema][Default]default().();
23 result.insertrust-analyzer cargo schemars 1.2.2 schema/impl#[Schema]insert().("type".to_ownedrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc str/impl#[str][ToOwned]to_owned().(), ty);
24 result.insertrust-analyzer cargo schemars 1.2.2 schema/impl#[Schema]insert().("items".to_ownedrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc str/impl#[str][ToOwned]to_owned().(), generator.subschema_forrust-analyzer cargo schemars 1.2.2 generate/impl#[SchemaGenerator]subschema_for().::<u8>().intorust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/impl#[T][`Into<U>`]into().());
25 result
26 }
27 }
28
29 forward_implrust-analyzer cargo schemars 1.2.2 json_schema_impls/forward_impl!!(bytes1rust-analyzer cargo bytes 1.12.1 crate/::BytesMutrust-analyzer cargo bytes 1.12.1 bytes_mut/BytesMut# => bytes1rust-analyzer cargo bytes 1.12.1 crate/::Bytesrust-analyzer cargo bytes 1.12.1 bytes/Bytes#);