Debian Codegraph @

tests/integration/remote_derive.rs

raw symbols SCIP
1 use craterust-analyzer cargo schemars 1.2.2 crate/::preluderust-analyzer cargo schemars 1.2.2 prelude/::*;
2
3 mod externalrust-analyzer cargo schemars 1.2.2 remote_derive/external/ {
4 #[deriverust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/derive:(Defaultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core default/Default:)]
5 pub struct Durationrust-analyzer cargo schemars 1.2.2 remote_derive/external/Duration# {
6 pub secsrust-analyzer cargo schemars 1.2.2 remote_derive/external/Duration#secs.: i64,
7 pub nanosrust-analyzer cargo schemars 1.2.2 remote_derive/external/Duration#nanos.: i32,
8 }
9
10 #[allow(dead_code)]
11 pub enum Orrust-analyzer cargo schemars 1.2.2 remote_derive/external/Or#<A, B> {
12 Arust-analyzer cargo schemars 1.2.2 remote_derive/external/Or#A#(A),
13 Brust-analyzer cargo schemars 1.2.2 remote_derive/external/Or#B#(B),
14 }
15
16 pub struct Strrust-analyzer cargo schemars 1.2.2 remote_derive/external/Str#<'a>(pub &'a str);
17 }
18
19 #[deriverust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/derive:(JsonSchemarust-analyzer cargo schemars_derive 1.2.2 JsonSchema:, Deserializerust-analyzer cargo serde_derive 1.0.229 Deserialize:, Serializerust-analyzer cargo serde_derive 1.0.229 Serialize:)]
20 #[serde(remote = "external::Duration")]
21 struct DurationDefrust-analyzer cargo schemars 1.2.2 remote_derive/DurationDef# {
22 secsrust-analyzer cargo schemars 1.2.2 remote_derive/DurationDef#secs.: i64,
23 nanosrust-analyzer cargo schemars 1.2.2 remote_derive/DurationDef#nanos.: i32,
24 }
25
26 #[deriverust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/derive:(JsonSchemarust-analyzer cargo schemars_derive 1.2.2 JsonSchema:, Deserializerust-analyzer cargo serde_derive 1.0.229 Deserialize:, Serializerust-analyzer cargo serde_derive 1.0.229 Serialize:, Defaultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core default/Default:)]
27 struct Processrust-analyzer cargo schemars 1.2.2 remote_derive/Process# {
28 #[serderust-analyzer cargo schemars_derive 1.2.2 serde:(with = "DurationDef")]
29 wall_timerust-analyzer cargo schemars 1.2.2 remote_derive/Process#wall_time.: externalrust-analyzer cargo schemars 1.2.2 remote_derive/external/::Durationrust-analyzer cargo schemars 1.2.2 remote_derive/external/Duration#,
30 }
31
32 #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:]
33 fn simplerust-analyzer cargo schemars 1.2.2 remote_derive/simple().() {
34 testrust-analyzer cargo schemars 1.2.2 test!!(Processrust-analyzer cargo schemars 1.2.2 remote_derive/Process#)
35 .assert_snapshotrust-analyzer cargo schemars 1.2.2 test_helper/impl#[`TestHelper<T>`]assert_snapshot().()
36 .assert_allows_ser_roundtrip_defaultrust-analyzer cargo schemars 1.2.2 test_helper/impl#[`TestHelper<T>`]assert_allows_ser_roundtrip_default().()
37 .assert_matches_de_roundtriprust-analyzer cargo schemars 1.2.2 test_helper/impl#[`TestHelper<T>`]assert_matches_de_roundtrip().(arbitrary_valuesrust-analyzer cargo schemars 1.2.2 test_helper/arbitrary_values().());
38 }
39
40 #[deriverust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/derive:(JsonSchemarust-analyzer cargo schemars_derive 1.2.2 JsonSchema:, Deserializerust-analyzer cargo serde_derive 1.0.229 Deserialize:, Serializerust-analyzer cargo serde_derive 1.0.229 Serialize:)]
41 #[serde(untagged, remote = "external::Or")]
42 #[schemars(rename = "{A}_or_{B}")]
43 enum OrDefrust-analyzer cargo schemars 1.2.2 remote_derive/OrDef#<A, B> {
44 Arust-analyzer cargo schemars 1.2.2 remote_derive/OrDef#A#(A),
45 Brust-analyzer cargo schemars 1.2.2 remote_derive/OrDef#B#(B),
46 }
47
48 #[deriverust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/derive:(JsonSchemarust-analyzer cargo schemars_derive 1.2.2 JsonSchema:, Deserializerust-analyzer cargo serde_derive 1.0.229 Deserialize:, Serializerust-analyzer cargo serde_derive 1.0.229 Serialize:)]
49 #[serde(bound = "T: serde::de::DeserializeOwned + Serialize")]
50 struct TypeParamrust-analyzer cargo schemars 1.2.2 remote_derive/TypeParam#<T> {
51 #[serderust-analyzer cargo schemars_derive 1.2.2 serde:(with = "OrDef::<u8, bool>")]
52 byte_or_boolrust-analyzer cargo schemars 1.2.2 remote_derive/TypeParam#byte_or_bool.: externalrust-analyzer cargo schemars 1.2.2 remote_derive/external/::Orrust-analyzer cargo schemars 1.2.2 remote_derive/external/Or#<u8, bool>,
53 #[serderust-analyzer cargo schemars_derive 1.2.2 serde:(with = "OrDef::<(), T>")]
54 unit_or_trust-analyzer cargo schemars 1.2.2 remote_derive/TypeParam#unit_or_t.: externalrust-analyzer cargo schemars 1.2.2 remote_derive/external/::Orrust-analyzer cargo schemars 1.2.2 remote_derive/external/Or#<(), T>,
55 }
56
57 #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:]
58 fn type_paramrust-analyzer cargo schemars 1.2.2 remote_derive/type_param().() {
59 testrust-analyzer cargo schemars 1.2.2 test!!(TypeParamrust-analyzer cargo schemars 1.2.2 remote_derive/TypeParam#<Stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/String#>)
60 .assert_snapshotrust-analyzer cargo schemars 1.2.2 test_helper/impl#[`TestHelper<T>`]assert_snapshot().()
61 .assert_allows_ser_roundtriprust-analyzer cargo schemars 1.2.2 test_helper/impl#[`TestHelper<T>`]assert_allows_ser_roundtrip().([
62 TypeParamrust-analyzer cargo schemars 1.2.2 remote_derive/TypeParam# {
63 byte_or_boolrust-analyzer cargo schemars 1.2.2 remote_derive/TypeParam#byte_or_bool.: externalrust-analyzer cargo schemars 1.2.2 remote_derive/external/::Orrust-analyzer cargo schemars 1.2.2 remote_derive/external/Or#::Arust-analyzer cargo schemars 1.2.2 remote_derive/external/Or#A#(123),
64 unit_or_trust-analyzer cargo schemars 1.2.2 remote_derive/TypeParam#unit_or_t.: externalrust-analyzer cargo schemars 1.2.2 remote_derive/external/::Orrust-analyzer cargo schemars 1.2.2 remote_derive/external/Or#::Arust-analyzer cargo schemars 1.2.2 remote_derive/external/Or#A#(()),
65 },
66 TypeParamrust-analyzer cargo schemars 1.2.2 remote_derive/TypeParam# {
67 byte_or_boolrust-analyzer cargo schemars 1.2.2 remote_derive/TypeParam#byte_or_bool.: externalrust-analyzer cargo schemars 1.2.2 remote_derive/external/::Orrust-analyzer cargo schemars 1.2.2 remote_derive/external/Or#::Brust-analyzer cargo schemars 1.2.2 remote_derive/external/Or#B#(true),
68 unit_or_trust-analyzer cargo schemars 1.2.2 remote_derive/TypeParam#unit_or_t.: externalrust-analyzer cargo schemars 1.2.2 remote_derive/external/::Orrust-analyzer cargo schemars 1.2.2 remote_derive/external/Or#::Brust-analyzer cargo schemars 1.2.2 remote_derive/external/Or#B#("test".to_ownedrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc str/impl#[str][ToOwned]to_owned().()),
69 },
70 ])
71 .assert_matches_de_roundtriprust-analyzer cargo schemars 1.2.2 test_helper/impl#[`TestHelper<T>`]assert_matches_de_roundtrip().(arbitrary_valuesrust-analyzer cargo schemars 1.2.2 test_helper/arbitrary_values().());
72 }
73
74 #[allow(dead_code)]
75 #[deriverust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/derive:(JsonSchemarust-analyzer cargo schemars_derive 1.2.2 JsonSchema:, Deserializerust-analyzer cargo serde_derive 1.0.229 Deserialize:, Serializerust-analyzer cargo serde_derive 1.0.229 Serialize:)]
76 #[serde(remote = "external::Str")]
77 struct StrDefrust-analyzer cargo schemars 1.2.2 remote_derive/StrDef#<'a>(&'a str);
78
79 #[deriverust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/derive:(JsonSchemarust-analyzer cargo schemars_derive 1.2.2 JsonSchema:, Deserializerust-analyzer cargo serde_derive 1.0.229 Deserialize:, Serializerust-analyzer cargo serde_derive 1.0.229 Serialize:)]
80 struct LifetimeParamrust-analyzer cargo schemars 1.2.2 remote_derive/LifetimeParam#<'a> {
81 #[serderust-analyzer cargo schemars_derive 1.2.2 serde:(borrow, with = "StrDef")]
82 srust-analyzer cargo schemars 1.2.2 remote_derive/LifetimeParam#s.: externalrust-analyzer cargo schemars 1.2.2 remote_derive/external/::Strrust-analyzer cargo schemars 1.2.2 remote_derive/external/Str#<'a>,
83 }
84
85 #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:]
86 fn lifetime_paramrust-analyzer cargo schemars 1.2.2 remote_derive/lifetime_param().() {
87 let s = externalrust-analyzer cargo schemars 1.2.2 remote_derive/external/::Strrust-analyzer cargo schemars 1.2.2 remote_derive/external/Str#("test");
88
89 testrust-analyzer cargo schemars 1.2.2 test!!(LifetimeParamrust-analyzer cargo schemars 1.2.2 remote_derive/LifetimeParam#)
90 .assert_snapshotrust-analyzer cargo schemars 1.2.2 test_helper/impl#[`TestHelper<T>`]assert_snapshot().()
91 .assert_allows_ser_onlyrust-analyzer cargo schemars 1.2.2 test_helper/impl#[`TestHelper<T>`]assert_allows_ser_only().([LifetimeParamrust-analyzer cargo schemars 1.2.2 remote_derive/LifetimeParam# { srust-analyzer cargo schemars 1.2.2 remote_derive/LifetimeParam#s. }]);
92 }