dry-validation-rust 0.1.0.pre5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (64) hide show
  1. checksums.yaml +7 -0
  2. data/CHANGELOG.md +74 -0
  3. data/LICENSE +21 -0
  4. data/NOTICE.md +28 -0
  5. data/README.md +459 -0
  6. data/docs/ARCHITECTURE.md +256 -0
  7. data/docs/COMPATIBILITY.md +198 -0
  8. data/docs/FEASIBILITY.md +207 -0
  9. data/docs/SUPPORT_MATRIX.md +66 -0
  10. data/docs/VERIFICATION.md +128 -0
  11. data/dry-validation-rust.gemspec +58 -0
  12. data/ext/dry_validation_rust/Cargo.lock +809 -0
  13. data/ext/dry_validation_rust/Cargo.toml +44 -0
  14. data/ext/dry_validation_rust/benches/coercion.rs +77 -0
  15. data/ext/dry_validation_rust/benches/full_schema.rs +189 -0
  16. data/ext/dry_validation_rust/benches/plan_compile.rs +37 -0
  17. data/ext/dry_validation_rust/benches/predicates.rs +105 -0
  18. data/ext/dry_validation_rust/extconf.rb +29 -0
  19. data/ext/dry_validation_rust/src/coercion.rs +515 -0
  20. data/ext/dry_validation_rust/src/engine.rs +416 -0
  21. data/ext/dry_validation_rust/src/error.rs +82 -0
  22. data/ext/dry_validation_rust/src/extract_primitive.rs +23 -0
  23. data/ext/dry_validation_rust/src/generated_predicates.rs +33 -0
  24. data/ext/dry_validation_rust/src/lib.rs +228 -0
  25. data/ext/dry_validation_rust/src/plan.rs +611 -0
  26. data/ext/dry_validation_rust/src/predicates.rs +449 -0
  27. data/ext/dry_validation_rust/src/ruby_bridge.rs +78 -0
  28. data/lib/dry/schema.rb +6 -0
  29. data/lib/dry/validation/rust/block_keyword_parameters.rb +20 -0
  30. data/lib/dry/validation/rust/config.rb +74 -0
  31. data/lib/dry/validation/rust/contract/result.rb +180 -0
  32. data/lib/dry/validation/rust/contract/values.rb +73 -0
  33. data/lib/dry/validation/rust/contract.rb +400 -0
  34. data/lib/dry/validation/rust/errors.rb +14 -0
  35. data/lib/dry/validation/rust/evaluator.rb +295 -0
  36. data/lib/dry/validation/rust/failures.rb +57 -0
  37. data/lib/dry/validation/rust/generated_predicates.rb +14 -0
  38. data/lib/dry/validation/rust/macros.rb +45 -0
  39. data/lib/dry/validation/rust/message.rb +41 -0
  40. data/lib/dry/validation/rust/message_backend.rb +115 -0
  41. data/lib/dry/validation/rust/message_set.rb +159 -0
  42. data/lib/dry/validation/rust/native.rb +25 -0
  43. data/lib/dry/validation/rust/path.rb +65 -0
  44. data/lib/dry/validation/rust/path_trie.rb +57 -0
  45. data/lib/dry/validation/rust/result.rb +3 -0
  46. data/lib/dry/validation/rust/rule.rb +62 -0
  47. data/lib/dry/validation/rust/schema/dsl.rb +76 -0
  48. data/lib/dry/validation/rust/schema/field_builder.rb +156 -0
  49. data/lib/dry/validation/rust/schema/field_definition.rb +99 -0
  50. data/lib/dry/validation/rust/schema/predicate_block.rb +56 -0
  51. data/lib/dry/validation/rust/schema/processor_hooks.rb +46 -0
  52. data/lib/dry/validation/rust/schema/result.rb +67 -0
  53. data/lib/dry/validation/rust/schema/ruby_type_processor.rb +44 -0
  54. data/lib/dry/validation/rust/schema.rb +323 -0
  55. data/lib/dry/validation/rust/values.rb +3 -0
  56. data/lib/dry/validation/rust/version.rb +10 -0
  57. data/lib/dry/validation/rust.rb +55 -0
  58. data/lib/dry/validation.rb +66 -0
  59. data/lib/dry-schema.rb +3 -0
  60. data/lib/dry-validation.rb +3 -0
  61. data/lib/dry_validation_rust.rb +3 -0
  62. data/predicates.yml +67 -0
  63. data/rust-toolchain.toml +9 -0
  64. metadata +260 -0
