Debian Codegraph @

src/json_schema_impls/sequences.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
6 macro_rules! seq_implrust-analyzer cargo schemars 1.2.2 json_schema_impls/sequences/seq_impl! {
7 ($($desc:tt)+) => {
8 impl $($desc)+
9 where
10 T: JsonSchema,
11 {
12 inline_schema!();
13
14 fn schema_name() -> Cow<'static, str> {
15 format!("Array_of_{}", T::schema_name()).into()
16 }
17
18 fn schema_id() -> Cow<'static, str> {
19 format!("[{}]", T::schema_id()).into()
20 }
21
22 fn json_schema(generator: &mut SchemaGenerator) -> Schema {
23 json_schema!({
24 "type": "array",
25 "items": generator.subschema_for::<T>(),
26 })
27 }
28 }
29 };
30 }
31
32 macro_rules! set_implrust-analyzer cargo schemars 1.2.2 json_schema_impls/sequences/set_impl! {
33 ($($desc:tt)+) => {
34 impl $($desc)+
35 where
36 T: JsonSchema,
37 {
38 inline_schema!();
39
40 fn schema_name() -> Cow<'static, str> {
41 format!("Set_of_{}", T::schema_name()).into()
42 }
43
44 fn schema_id() -> Cow<'static, str> {
45 format!("Set<{}>", T::schema_id()).into()
46 }
47
48 fn json_schema(generator: &mut SchemaGenerator) -> Schema {
49 json_schema!({
50 "type": "array",
51 "uniqueItems": true,
52 "items": generator.subschema_for::<T>(),
53 })
54 }
55 }
56 };
57 }
58
59 seq_implrust-analyzer cargo schemars 1.2.2 json_schema_impls/sequences/seq_impl!!(<T> JsonSchemarust-analyzer cargo schemars 1.2.2 JsonSchema# for allocrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc crate/::collectionsrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc collections/::BinaryHeaprust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc collections/binary_heap/BinaryHeap#<T>);
60 seq_implrust-analyzer cargo schemars 1.2.2 json_schema_impls/sequences/seq_impl!!(<T> JsonSchemarust-analyzer cargo schemars 1.2.2 JsonSchema# for allocrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc crate/::collectionsrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc collections/::LinkedListrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc collections/linked_list/LinkedList#<T>);
61 seq_implrust-analyzer cargo schemars 1.2.2 json_schema_impls/sequences/seq_impl!!(<T> JsonSchemarust-analyzer cargo schemars 1.2.2 JsonSchema# for [T]);
62 seq_implrust-analyzer cargo schemars 1.2.2 json_schema_impls/sequences/seq_impl!!(<T> JsonSchemarust-analyzer cargo schemars 1.2.2 JsonSchema# for allocrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc crate/::vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/::Vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/Vec#<T>);
63 seq_implrust-analyzer cargo schemars 1.2.2 json_schema_impls/sequences/seq_impl!!(<T> JsonSchemarust-analyzer cargo schemars 1.2.2 JsonSchema# for allocrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc crate/::collectionsrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc collections/::VecDequerust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc collections/vec_deque/VecDeque#<T>);
64
65 set_implrust-analyzer cargo schemars 1.2.2 json_schema_impls/sequences/set_impl!!(<T> JsonSchemarust-analyzer cargo schemars 1.2.2 JsonSchema# for allocrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc crate/::collectionsrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc collections/::BTreeSetrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc collections/btree/set/BTreeSet#<T>);
66
67 #[cfg(feature = "std")]
68 set_implrust-analyzer cargo schemars 1.2.2 json_schema_impls/sequences/set_impl!!(<T, H> JsonSchemarust-analyzer cargo schemars 1.2.2 JsonSchema# for stdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std crate/::collectionsrust-analyzer cargo std https://github.com/rust-lang/rust/library/std collections/::HashSetrust-analyzer cargo std https://github.com/rust-lang/rust/library/std collections/hash/set/HashSet#<T, H>);