Debian Codegraph @

tests/integration/garde.rs

raw symbols SCIP
1 #![allow(clippy::incompatible_msrv)]
2 use craterust-analyzer cargo schemars 1.2.2 crate/::preluderust-analyzer cargo schemars 1.2.2 prelude/::*;
3 use garderust-analyzer cargo garde 0.23.0 crate/::Validaterust-analyzer cargo garde 0.23.0 validate/Validate#;
4
5 const ONErust-analyzer cargo schemars 1.2.2 garde/ONE.: usize = 1;
6 const HUNDREDrust-analyzer cargo schemars 1.2.2 garde/HUNDRED.: usize = 10;
7
8 #[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:, Validaterust-analyzer cargo garde_derive 0.23.0 Validate:)]
9 pub struct GardeAttrStructrust-analyzer cargo schemars 1.2.2 garde/GardeAttrStruct# {
10 #[garderust-analyzer cargo schemars_derive 1.2.2 garde:(range(min = 1.0, max = 100.0))]
11 min_maxrust-analyzer cargo schemars 1.2.2 garde/GardeAttrStruct#min_max.: f32,
12 #[garderust-analyzer cargo schemars_derive 1.2.2 garde:(range(min = ONErust-analyzer cargo schemars 1.2.2 garde/ONE. as f32, max = HUNDREDrust-analyzer cargo schemars 1.2.2 garde/HUNDRED. as f32))]
13 min_max2rust-analyzer cargo schemars 1.2.2 garde/GardeAttrStruct#min_max2.: f32,
14 #[garderust-analyzer cargo schemars_derive 1.2.2 garde:(pattern(r"^[Hh]ello"))]
15 regex_strrust-analyzer cargo schemars 1.2.2 garde/GardeAttrStruct#regex_str.: Stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/String#,
16 #[garderust-analyzer cargo schemars_derive 1.2.2 garde:(contains(concatrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/concat!!("sub","string...")))]
17 contains_strrust-analyzer cargo schemars 1.2.2 garde/GardeAttrStruct#contains_str.: Stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/String#,
18 #[garderust-analyzer cargo schemars_derive 1.2.2 garde:(email)]
19 email_addressrust-analyzer cargo schemars 1.2.2 garde/GardeAttrStruct#email_address.: Stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/String#,
20 #[garderust-analyzer cargo schemars_derive 1.2.2 garde:(url)]
21 homepagerust-analyzer cargo schemars 1.2.2 garde/GardeAttrStruct#homepage.: Stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/String#,
22 #[garderust-analyzer cargo schemars_derive 1.2.2 garde:(length(min = ONErust-analyzer cargo schemars 1.2.2 garde/ONE., max = HUNDREDrust-analyzer cargo schemars 1.2.2 garde/HUNDRED.))]
23 non_empty_strrust-analyzer cargo schemars 1.2.2 garde/GardeAttrStruct#non_empty_str.: Stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/String#,
24 #[garderust-analyzer cargo schemars_derive 1.2.2 garde:(length(equal = 2), inner(length(min = 1)))]
25 pairrust-analyzer cargo schemars 1.2.2 garde/GardeAttrStruct#pair.: Vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/Vec#<Stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/String#>,
26 #[garderust-analyzer cargo schemars_derive 1.2.2 garde:(required)]
27 required_optionrust-analyzer cargo schemars 1.2.2 garde/GardeAttrStruct#required_option.: Optionrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#<bool>,
28 #[garderust-analyzer cargo schemars_derive 1.2.2 garde:(required, dive)]
29 #[serderust-analyzer cargo schemars_derive 1.2.2 serde:(flatten)]
30 required_flattenedrust-analyzer cargo schemars 1.2.2 garde/GardeAttrStruct#required_flattened.: Optionrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#<GardeAttrInnerrust-analyzer cargo schemars 1.2.2 garde/GardeAttrInner#>,
31 }
32
33 #[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:, Validaterust-analyzer cargo garde_derive 0.23.0 Validate:)]
34 pub struct GardeAttrInnerrust-analyzer cargo schemars 1.2.2 garde/GardeAttrInner# {
35 #[garderust-analyzer cargo schemars_derive 1.2.2 garde:(range(min = -rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i32][Neg]neg().100, max = 100))]
36 xrust-analyzer cargo schemars 1.2.2 garde/GardeAttrInner#x.: i32,
37 }
38
39 impl Defaultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core default/Default# for GardeAttrStructrust-analyzer cargo schemars 1.2.2 garde/GardeAttrStruct# {
40 fn defaultrust-analyzer cargo schemars 1.2.2 garde/impl#[GardeAttrStruct][Default]default().() -> Selfrust-analyzer cargo schemars 1.2.2 garde/impl#[GardeAttrStruct][Default] {
41 Selfrust-analyzer cargo schemars 1.2.2 garde/impl#[GardeAttrStruct][Default] {
42 min_maxrust-analyzer cargo schemars 1.2.2 garde/GardeAttrStruct#min_max.: 1.0,
43 min_max2rust-analyzer cargo schemars 1.2.2 garde/GardeAttrStruct#min_max2.: 1.0,
44 regex_strrust-analyzer cargo schemars 1.2.2 garde/GardeAttrStruct#regex_str.: "Hello world".to_ownedrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc str/impl#[str][ToOwned]to_owned().(),
45 contains_strrust-analyzer cargo schemars 1.2.2 garde/GardeAttrStruct#contains_str.: "Contains substring...".to_ownedrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc str/impl#[str][ToOwned]to_owned().(),
46 email_addressrust-analyzer cargo schemars 1.2.2 garde/GardeAttrStruct#email_address.: "[email protected]".to_ownedrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc str/impl#[str][ToOwned]to_owned().(),
47 homepagerust-analyzer cargo schemars 1.2.2 garde/GardeAttrStruct#homepage.: "http://test.test".to_ownedrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc str/impl#[str][ToOwned]to_owned().(),
48 non_empty_strrust-analyzer cargo schemars 1.2.2 garde/GardeAttrStruct#non_empty_str.: "test".to_ownedrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc str/impl#[str][ToOwned]to_owned().(),
49 pairrust-analyzer cargo schemars 1.2.2 garde/GardeAttrStruct#pair.: vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc macros/vec!!["a".to_ownedrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc str/impl#[str][ToOwned]to_owned().(), "b".to_ownedrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc str/impl#[str][ToOwned]to_owned().()],
50 required_optionrust-analyzer cargo schemars 1.2.2 garde/GardeAttrStruct#required_option.: Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(true),
51 required_flattenedrust-analyzer cargo schemars 1.2.2 garde/GardeAttrStruct#required_flattened.: Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(GardeAttrInnerrust-analyzer cargo schemars 1.2.2 garde/GardeAttrInner# { xrust-analyzer cargo schemars 1.2.2 garde/GardeAttrInner#x.: 0 }),
52 }
53 }
54 }
55
56 impl GardeAttrStructrust-analyzer cargo schemars 1.2.2 garde/GardeAttrStruct# {
57 pub fn invalid_valuesrust-analyzer cargo schemars 1.2.2 garde/impl#[GardeAttrStruct]invalid_values().() -> impl IntoIteratorrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/collect/IntoIterator#<Itemrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/collect/IntoIterator#Item# = Selfrust-analyzer cargo schemars 1.2.2 garde/impl#[GardeAttrStruct]> {
58 static MUTATORSrust-analyzer cargo schemars 1.2.2 garde/MUTATORS.: &[fn(&mut GardeAttrStructrust-analyzer cargo schemars 1.2.2 garde/GardeAttrStruct#)] = &[
59 |v| v.min_maxrust-analyzer cargo schemars 1.2.2 garde/GardeAttrStruct#min_max. = 0.9,
60 |v| v.min_maxrust-analyzer cargo schemars 1.2.2 garde/GardeAttrStruct#min_max. = 100.1,
61 |v| v.min_max2rust-analyzer cargo schemars 1.2.2 garde/GardeAttrStruct#min_max2. = 0.9,
62 |v| v.min_max2rust-analyzer cargo schemars 1.2.2 garde/GardeAttrStruct#min_max2. = 100.1,
63 |v| v.regex_strrust-analyzer cargo schemars 1.2.2 garde/GardeAttrStruct#regex_str. = "fail".to_ownedrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc str/impl#[str][ToOwned]to_owned().(),
64 |v| v.contains_strrust-analyzer cargo schemars 1.2.2 garde/GardeAttrStruct#contains_str. = "fail".to_ownedrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc str/impl#[str][ToOwned]to_owned().(),
65 |v| v.email_addressrust-analyzer cargo schemars 1.2.2 garde/GardeAttrStruct#email_address. = "fail".to_ownedrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc str/impl#[str][ToOwned]to_owned().(),
66 |v| v.homepagerust-analyzer cargo schemars 1.2.2 garde/GardeAttrStruct#homepage. = "fail".to_ownedrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc str/impl#[str][ToOwned]to_owned().(),
67 |v| v.non_empty_strrust-analyzer cargo schemars 1.2.2 garde/GardeAttrStruct#non_empty_str. = Stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/String#::newrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[String]new().(),
68 |v| v.pairrust-analyzer cargo schemars 1.2.2 garde/GardeAttrStruct#pair. = Vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/Vec#::newrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T>`]new().(),
69 |v| v.pairrust-analyzer cargo schemars 1.2.2 garde/GardeAttrStruct#pair. = vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc macros/vec!!["a".to_ownedrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc str/impl#[str][ToOwned]to_owned().(), "b".to_ownedrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc str/impl#[str][ToOwned]to_owned().(), "c".to_ownedrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc str/impl#[str][ToOwned]to_owned().()],
70 |v| v.pairrust-analyzer cargo schemars 1.2.2 garde/GardeAttrStruct#pair. = vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc macros/vec!!["".to_ownedrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc str/impl#[str][ToOwned]to_owned().(), "b".to_ownedrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc str/impl#[str][ToOwned]to_owned().()],
71 |v| v.required_optionrust-analyzer cargo schemars 1.2.2 garde/GardeAttrStruct#required_option. = Nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#None#,
72 |v| v.required_flattenedrust-analyzer cargo schemars 1.2.2 garde/GardeAttrStruct#required_flattened. = Nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#None#,
73 |v| v.required_flattenedrust-analyzer cargo schemars 1.2.2 garde/GardeAttrStruct#required_flattened. = Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(GardeAttrInnerrust-analyzer cargo schemars 1.2.2 garde/GardeAttrInner# { xrust-analyzer cargo schemars 1.2.2 garde/GardeAttrInner#x.: -rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i32][Neg]neg().101 }),
74 |v| v.required_flattenedrust-analyzer cargo schemars 1.2.2 garde/GardeAttrStruct#required_flattened. = Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(GardeAttrInnerrust-analyzer cargo schemars 1.2.2 garde/GardeAttrInner# { xrust-analyzer cargo schemars 1.2.2 garde/GardeAttrInner#x.: 101 }),
75 ];
76 MUTATORSrust-analyzer cargo schemars 1.2.2 garde/MUTATORS..iterrust-analyzer cargo core https://github.com/rust-lang/rust/library/core slice/impl#[`[T]`]iter().().maprust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#map().(|f| {
77 let mut result = GardeAttrStructrust-analyzer cargo schemars 1.2.2 garde/GardeAttrStruct#::defaultrust-analyzer cargo schemars 1.2.2 garde/impl#[GardeAttrStruct][Default]default().();
78 f(&mut result);
79 result
80 })
81 }
82 }
83
84 #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:]
85 fn garde_attrsrust-analyzer cargo schemars 1.2.2 garde/garde_attrs().() {
86 testrust-analyzer cargo schemars 1.2.2 test!!(GardeAttrStructrust-analyzer cargo schemars 1.2.2 garde/GardeAttrStruct#)
87 .with_validatorrust-analyzer cargo schemars 1.2.2 test_helper/impl#[`TestHelper<T>`]with_validator().(|v| v.validaterust-analyzer cargo garde 0.23.0 validate/Validate#validate().().is_okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]is_ok().())
88 .assert_snapshotrust-analyzer cargo schemars 1.2.2 test_helper/impl#[`TestHelper<T>`]assert_snapshot().()
89 .assert_allows_ser_roundtrip_defaultrust-analyzer cargo schemars 1.2.2 test_helper/impl#[`TestHelper<T>`]assert_allows_ser_roundtrip_default().()
90 .assert_rejects_invalidrust-analyzer cargo schemars 1.2.2 test_helper/impl#[`TestHelper<T>`]assert_rejects_invalid().(GardeAttrStructrust-analyzer cargo schemars 1.2.2 garde/GardeAttrStruct#::invalid_valuesrust-analyzer cargo schemars 1.2.2 garde/impl#[GardeAttrStruct]invalid_values().())
91 .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().());
92 }
93
94 #[allow(dead_code)]
95 #[deriverust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/derive:(JsonSchemarust-analyzer cargo schemars_derive 1.2.2 JsonSchema:)]
96 #[schemars(rename = "GardeAttrStruct")]
97 pub struct SchemarsAttrStructrust-analyzer cargo schemars 1.2.2 garde/SchemarsAttrStruct# {
98 #[schemarsrust-analyzer cargo schemars_derive 1.2.2 schemars:(range(min = 1.0, max = 100.0))]
99 min_maxrust-analyzer cargo schemars 1.2.2 garde/SchemarsAttrStruct#min_max.: f32,
100 #[schemarsrust-analyzer cargo schemars_derive 1.2.2 schemars:(range(min = ONErust-analyzer cargo schemars 1.2.2 garde/ONE. as f32, max = HUNDREDrust-analyzer cargo schemars 1.2.2 garde/HUNDRED. as f32))]
101 min_max2rust-analyzer cargo schemars 1.2.2 garde/SchemarsAttrStruct#min_max2.: f32,
102 #[schemarsrust-analyzer cargo schemars_derive 1.2.2 schemars:(pattern(r"^[Hh]ello"))]
103 regex_strrust-analyzer cargo schemars 1.2.2 garde/SchemarsAttrStruct#regex_str.: Stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/String#,
104 #[schemarsrust-analyzer cargo schemars_derive 1.2.2 schemars:(contains(concatrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/concat!!("sub","string...")))]
105 contains_strrust-analyzer cargo schemars 1.2.2 garde/SchemarsAttrStruct#contains_str.: Stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/String#,
106 #[schemarsrust-analyzer cargo schemars_derive 1.2.2 schemars:(email)]
107 email_addressrust-analyzer cargo schemars 1.2.2 garde/SchemarsAttrStruct#email_address.: Stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/String#,
108 #[schemarsrust-analyzer cargo schemars_derive 1.2.2 schemars:(url)]
109 homepagerust-analyzer cargo schemars 1.2.2 garde/SchemarsAttrStruct#homepage.: Stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/String#,
110 #[schemarsrust-analyzer cargo schemars_derive 1.2.2 schemars:(length(min = ONErust-analyzer cargo schemars 1.2.2 garde/ONE., max = HUNDREDrust-analyzer cargo schemars 1.2.2 garde/HUNDRED.))]
111 non_empty_strrust-analyzer cargo schemars 1.2.2 garde/SchemarsAttrStruct#non_empty_str.: Stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/String#,
112 #[schemarsrust-analyzer cargo schemars_derive 1.2.2 schemars:(length(equal = 2), inner(length(min = 1)))]
113 pairrust-analyzer cargo schemars 1.2.2 garde/SchemarsAttrStruct#pair.: Vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/Vec#<Stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/String#>,
114 #[schemarsrust-analyzer cargo schemars_derive 1.2.2 schemars:(required)]
115 required_optionrust-analyzer cargo schemars 1.2.2 garde/SchemarsAttrStruct#required_option.: Optionrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#<bool>,
116 #[schemarsrust-analyzer cargo schemars_derive 1.2.2 schemars:(required)]
117 #[serderust-analyzer cargo schemars_derive 1.2.2 serde:(flatten)]
118 required_flattenedrust-analyzer cargo schemars 1.2.2 garde/SchemarsAttrStruct#required_flattened.: Optionrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#<SchemarsAttrInnerrust-analyzer cargo schemars 1.2.2 garde/SchemarsAttrInner#>,
119 }
120
121 #[allow(dead_code)]
122 #[deriverust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/derive:(JsonSchemarust-analyzer cargo schemars_derive 1.2.2 JsonSchema:)]
123 pub struct SchemarsAttrInnerrust-analyzer cargo schemars 1.2.2 garde/SchemarsAttrInner# {
124 #[schemarsrust-analyzer cargo schemars_derive 1.2.2 schemars:(range(min = -rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[i32][Neg]neg().100, max = 100))]
125 xrust-analyzer cargo schemars 1.2.2 garde/SchemarsAttrInner#x.: i32,
126 }
127
128 #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:]
129 fn schemars_attrsrust-analyzer cargo schemars 1.2.2 garde/schemars_attrs().() {
130 testrust-analyzer cargo schemars 1.2.2 test!!(SchemarsAttrStructrust-analyzer cargo schemars 1.2.2 garde/SchemarsAttrStruct#).assert_identicalrust-analyzer cargo schemars 1.2.2 test_helper/impl#[`TestHelper<T>`]assert_identical().::<GardeAttrStructrust-analyzer cargo schemars 1.2.2 garde/GardeAttrStruct#>();
131 }
132
133 #[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:, Validaterust-analyzer cargo garde_derive 0.23.0 Validate:)]
134 pub struct GardeAttrTuplerust-analyzer cargo schemars 1.2.2 garde/GardeAttrTuple#(
135 #[garderust-analyzer cargo schemars_derive 1.2.2 garde:(range(max = 10))] u8,
136 #[garderust-analyzer cargo schemars_derive 1.2.2 garde:(required)] Optionrust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#<bool>,
137 );
138
139 #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:]
140 fn garde_attrs_tuplerust-analyzer cargo schemars 1.2.2 garde/garde_attrs_tuple().() {
141 testrust-analyzer cargo schemars 1.2.2 test!!(GardeAttrTuplerust-analyzer cargo schemars 1.2.2 garde/GardeAttrTuple#)
142 .with_validatorrust-analyzer cargo schemars 1.2.2 test_helper/impl#[`TestHelper<T>`]with_validator().(|v| v.validaterust-analyzer cargo garde 0.23.0 validate/Validate#validate().().is_okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]is_ok().())
143 .assert_snapshotrust-analyzer cargo schemars 1.2.2 test_helper/impl#[`TestHelper<T>`]assert_snapshot().()
144 .assert_allows_ser_roundtriprust-analyzer cargo schemars 1.2.2 test_helper/impl#[`TestHelper<T>`]assert_allows_ser_roundtrip().([GardeAttrTuplerust-analyzer cargo schemars 1.2.2 garde/GardeAttrTuple#(10, Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(false))])
145 .assert_rejects_invalidrust-analyzer cargo schemars 1.2.2 test_helper/impl#[`TestHelper<T>`]assert_rejects_invalid().([GardeAttrTuplerust-analyzer cargo schemars 1.2.2 garde/GardeAttrTuple#(11, Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(false)), GardeAttrTuplerust-analyzer cargo schemars 1.2.2 garde/GardeAttrTuple#(10, Nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#None#)])
146 .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().());
147 }
148
149 #[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:, Validaterust-analyzer cargo garde_derive 0.23.0 Validate:)]
150 pub struct GardeAttrNewTyperust-analyzer cargo schemars 1.2.2 garde/GardeAttrNewType#(#[garderust-analyzer cargo schemars_derive 1.2.2 garde:(range(max = 10))] u8);
151
152 #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:]
153 fn garde_attrs_newtyperust-analyzer cargo schemars 1.2.2 garde/garde_attrs_newtype().() {
154 testrust-analyzer cargo schemars 1.2.2 test!!(GardeAttrNewTyperust-analyzer cargo schemars 1.2.2 garde/GardeAttrNewType#)
155 .with_validatorrust-analyzer cargo schemars 1.2.2 test_helper/impl#[`TestHelper<T>`]with_validator().(|v| v.validaterust-analyzer cargo garde 0.23.0 validate/Validate#validate().().is_okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]is_ok().())
156 .assert_snapshotrust-analyzer cargo schemars 1.2.2 test_helper/impl#[`TestHelper<T>`]assert_snapshot().()
157 .assert_allows_ser_roundtriprust-analyzer cargo schemars 1.2.2 test_helper/impl#[`TestHelper<T>`]assert_allows_ser_roundtrip().([GardeAttrNewTyperust-analyzer cargo schemars 1.2.2 garde/GardeAttrNewType#(10)])
158 .assert_rejects_invalidrust-analyzer cargo schemars 1.2.2 test_helper/impl#[`TestHelper<T>`]assert_rejects_invalid().([GardeAttrNewTyperust-analyzer cargo schemars 1.2.2 garde/GardeAttrNewType#(11)])
159 .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().());
160 }