data/predicates.yml ADDED
@@ -0,0 +1,67 @@
1
+ # The authoritative ownership and native-plan mapping for supported predicates.
2
+ predicates:
3
+ - name: gt
4
+ owner: rust
5
+ ruby_method: ">"
6
+ rust_op: Gt
7
+ supported_types: [integer, float, decimal]
8
+ - name: gteq
9
+ owner: rust
10
+ ruby_method: ">="
11
+ rust_op: Gteq
12
+ supported_types: [integer, float, decimal]
13
+ - name: lt
14
+ owner: rust
15
+ ruby_method: "<"
16
+ rust_op: Lt
17
+ supported_types: [integer, float, decimal]
18
+ - name: lteq
19
+ owner: rust
20
+ ruby_method: "<="
21
+ rust_op: Lteq
22
+ supported_types: [integer, float, decimal]
23
+ - name: min_size
24
+ owner: rust
25
+ ruby_method: ">="
26
+ rust_op: MinSize
27
+ supported_types: [string, array, hash]
28
+ - name: max_size
29
+ owner: rust
30
+ ruby_method: "<="
31
+ rust_op: MaxSize
32
+ supported_types: [string, array, hash]
33
+ - name: size
34
+ owner: rust
35
+ ruby_method: "=="
36
+ rust_op: Size
37
+ supported_types: [string, array, hash]
38
+ - name: odd
39
+ owner: rust
40
+ ruby_method: odd?
41
+ rust_op: Odd
42
+ supported_types: [integer]
43
+ - name: even
44
+ owner: rust
45
+ ruby_method: even?
46
+ rust_op: Even
47
+ supported_types: [integer]
48
+ - name: format
49
+ owner: ruby
50
+ ruby_method: match?
51
+ supported_types: [string]
52
+ - name: included_in
53
+ owner: ruby
54
+ ruby_method: include?
55
+ supported_types: [any]
56
+ - name: excluded_from
57
+ owner: ruby
58
+ ruby_method: exclude?
59
+ supported_types: [any]
60
+ - name: eql
61
+ owner: ruby
62
+ ruby_method: eql?
63
+ supported_types: [any]
64
+ - name: not_eql
65
+ owner: ruby
66
+ ruby_method: "!="
67
+ supported_types: [any]
@@ -0,0 +1,9 @@
1
+ [toolchain]
2
+ channel = "1.75.0"
3
+ profile = "minimal"
4
+ targets = [
5
+ "aarch64-unknown-linux-gnu",
6
+ "x86_64-apple-darwin",
7
+ "aarch64-apple-darwin"
8
+ ]
9
+ components = [ "rust-analyzer" ]
metadata ADDED
@@ -0,0 +1,260 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: dry-validation-rust
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0.pre5
5
+ platform: ruby
6
+ authors:
7
+ - Alexey Tomilov
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2026-08-18 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: bigdecimal
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: '3.1'
20
+ - - "<"
21
+ - !ruby/object:Gem::Version
22
+ version: '5.0'
23
+ type: :runtime
24
+ prerelease: false
25
+ version_requirements: !ruby/object:Gem::Requirement
26
+ requirements:
27
+ - - ">="
28
+ - !ruby/object:Gem::Version
29
+ version: '3.1'
30
+ - - "<"
31
+ - !ruby/object:Gem::Version
32
+ version: '5.0'
33
+ - !ruby/object:Gem::Dependency
34
+ name: rb_sys
35
+ requirement: !ruby/object:Gem::Requirement
36
+ requirements:
37
+ - - "~>"
38
+ - !ruby/object:Gem::Version
39
+ version: '0.9'
40
+ type: :runtime
41
+ prerelease: false
42
+ version_requirements: !ruby/object:Gem::Requirement
43
+ requirements:
44
+ - - "~>"
45
+ - !ruby/object:Gem::Version
46
+ version: '0.9'
47
+ - !ruby/object:Gem::Dependency
48
+ name: memory_profiler
49
+ requirement: !ruby/object:Gem::Requirement
50
+ requirements:
51
+ - - "~>"
52
+ - !ruby/object:Gem::Version
53
+ version: '1.1'
54
+ type: :development
55
+ prerelease: false
56
+ version_requirements: !ruby/object:Gem::Requirement
57
+ requirements:
58
+ - - "~>"
59
+ - !ruby/object:Gem::Version
60
+ version: '1.1'
61
+ - !ruby/object:Gem::Dependency
62
+ name: minitest
63
+ requirement: !ruby/object:Gem::Requirement
64
+ requirements:
65
+ - - "~>"
66
+ - !ruby/object:Gem::Version
67
+ version: '6.0'
68
+ type: :development
69
+ prerelease: false
70
+ version_requirements: !ruby/object:Gem::Requirement
71
+ requirements:
72
+ - - "~>"
73
+ - !ruby/object:Gem::Version
74
+ version: '6.0'
75
+ - !ruby/object:Gem::Dependency
76
+ name: mutex_m
77
+ requirement: !ruby/object:Gem::Requirement
78
+ requirements:
79
+ - - "~>"
80
+ - !ruby/object:Gem::Version
81
+ version: '0.2'
82
+ type: :development
83
+ prerelease: false
84
+ version_requirements: !ruby/object:Gem::Requirement
85
+ requirements:
86
+ - - "~>"
87
+ - !ruby/object:Gem::Version
88
+ version: '0.2'
89
+ - !ruby/object:Gem::Dependency
90
+ name: ostruct
91
+ requirement: !ruby/object:Gem::Requirement
92
+ requirements:
93
+ - - "~>"
94
+ - !ruby/object:Gem::Version
95
+ version: '0.6'
96
+ type: :development
97
+ prerelease: false
98
+ version_requirements: !ruby/object:Gem::Requirement
99
+ requirements:
100
+ - - "~>"
101
+ - !ruby/object:Gem::Version
102
+ version: '0.6'
103
+ - !ruby/object:Gem::Dependency
104
+ name: rake
105
+ requirement: !ruby/object:Gem::Requirement
106
+ requirements:
107
+ - - "~>"
108
+ - !ruby/object:Gem::Version
109
+ version: '13.1'
110
+ type: :development
111
+ prerelease: false
112
+ version_requirements: !ruby/object:Gem::Requirement
113
+ requirements:
114
+ - - "~>"
115
+ - !ruby/object:Gem::Version
116
+ version: '13.1'
117
+ - !ruby/object:Gem::Dependency
118
+ name: rake-compiler
119
+ requirement: !ruby/object:Gem::Requirement
120
+ requirements:
121
+ - - "~>"
122
+ - !ruby/object:Gem::Version
123
+ version: '1.3'
124
+ type: :development
125
+ prerelease: false
126
+ version_requirements: !ruby/object:Gem::Requirement
127
+ requirements:
128
+ - - "~>"
129
+ - !ruby/object:Gem::Version
130
+ version: '1.3'
131
+ - !ruby/object:Gem::Dependency
132
+ name: rake-compiler-dock
133
+ requirement: !ruby/object:Gem::Requirement
134
+ requirements:
135
+ - - "~>"
136
+ - !ruby/object:Gem::Version
137
+ version: '1.12'
138
+ type: :development
139
+ prerelease: false
140
+ version_requirements: !ruby/object:Gem::Requirement
141
+ requirements:
142
+ - - "~>"
143
+ - !ruby/object:Gem::Version
144
+ version: '1.12'
145
+ - !ruby/object:Gem::Dependency
146
+ name: yard
147
+ requirement: !ruby/object:Gem::Requirement
148
+ requirements:
149
+ - - "~>"
150
+ - !ruby/object:Gem::Version
151
+ version: '0.9'
152
+ type: :development
153
+ prerelease: false
154
+ version_requirements: !ruby/object:Gem::Requirement
155
+ requirements:
156
+ - - "~>"
157
+ - !ruby/object:Gem::Version
158
+ version: '0.9'
159
+ description: |
160
+ A hybrid Ruby/Rust validation gem that compiles a documented subset of
161
+ dry-validation's declarative schema DSL into a native Rust execution plan
162
+ while retaining Ruby rule blocks and Ruby-owned dynamic behavior.
163
+ email:
164
+ executables: []
165
+ extensions:
166
+ - ext/dry_validation_rust/extconf.rb
167
+ extra_rdoc_files: []
168
+ files:
169
+ - CHANGELOG.md
170
+ - LICENSE
171
+ - NOTICE.md
172
+ - README.md
173
+ - docs/ARCHITECTURE.md
174
+ - docs/COMPATIBILITY.md
175
+ - docs/FEASIBILITY.md
176
+ - docs/SUPPORT_MATRIX.md
177
+ - docs/VERIFICATION.md
178
+ - dry-validation-rust.gemspec
179
+ - ext/dry_validation_rust/Cargo.lock
180
+ - ext/dry_validation_rust/Cargo.toml
181
+ - ext/dry_validation_rust/benches/coercion.rs
182
+ - ext/dry_validation_rust/benches/full_schema.rs
183
+ - ext/dry_validation_rust/benches/plan_compile.rs
184
+ - ext/dry_validation_rust/benches/predicates.rs
185
+ - ext/dry_validation_rust/extconf.rb
186
+ - ext/dry_validation_rust/src/coercion.rs
187
+ - ext/dry_validation_rust/src/engine.rs
188
+ - ext/dry_validation_rust/src/error.rs
189
+ - ext/dry_validation_rust/src/extract_primitive.rs
190
+ - ext/dry_validation_rust/src/generated_predicates.rs
191
+ - ext/dry_validation_rust/src/lib.rs
192
+ - ext/dry_validation_rust/src/plan.rs
193
+ - ext/dry_validation_rust/src/predicates.rs
194
+ - ext/dry_validation_rust/src/ruby_bridge.rs
195
+ - lib/dry-schema.rb
196
+ - lib/dry-validation.rb
197
+ - lib/dry/schema.rb
198
+ - lib/dry/validation.rb
199
+ - lib/dry/validation/rust.rb
200
+ - lib/dry/validation/rust/block_keyword_parameters.rb
201
+ - lib/dry/validation/rust/config.rb
202
+ - lib/dry/validation/rust/contract.rb
203
+ - lib/dry/validation/rust/contract/result.rb
204
+ - lib/dry/validation/rust/contract/values.rb
205
+ - lib/dry/validation/rust/errors.rb
206
+ - lib/dry/validation/rust/evaluator.rb
207
+ - lib/dry/validation/rust/failures.rb
208
+ - lib/dry/validation/rust/generated_predicates.rb
209
+ - lib/dry/validation/rust/macros.rb
210
+ - lib/dry/validation/rust/message.rb
211
+ - lib/dry/validation/rust/message_backend.rb
212
+ - lib/dry/validation/rust/message_set.rb
213
+ - lib/dry/validation/rust/native.rb
214
+ - lib/dry/validation/rust/path.rb
215
+ - lib/dry/validation/rust/path_trie.rb
216
+ - lib/dry/validation/rust/result.rb
217
+ - lib/dry/validation/rust/rule.rb
218
+ - lib/dry/validation/rust/schema.rb
219
+ - lib/dry/validation/rust/schema/dsl.rb
220
+ - lib/dry/validation/rust/schema/field_builder.rb
221
+ - lib/dry/validation/rust/schema/field_definition.rb
222
+ - lib/dry/validation/rust/schema/predicate_block.rb
223
+ - lib/dry/validation/rust/schema/processor_hooks.rb
224
+ - lib/dry/validation/rust/schema/result.rb
225
+ - lib/dry/validation/rust/schema/ruby_type_processor.rb
226
+ - lib/dry/validation/rust/values.rb
227
+ - lib/dry/validation/rust/version.rb
228
+ - lib/dry_validation_rust.rb
229
+ - predicates.yml
230
+ - rust-toolchain.toml
231
+ homepage: https://github.com/alex-tomilov/dry-validation-rust
232
+ licenses:
233
+ - MIT
234
+ metadata:
235
+ rubygems_mfa_required: 'true'
236
+ source_code_uri: https://github.com/alex-tomilov/dry-validation-rust
237
+ changelog_uri: https://github.com/alex-tomilov/dry-validation-rust/blob/main/CHANGELOG.md
238
+ documentation_uri: https://github.com/alex-tomilov/dry-validation-rust/blob/main/README.md
239
+ bug_tracker_uri: https://github.com/alex-tomilov/dry-validation-rust/issues
240
+ post_install_message:
241
+ rdoc_options: []
242
+ require_paths:
243
+ - lib
244
+ required_ruby_version: !ruby/object:Gem::Requirement
245
+ requirements:
246
+ - - ">="
247
+ - !ruby/object:Gem::Version
248
+ version: '3.3'
249
+ required_rubygems_version: !ruby/object:Gem::Requirement
250
+ requirements:
251
+ - - ">="
252
+ - !ruby/object:Gem::Version
253
+ version: '0'
254
+ requirements: []
255
+ rubygems_version: 3.5.22
256
+ signing_key:
257
+ specification_version: 4
258
+ summary: Experimental Rust-backed validation contracts with a dry-validation-like
259
+ API
260
+ test_files: []