add rust axum

Seto Elkahfi committed Aug 2, 2024 at 18:42 UTC 061bc6ac8bd36157896872650e791613ed3c7e22
5 files changed +997
.vscode/settings.json new
+5
@@ -0,0 +1,5 @@
1 +{
2 + "rust-analyzer.linkedProjects": [
3 + "backend/rust-axum/Cargo.toml"
4 +],
5 +}
\ No newline at end of file
MODULE.bazel
+2
@@ -1,3 +1,5 @@
1 +"tower of bazel"
2 +
3 bazel_dep(name = "bazel_skylib", version = "1.7.1")
4 bazel_dep(name = "rules_ruby", version = "0.12.1")
5 bazel_dep(name = "rules_apple", version = "3.6.0", repo_name = "build_bazel_rules_apple")
backend/rust-axum/Cargo.lock new
+911
@@ -0,0 +1,911 @@
1 +# This file is automatically @generated by Cargo.
2 +# It is not intended for manual editing.
3 +version = 3
4 +
5 +[[package]]
6 +name = "addr2line"
7 +version = "0.22.0"
8 +source = "registry+https://github.com/rust-lang/crates.io-index"
9 +checksum = "6e4503c46a5c0c7844e948c9a4d6acd9f50cccb4de1c48eb9e291ea17470c678"
10 +dependencies = [
11 + "gimli",
12 +]
13 +
14 +[[package]]
15 +name = "adler"
16 +version = "1.0.2"
17 +source = "registry+https://github.com/rust-lang/crates.io-index"
18 +checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe"
19 +
20 +[[package]]
21 +name = "aho-corasick"
22 +version = "1.1.3"
23 +source = "registry+https://github.com/rust-lang/crates.io-index"
24 +checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916"
25 +dependencies = [
26 + "memchr",
27 +]
28 +
29 +[[package]]
30 +name = "async-trait"
31 +version = "0.1.81"
32 +source = "registry+https://github.com/rust-lang/crates.io-index"
33 +checksum = "6e0c28dcc82d7c8ead5cb13beb15405b57b8546e93215673ff8ca0349a028107"
34 +dependencies = [
35 + "proc-macro2",
36 + "quote",
37 + "syn",
38 +]
39 +
40 +[[package]]
41 +name = "autocfg"
42 +version = "1.3.0"
43 +source = "registry+https://github.com/rust-lang/crates.io-index"
44 +checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0"
45 +
46 +[[package]]
47 +name = "axum"
48 +version = "0.7.5"
49 +source = "registry+https://github.com/rust-lang/crates.io-index"
50 +checksum = "3a6c9af12842a67734c9a2e355436e5d03b22383ed60cf13cd0c18fbfe3dcbcf"
51 +dependencies = [
52 + "async-trait",
53 + "axum-core",
54 + "bytes",
55 + "futures-util",
56 + "http",
57 + "http-body",
58 + "http-body-util",
59 + "hyper",
60 + "hyper-util",
61 + "itoa",
62 + "matchit",
63 + "memchr",
64 + "mime",
65 + "percent-encoding",
66 + "pin-project-lite",
67 + "rustversion",
68 + "serde",
69 + "serde_json",
70 + "serde_path_to_error",
71 + "serde_urlencoded",
72 + "sync_wrapper 1.0.1",
73 + "tokio",
74 + "tower",
75 + "tower-layer",
76 + "tower-service",
77 + "tracing",
78 +]
79 +
80 +[[package]]
81 +name = "axum-core"
82 +version = "0.4.3"
83 +source = "registry+https://github.com/rust-lang/crates.io-index"
84 +checksum = "a15c63fd72d41492dc4f497196f5da1fb04fb7529e631d73630d1b491e47a2e3"
85 +dependencies = [
86 + "async-trait",
87 + "bytes",
88 + "futures-util",
89 + "http",
90 + "http-body",
91 + "http-body-util",
92 + "mime",
93 + "pin-project-lite",
94 + "rustversion",
95 + "sync_wrapper 0.1.2",
96 + "tower-layer",
97 + "tower-service",
98 + "tracing",
99 +]
100 +
101 +[[package]]
102 +name = "backtrace"
103 +version = "0.3.73"
104 +source = "registry+https://github.com/rust-lang/crates.io-index"
105 +checksum = "5cc23269a4f8976d0a4d2e7109211a419fe30e8d88d677cd60b6bc79c5732e0a"
106 +dependencies = [
107 + "addr2line",
108 + "cc",
109 + "cfg-if",
110 + "libc",
111 + "miniz_oxide",
112 + "object",
113 + "rustc-demangle",
114 +]
115 +
116 +[[package]]
117 +name = "bitflags"
118 +version = "2.6.0"
119 +source = "registry+https://github.com/rust-lang/crates.io-index"
120 +checksum = "b048fb63fd8b5923fc5aa7b340d8e156aec7ec02f0c78fa8a6ddc2613f6f71de"
121 +
122 +[[package]]
123 +name = "bytes"
124 +version = "1.7.1"
125 +source = "registry+https://github.com/rust-lang/crates.io-index"
126 +checksum = "8318a53db07bb3f8dca91a600466bdb3f2eaadeedfdbcf02e1accbad9271ba50"
127 +
128 +[[package]]
129 +name = "cc"
130 +version = "1.1.7"
131 +source = "registry+https://github.com/rust-lang/crates.io-index"
132 +checksum = "26a5c3fd7bfa1ce3897a3a3501d362b2d87b7f2583ebcb4a949ec25911025cbc"
133 +
134 +[[package]]
135 +name = "cfg-if"
136 +version = "1.0.0"
137 +source = "registry+https://github.com/rust-lang/crates.io-index"
138 +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd"
139 +
140 +[[package]]
141 +name = "fnv"
142 +version = "1.0.7"
143 +source = "registry+https://github.com/rust-lang/crates.io-index"
144 +checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1"
145 +
146 +[[package]]
147 +name = "form_urlencoded"
148 +version = "1.2.1"
149 +source = "registry+https://github.com/rust-lang/crates.io-index"
150 +checksum = "e13624c2627564efccf4934284bdd98cbaa14e79b0b5a141218e507b3a823456"
151 +dependencies = [
152 + "percent-encoding",
153 +]
154 +
155 +[[package]]
156 +name = "futures-channel"
157 +version = "0.3.30"
158 +source = "registry+https://github.com/rust-lang/crates.io-index"
159 +checksum = "eac8f7d7865dcb88bd4373ab671c8cf4508703796caa2b1985a9ca867b3fcb78"
160 +dependencies = [
161 + "futures-core",
162 +]
163 +
164 +[[package]]
165 +name = "futures-core"
166 +version = "0.3.30"
167 +source = "registry+https://github.com/rust-lang/crates.io-index"
168 +checksum = "dfc6580bb841c5a68e9ef15c77ccc837b40a7504914d52e47b8b0e9bbda25a1d"
169 +
170 +[[package]]
171 +name = "futures-task"
172 +version = "0.3.30"
173 +source = "registry+https://github.com/rust-lang/crates.io-index"
174 +checksum = "38d84fa142264698cdce1a9f9172cf383a0c82de1bddcf3092901442c4097004"
175 +
176 +[[package]]
177 +name = "futures-util"
178 +version = "0.3.30"
179 +source = "registry+https://github.com/rust-lang/crates.io-index"
180 +checksum = "3d6401deb83407ab3da39eba7e33987a73c3df0c82b4bb5813ee871c19c41d48"
181 +dependencies = [
182 + "futures-core",
183 + "futures-task",
184 + "pin-project-lite",
185 + "pin-utils",
186 +]
187 +
188 +[[package]]
189 +name = "gimli"
190 +version = "0.29.0"
191 +source = "registry+https://github.com/rust-lang/crates.io-index"
192 +checksum = "40ecd4077b5ae9fd2e9e169b102c6c330d0605168eb0e8bf79952b256dbefffd"
193 +
194 +[[package]]
195 +name = "hermit-abi"
196 +version = "0.3.9"
197 +source = "registry+https://github.com/rust-lang/crates.io-index"
198 +checksum = "d231dfb89cfffdbc30e7fc41579ed6066ad03abda9e567ccafae602b97ec5024"
199 +
200 +[[package]]
201 +name = "http"
202 +version = "1.1.0"
203 +source = "registry+https://github.com/rust-lang/crates.io-index"
204 +checksum = "21b9ddb458710bc376481b842f5da65cdf31522de232c1ca8146abce2a358258"
205 +dependencies = [
206 + "bytes",
207 + "fnv",
208 + "itoa",
209 +]
210 +
211 +[[package]]
212 +name = "http-body"
213 +version = "1.0.1"
214 +source = "registry+https://github.com/rust-lang/crates.io-index"
215 +checksum = "1efedce1fb8e6913f23e0c92de8e62cd5b772a67e7b3946df930a62566c93184"
216 +dependencies = [
217 + "bytes",
218 + "http",
219 +]
220 +
221 +[[package]]
222 +name = "http-body-util"
223 +version = "0.1.2"
224 +source = "registry+https://github.com/rust-lang/crates.io-index"
225 +checksum = "793429d76616a256bcb62c2a2ec2bed781c8307e797e2598c50010f2bee2544f"
226 +dependencies = [
227 + "bytes",
228 + "futures-util",
229 + "http",
230 + "http-body",
231 + "pin-project-lite",
232 +]
233 +
234 +[[package]]
235 +name = "httparse"
236 +version = "1.9.4"
237 +source = "registry+https://github.com/rust-lang/crates.io-index"
238 +checksum = "0fcc0b4a115bf80b728eb8ea024ad5bd707b615bfed49e0665b6e0f86fd082d9"
239 +
240 +[[package]]
241 +name = "httpdate"
242 +version = "1.0.3"
243 +source = "registry+https://github.com/rust-lang/crates.io-index"
244 +checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9"
245 +
246 +[[package]]
247 +name = "hyper"
248 +version = "1.4.1"
249 +source = "registry+https://github.com/rust-lang/crates.io-index"
250 +checksum = "50dfd22e0e76d0f662d429a5f80fcaf3855009297eab6a0a9f8543834744ba05"
251 +dependencies = [
252 + "bytes",
253 + "futures-channel",
254 + "futures-util",
255 + "http",
256 + "http-body",
257 + "httparse",
258 + "httpdate",
259 + "itoa",
260 + "pin-project-lite",
261 + "smallvec",
262 + "tokio",
263 +]
264 +
265 +[[package]]
266 +name = "hyper-util"
267 +version = "0.1.6"
268 +source = "registry+https://github.com/rust-lang/crates.io-index"
269 +checksum = "3ab92f4f49ee4fb4f997c784b7a2e0fa70050211e0b6a287f898c3c9785ca956"
270 +dependencies = [
271 + "bytes",
272 + "futures-util",
273 + "http",
274 + "http-body",
275 + "hyper",
276 + "pin-project-lite",
277 + "tokio",
278 +]
279 +
280 +[[package]]
281 +name = "itoa"
282 +version = "1.0.11"
283 +source = "registry+https://github.com/rust-lang/crates.io-index"
284 +checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b"
285 +
286 +[[package]]
287 +name = "lazy_static"
288 +version = "1.5.0"
289 +source = "registry+https://github.com/rust-lang/crates.io-index"
290 +checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe"
291 +
292 +[[package]]
293 +name = "libc"
294 +version = "0.2.155"
295 +source = "registry+https://github.com/rust-lang/crates.io-index"
296 +checksum = "97b3888a4aecf77e811145cadf6eef5901f4782c53886191b2f693f24761847c"
297 +
298 +[[package]]
299 +name = "lock_api"
300 +version = "0.4.12"
301 +source = "registry+https://github.com/rust-lang/crates.io-index"
302 +checksum = "07af8b9cdd281b7915f413fa73f29ebd5d55d0d3f0155584dade1ff18cea1b17"
303 +dependencies = [
304 + "autocfg",
305 + "scopeguard",
306 +]
307 +
308 +[[package]]
309 +name = "log"
310 +version = "0.4.22"
311 +source = "registry+https://github.com/rust-lang/crates.io-index"
312 +checksum = "a7a70ba024b9dc04c27ea2f0c0548feb474ec5c54bba33a7f72f873a39d07b24"
313 +
314 +[[package]]
315 +name = "matchers"
316 +version = "0.1.0"
317 +source = "registry+https://github.com/rust-lang/crates.io-index"
318 +checksum = "8263075bb86c5a1b1427b5ae862e8889656f126e9f77c484496e8b47cf5c5558"
319 +dependencies = [
320 + "regex-automata 0.1.10",
321 +]
322 +
323 +[[package]]
324 +name = "matchit"
325 +version = "0.7.3"
326 +source = "registry+https://github.com/rust-lang/crates.io-index"
327 +checksum = "0e7465ac9959cc2b1404e8e2367b43684a6d13790fe23056cc8c6c5a6b7bcb94"
328 +
329 +[[package]]
330 +name = "memchr"
331 +version = "2.7.4"
332 +source = "registry+https://github.com/rust-lang/crates.io-index"
333 +checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3"
334 +
335 +[[package]]
336 +name = "mime"
337 +version = "0.3.17"
338 +source = "registry+https://github.com/rust-lang/crates.io-index"
339 +checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a"
340 +
341 +[[package]]
342 +name = "miniz_oxide"
343 +version = "0.7.4"
344 +source = "registry+https://github.com/rust-lang/crates.io-index"
345 +checksum = "b8a240ddb74feaf34a79a7add65a741f3167852fba007066dcac1ca548d89c08"
346 +dependencies = [
347 + "adler",
348 +]
349 +
350 +[[package]]
351 +name = "mio"
352 +version = "1.0.1"
353 +source = "registry+https://github.com/rust-lang/crates.io-index"
354 +checksum = "4569e456d394deccd22ce1c1913e6ea0e54519f577285001215d33557431afe4"
355 +dependencies = [
356 + "hermit-abi",
357 + "libc",
358 + "wasi",
359 + "windows-sys",
360 +]
361 +
362 +[[package]]
363 +name = "nu-ansi-term"
364 +version = "0.46.0"
365 +source = "registry+https://github.com/rust-lang/crates.io-index"
366 +checksum = "77a8165726e8236064dbb45459242600304b42a5ea24ee2948e18e023bf7ba84"
367 +dependencies = [
368 + "overload",
369 + "winapi",
370 +]
371 +
372 +[[package]]
373 +name = "object"
374 +version = "0.36.2"
375 +source = "registry+https://github.com/rust-lang/crates.io-index"
376 +checksum = "3f203fa8daa7bb185f760ae12bd8e097f63d17041dcdcaf675ac54cdf863170e"
377 +dependencies = [
378 + "memchr",
379 +]
380 +
381 +[[package]]
382 +name = "once_cell"
383 +version = "1.19.0"
384 +source = "registry+https://github.com/rust-lang/crates.io-index"
385 +checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92"
386 +
387 +[[package]]
388 +name = "overload"
389 +version = "0.1.1"
390 +source = "registry+https://github.com/rust-lang/crates.io-index"
391 +checksum = "b15813163c1d831bf4a13c3610c05c0d03b39feb07f7e09fa234dac9b15aaf39"
392 +
393 +[[package]]
394 +name = "parking_lot"
395 +version = "0.12.3"
396 +source = "registry+https://github.com/rust-lang/crates.io-index"
397 +checksum = "f1bf18183cf54e8d6059647fc3063646a1801cf30896933ec2311622cc4b9a27"
398 +dependencies = [
399 + "lock_api",
400 + "parking_lot_core",
401 +]
402 +
403 +[[package]]
404 +name = "parking_lot_core"
405 +version = "0.9.10"
406 +source = "registry+https://github.com/rust-lang/crates.io-index"
407 +checksum = "1e401f977ab385c9e4e3ab30627d6f26d00e2c73eef317493c4ec6d468726cf8"
408 +dependencies = [
409 + "cfg-if",
410 + "libc",
411 + "redox_syscall",
412 + "smallvec",
413 + "windows-targets",
414 +]
415 +
416 +[[package]]
417 +name = "percent-encoding"
418 +version = "2.3.1"
419 +source = "registry+https://github.com/rust-lang/crates.io-index"
420 +checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e"
421 +
422 +[[package]]
423 +name = "pin-project"
424 +version = "1.1.5"
425 +source = "registry+https://github.com/rust-lang/crates.io-index"
426 +checksum = "b6bf43b791c5b9e34c3d182969b4abb522f9343702850a2e57f460d00d09b4b3"
427 +dependencies = [
428 + "pin-project-internal",
429 +]
430 +
431 +[[package]]
432 +name = "pin-project-internal"
433 +version = "1.1.5"
434 +source = "registry+https://github.com/rust-lang/crates.io-index"
435 +checksum = "2f38a4412a78282e09a2cf38d195ea5420d15ba0602cb375210efbc877243965"
436 +dependencies = [
437 + "proc-macro2",
438 + "quote",
439 + "syn",
440 +]
441 +
442 +[[package]]
443 +name = "pin-project-lite"
444 +version = "0.2.14"
445 +source = "registry+https://github.com/rust-lang/crates.io-index"
446 +checksum = "bda66fc9667c18cb2758a2ac84d1167245054bcf85d5d1aaa6923f45801bdd02"
447 +
448 +[[package]]
449 +name = "pin-utils"
450 +version = "0.1.0"
451 +source = "registry+https://github.com/rust-lang/crates.io-index"
452 +checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184"
453 +
454 +[[package]]
455 +name = "proc-macro2"
456 +version = "1.0.86"
457 +source = "registry+https://github.com/rust-lang/crates.io-index"
458 +checksum = "5e719e8df665df0d1c8fbfd238015744736151d4445ec0836b8e628aae103b77"
459 +dependencies = [
460 + "unicode-ident",
461 +]
462 +
463 +[[package]]
464 +name = "quote"
465 +version = "1.0.36"
466 +source = "registry+https://github.com/rust-lang/crates.io-index"
467 +checksum = "0fa76aaf39101c457836aec0ce2316dbdc3ab723cdda1c6bd4e6ad4208acaca7"
468 +dependencies = [
469 + "proc-macro2",
470 +]
471 +
472 +[[package]]
473 +name = "redox_syscall"
474 +version = "0.5.3"
475 +source = "registry+https://github.com/rust-lang/crates.io-index"
476 +checksum = "2a908a6e00f1fdd0dfd9c0eb08ce85126f6d8bbda50017e74bc4a4b7d4a926a4"
477 +dependencies = [
478 + "bitflags",
479 +]
480 +
481 +[[package]]
482 +name = "regex"
483 +version = "1.10.6"
484 +source = "registry+https://github.com/rust-lang/crates.io-index"
485 +checksum = "4219d74c6b67a3654a9fbebc4b419e22126d13d2f3c4a07ee0cb61ff79a79619"
486 +dependencies = [
487 + "aho-corasick",
488 + "memchr",
489 + "regex-automata 0.4.7",
490 + "regex-syntax 0.8.4",
491 +]
492 +
493 +[[package]]
494 +name = "regex-automata"
495 +version = "0.1.10"
496 +source = "registry+https://github.com/rust-lang/crates.io-index"
497 +checksum = "6c230d73fb8d8c1b9c0b3135c5142a8acee3a0558fb8db5cf1cb65f8d7862132"
498 +dependencies = [
499 + "regex-syntax 0.6.29",
500 +]
501 +
502 +[[package]]
503 +name = "regex-automata"
504 +version = "0.4.7"
505 +source = "registry+https://github.com/rust-lang/crates.io-index"
506 +checksum = "38caf58cc5ef2fed281f89292ef23f6365465ed9a41b7a7754eb4e26496c92df"
507 +dependencies = [
508 + "aho-corasick",
509 + "memchr",
510 + "regex-syntax 0.8.4",
511 +]
512 +
513 +[[package]]
514 +name = "regex-syntax"
515 +version = "0.6.29"
516 +source = "registry+https://github.com/rust-lang/crates.io-index"
517 +checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1"
518 +
519 +[[package]]
520 +name = "regex-syntax"
521 +version = "0.8.4"
522 +source = "registry+https://github.com/rust-lang/crates.io-index"
523 +checksum = "7a66a03ae7c801facd77a29370b4faec201768915ac14a721ba36f20bc9c209b"
524 +
525 +[[package]]
526 +name = "rust-axum"
527 +version = "0.1.0"
528 +dependencies = [
529 + "axum",
530 + "serde",
531 + "tokio",
532 + "tracing",
533 + "tracing-subscriber",
534 +]
535 +
536 +[[package]]
537 +name = "rustc-demangle"
538 +version = "0.1.24"
539 +source = "registry+https://github.com/rust-lang/crates.io-index"
540 +checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f"
541 +
542 +[[package]]
543 +name = "rustversion"
544 +version = "1.0.17"
545 +source = "registry+https://github.com/rust-lang/crates.io-index"
546 +checksum = "955d28af4278de8121b7ebeb796b6a45735dc01436d898801014aced2773a3d6"
547 +
548 +[[package]]
549 +name = "ryu"
550 +version = "1.0.18"
551 +source = "registry+https://github.com/rust-lang/crates.io-index"
552 +checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f"
553 +
554 +[[package]]
555 +name = "scopeguard"
556 +version = "1.2.0"
557 +source = "registry+https://github.com/rust-lang/crates.io-index"
558 +checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49"
559 +
560 +[[package]]
561 +name = "serde"
562 +version = "1.0.204"
563 +source = "registry+https://github.com/rust-lang/crates.io-index"
564 +checksum = "bc76f558e0cbb2a839d37354c575f1dc3fdc6546b5be373ba43d95f231bf7c12"
565 +dependencies = [
566 + "serde_derive",
567 +]
568 +
569 +[[package]]
570 +name = "serde_derive"
571 +version = "1.0.204"
572 +source = "registry+https://github.com/rust-lang/crates.io-index"
573 +checksum = "e0cd7e117be63d3c3678776753929474f3b04a43a080c744d6b0ae2a8c28e222"
574 +dependencies = [
575 + "proc-macro2",
576 + "quote",
577 + "syn",
578 +]
579 +
580 +[[package]]
581 +name = "serde_json"
582 +version = "1.0.122"
583 +source = "registry+https://github.com/rust-lang/crates.io-index"
584 +checksum = "784b6203951c57ff748476b126ccb5e8e2959a5c19e5c617ab1956be3dbc68da"
585 +dependencies = [
586 + "itoa",
587 + "memchr",
588 + "ryu",
589 + "serde",
590 +]
591 +
592 +[[package]]
593 +name = "serde_path_to_error"
594 +version = "0.1.16"
595 +source = "registry+https://github.com/rust-lang/crates.io-index"
596 +checksum = "af99884400da37c88f5e9146b7f1fd0fbcae8f6eec4e9da38b67d05486f814a6"
597 +dependencies = [
598 + "itoa",
599 + "serde",
600 +]
601 +
602 +[[package]]
603 +name = "serde_urlencoded"
604 +version = "0.7.1"
605 +source = "registry+https://github.com/rust-lang/crates.io-index"
606 +checksum = "d3491c14715ca2294c4d6a88f15e84739788c1d030eed8c110436aafdaa2f3fd"
607 +dependencies = [
608 + "form_urlencoded",
609 + "itoa",
610 + "ryu",
611 + "serde",
612 +]
613 +
614 +[[package]]
615 +name = "sharded-slab"
616 +version = "0.1.7"
617 +source = "registry+https://github.com/rust-lang/crates.io-index"
618 +checksum = "f40ca3c46823713e0d4209592e8d6e826aa57e928f09752619fc696c499637f6"
619 +dependencies = [
620 + "lazy_static",
621 +]
622 +
623 +[[package]]
624 +name = "signal-hook-registry"
625 +version = "1.4.2"
626 +source = "registry+https://github.com/rust-lang/crates.io-index"
627 +checksum = "a9e9e0b4211b72e7b8b6e85c807d36c212bdb33ea8587f7569562a84df5465b1"
628 +dependencies = [
629 + "libc",
630 +]
631 +
632 +[[package]]
633 +name = "smallvec"
634 +version = "1.13.2"
635 +source = "registry+https://github.com/rust-lang/crates.io-index"
636 +checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67"
637 +
638 +[[package]]
639 +name = "socket2"
640 +version = "0.5.7"
641 +source = "registry+https://github.com/rust-lang/crates.io-index"
642 +checksum = "ce305eb0b4296696835b71df73eb912e0f1ffd2556a501fcede6e0c50349191c"
643 +dependencies = [
644 + "libc",
645 + "windows-sys",
646 +]
647 +
648 +[[package]]
649 +name = "syn"
650 +version = "2.0.72"
651 +source = "registry+https://github.com/rust-lang/crates.io-index"
652 +checksum = "dc4b9b9bf2add8093d3f2c0204471e951b2285580335de42f9d2534f3ae7a8af"
653 +dependencies = [
654 + "proc-macro2",
655 + "quote",
656 + "unicode-ident",
657 +]
658 +
659 +[[package]]
660 +name = "sync_wrapper"
661 +version = "0.1.2"
662 +source = "registry+https://github.com/rust-lang/crates.io-index"
663 +checksum = "2047c6ded9c721764247e62cd3b03c09ffc529b2ba5b10ec482ae507a4a70160"
664 +
665 +[[package]]
666 +name = "sync_wrapper"
667 +version = "1.0.1"
668 +source = "registry+https://github.com/rust-lang/crates.io-index"
669 +checksum = "a7065abeca94b6a8a577f9bd45aa0867a2238b74e8eb67cf10d492bc39351394"
670 +
671 +[[package]]
672 +name = "thread_local"
673 +version = "1.1.8"
674 +source = "registry+https://github.com/rust-lang/crates.io-index"
675 +checksum = "8b9ef9bad013ada3808854ceac7b46812a6465ba368859a37e2100283d2d719c"
676 +dependencies = [
677 + "cfg-if",
678 + "once_cell",
679 +]
680 +
681 +[[package]]
682 +name = "tokio"
683 +version = "1.39.2"
684 +source = "registry+https://github.com/rust-lang/crates.io-index"
685 +checksum = "daa4fb1bc778bd6f04cbfc4bb2d06a7396a8f299dc33ea1900cedaa316f467b1"
686 +dependencies = [
687 + "backtrace",
688 + "bytes",
689 + "libc",
690 + "mio",
691 + "parking_lot",
692 + "pin-project-lite",
693 + "signal-hook-registry",
694 + "socket2",
695 + "tokio-macros",
696 + "windows-sys",
697 +]
698 +
699 +[[package]]
700 +name = "tokio-macros"
701 +version = "2.4.0"
702 +source = "registry+https://github.com/rust-lang/crates.io-index"
703 +checksum = "693d596312e88961bc67d7f1f97af8a70227d9f90c31bba5806eec004978d752"
704 +dependencies = [
705 + "proc-macro2",
706 + "quote",
707 + "syn",
708 +]
709 +
710 +[[package]]
711 +name = "tower"
712 +version = "0.4.13"
713 +source = "registry+https://github.com/rust-lang/crates.io-index"
714 +checksum = "b8fa9be0de6cf49e536ce1851f987bd21a43b771b09473c3549a6c853db37c1c"
715 +dependencies = [
716 + "futures-core",
717 + "futures-util",
718 + "pin-project",
719 + "pin-project-lite",
720 + "tokio",
721 + "tower-layer",
722 + "tower-service",
723 + "tracing",
724 +]
725 +
726 +[[package]]
727 +name = "tower-layer"
728 +version = "0.3.2"
729 +source = "registry+https://github.com/rust-lang/crates.io-index"
730 +checksum = "c20c8dbed6283a09604c3e69b4b7eeb54e298b8a600d4d5ecb5ad39de609f1d0"
731 +
732 +[[package]]
733 +name = "tower-service"
734 +version = "0.3.2"
735 +source = "registry+https://github.com/rust-lang/crates.io-index"
736 +checksum = "b6bc1c9ce2b5135ac7f93c72918fc37feb872bdc6a5533a8b85eb4b86bfdae52"
737 +
738 +[[package]]
739 +name = "tracing"
740 +version = "0.1.40"
741 +source = "registry+https://github.com/rust-lang/crates.io-index"
742 +checksum = "c3523ab5a71916ccf420eebdf5521fcef02141234bbc0b8a49f2fdc4544364ef"
743 +dependencies = [
744 + "log",
745 + "pin-project-lite",
746 + "tracing-attributes",
747 + "tracing-core",
748 +]
749 +
750 +[[package]]
751 +name = "tracing-attributes"
752 +version = "0.1.27"
753 +source = "registry+https://github.com/rust-lang/crates.io-index"
754 +checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7"
755 +dependencies = [
756 + "proc-macro2",
757 + "quote",
758 + "syn",
759 +]
760 +
761 +[[package]]
762 +name = "tracing-core"
763 +version = "0.1.32"
764 +source = "registry+https://github.com/rust-lang/crates.io-index"
765 +checksum = "c06d3da6113f116aaee68e4d601191614c9053067f9ab7f6edbcb161237daa54"
766 +dependencies = [
767 + "once_cell",
768 + "valuable",
769 +]
770 +
771 +[[package]]
772 +name = "tracing-log"
773 +version = "0.2.0"
774 +source = "registry+https://github.com/rust-lang/crates.io-index"
775 +checksum = "ee855f1f400bd0e5c02d150ae5de3840039a3f54b025156404e34c23c03f47c3"
776 +dependencies = [
777 + "log",
778 + "once_cell",
779 + "tracing-core",
780 +]
781 +
782 +[[package]]
783 +name = "tracing-subscriber"
784 +version = "0.3.18"
785 +source = "registry+https://github.com/rust-lang/crates.io-index"
786 +checksum = "ad0f048c97dbd9faa9b7df56362b8ebcaa52adb06b498c050d2f4e32f90a7a8b"
787 +dependencies = [
788 + "matchers",
789 + "nu-ansi-term",
790 + "once_cell",
791 + "regex",
792 + "sharded-slab",
793 + "smallvec",
794 + "thread_local",
795 + "tracing",
796 + "tracing-core",
797 + "tracing-log",
798 +]
799 +
800 +[[package]]
801 +name = "unicode-ident"
802 +version = "1.0.12"
803 +source = "registry+https://github.com/rust-lang/crates.io-index"
804 +checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b"
805 +
806 +[[package]]
807 +name = "valuable"
808 +version = "0.1.0"
809 +source = "registry+https://github.com/rust-lang/crates.io-index"
810 +checksum = "830b7e5d4d90034032940e4ace0d9a9a057e7a45cd94e6c007832e39edb82f6d"
811 +
812 +[[package]]
813 +name = "wasi"
814 +version = "0.11.0+wasi-snapshot-preview1"
815 +source = "registry+https://github.com/rust-lang/crates.io-index"
816 +checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423"
817 +
818 +[[package]]
819 +name = "winapi"
820 +version = "0.3.9"
821 +source = "registry+https://github.com/rust-lang/crates.io-index"
822 +checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419"
823 +dependencies = [
824 + "winapi-i686-pc-windows-gnu",
825 + "winapi-x86_64-pc-windows-gnu",
826 +]
827 +
828 +[[package]]
829 +name = "winapi-i686-pc-windows-gnu"
830 +version = "0.4.0"
831 +source = "registry+https://github.com/rust-lang/crates.io-index"
832 +checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6"
833 +
834 +[[package]]
835 +name = "winapi-x86_64-pc-windows-gnu"
836 +version = "0.4.0"
837 +source = "registry+https://github.com/rust-lang/crates.io-index"
838 +checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f"
839 +
840 +[[package]]
841 +name = "windows-sys"
842 +version = "0.52.0"
843 +source = "registry+https://github.com/rust-lang/crates.io-index"
844 +checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d"
845 +dependencies = [
846 + "windows-targets",
847 +]
848 +
849 +[[package]]
850 +name = "windows-targets"
851 +version = "0.52.6"
852 +source = "registry+https://github.com/rust-lang/crates.io-index"
853 +checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973"
854 +dependencies = [
855 + "windows_aarch64_gnullvm",
856 + "windows_aarch64_msvc",
857 + "windows_i686_gnu",
858 + "windows_i686_gnullvm",
859 + "windows_i686_msvc",
860 + "windows_x86_64_gnu",
861 + "windows_x86_64_gnullvm",
862 + "windows_x86_64_msvc",
863 +]
864 +
865 +[[package]]
866 +name = "windows_aarch64_gnullvm"
867 +version = "0.52.6"
868 +source = "registry+https://github.com/rust-lang/crates.io-index"
869 +checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3"
870 +
871 +[[package]]
872 +name = "windows_aarch64_msvc"
873 +version = "0.52.6"
874 +source = "registry+https://github.com/rust-lang/crates.io-index"
875 +checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469"
876 +
877 +[[package]]
878 +name = "windows_i686_gnu"
879 +version = "0.52.6"
880 +source = "registry+https://github.com/rust-lang/crates.io-index"
881 +checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b"
882 +
883 +[[package]]
884 +name = "windows_i686_gnullvm"
885 +version = "0.52.6"
886 +source = "registry+https://github.com/rust-lang/crates.io-index"
887 +checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66"
888 +
889 +[[package]]
890 +name = "windows_i686_msvc"
891 +version = "0.52.6"
892 +source = "registry+https://github.com/rust-lang/crates.io-index"
893 +checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66"
894 +
895 +[[package]]
896 +name = "windows_x86_64_gnu"
897 +version = "0.52.6"
898 +source = "registry+https://github.com/rust-lang/crates.io-index"
899 +checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78"
900 +
901 +[[package]]
902 +name = "windows_x86_64_gnullvm"
903 +version = "0.52.6"
904 +source = "registry+https://github.com/rust-lang/crates.io-index"
905 +checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d"
906 +
907 +[[package]]
908 +name = "windows_x86_64_msvc"
909 +version = "0.52.6"
910 +source = "registry+https://github.com/rust-lang/crates.io-index"
911 +checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec"
backend/rust-axum/Cargo.toml new
+12
@@ -0,0 +1,12 @@
1 +[package]
2 +name = "rust-axum"
3 +version = "0.1.0"
4 +edition = "2021"
5 +publish = false
6 +
7 +[dependencies]
8 +axum = "0.7.5"
9 +serde = { version = "1.0", features = ["derive"] }
10 +tokio = { version = "1.0", features = ["full"] }
11 +tracing = "0.1"
12 +tracing-subscriber = { version = "0.3", features = ["env-filter"] }
backend/rust-axum/src/main.rs new
+67
@@ -0,0 +1,67 @@
1 +//! Run with
2 +//!
3 +//! ```not_rust
4 +//! cargo run -p example-form
5 +//! ```
6 +
7 +use axum::{extract::Form, response::Html, routing::get, Router};
8 +use serde::Deserialize;
9 +use tracing_subscriber::{layer::SubscriberExt, util::SubscriberInitExt};
10 +
11 +#[tokio::main]
12 +async fn main() {
13 + tracing_subscriber::registry()
14 + .with(
15 + tracing_subscriber::EnvFilter::try_from_default_env()
16 + .unwrap_or_else(|_| "example_form=debug".into()),
17 + )
18 + .with(tracing_subscriber::fmt::layer())
19 + .init();
20 +
21 + // build our application with some routes
22 + let app = Router::new().route("/", get(show_form).post(accept_form));
23 +
24 + // run it
25 + let listener = tokio::net::TcpListener::bind("127.0.0.1:3000")
26 + .await
27 + .unwrap();
28 + tracing::debug!("listening on {}", listener.local_addr().unwrap());
29 + axum::serve(listener, app).await.unwrap();
30 +}
31 +
32 +async fn show_form() -> Html<&'static str> {
33 + Html(
34 + r#"
35 + <!doctype html>
36 + <html>
37 + <head></head>
38 + <body>
39 + <form action="/" method="post">
40 + <label for="name">
41 + Enter your name:
42 + <input type="text" name="name">
43 + </label>
44 +
45 + <label>
46 + Enter your email:
47 + <input type="text" name="email">
48 + </label>
49 +
50 + <input type="submit" value="Subscribe!">
51 + </form>
52 + </body>
53 + </html>
54 + "#,
55 + )
56 +}
57 +
58 +#[derive(Deserialize, Debug)]
59 +#[allow(dead_code)]
60 +struct Input {
61 + name: String,
62 + email: String,
63 +}
64 +
65 +async fn accept_form(Form(input): Form<Input>) {
66 + dbg!(&input);
67 +}
\ No newline at end of file