├── .gitignore ├── Cargo.lock ├── Cargo.toml ├── LICENSE ├── README.md ├── build.rs ├── proto └── calculator.proto └── src ├── client.rs └── main.rs /.gitignore: -------------------------------------------------------------------------------- 1 | /target 2 | -------------------------------------------------------------------------------- /Cargo.lock: -------------------------------------------------------------------------------- 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.21.0" 8 | source = "registry+https://github.com/rust-lang/crates.io-index" 9 | checksum = "8a30b2e23b9e17a9f90641c7ab1549cd9b44f296d3ccbf309d2863cfe398a0cb" 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.2" 23 | source = "registry+https://github.com/rust-lang/crates.io-index" 24 | checksum = "b2969dcb958b36655471fc61f7e416fa76033bdd4bfed0678d8fee1e2d07a1f0" 25 | dependencies = [ 26 | "memchr", 27 | ] 28 | 29 | [[package]] 30 | name = "anyhow" 31 | version = "1.0.79" 32 | source = "registry+https://github.com/rust-lang/crates.io-index" 33 | checksum = "080e9890a082662b09c1ad45f567faeeb47f22b5fb23895fbe1e651e718e25ca" 34 | 35 | [[package]] 36 | name = "async-stream" 37 | version = "0.3.5" 38 | source = "registry+https://github.com/rust-lang/crates.io-index" 39 | checksum = "cd56dd203fef61ac097dd65721a419ddccb106b2d2b70ba60a6b529f03961a51" 40 | dependencies = [ 41 | "async-stream-impl", 42 | "futures-core", 43 | "pin-project-lite", 44 | ] 45 | 46 | [[package]] 47 | name = "async-stream-impl" 48 | version = "0.3.5" 49 | source = "registry+https://github.com/rust-lang/crates.io-index" 50 | checksum = "16e62a023e7c117e27523144c5d2459f4397fcc3cab0085af8e2224f643a0193" 51 | dependencies = [ 52 | "proc-macro2", 53 | "quote", 54 | "syn", 55 | ] 56 | 57 | [[package]] 58 | name = "async-trait" 59 | version = "0.1.77" 60 | source = "registry+https://github.com/rust-lang/crates.io-index" 61 | checksum = "c980ee35e870bd1a4d2c8294d4c04d0499e67bca1e4b5cefcc693c2fa00caea9" 62 | dependencies = [ 63 | "proc-macro2", 64 | "quote", 65 | "syn", 66 | ] 67 | 68 | [[package]] 69 | name = "autocfg" 70 | version = "1.1.0" 71 | source = "registry+https://github.com/rust-lang/crates.io-index" 72 | checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" 73 | 74 | [[package]] 75 | name = "axum" 76 | version = "0.6.20" 77 | source = "registry+https://github.com/rust-lang/crates.io-index" 78 | checksum = "3b829e4e32b91e643de6eafe82b1d90675f5874230191a4ffbc1b336dec4d6bf" 79 | dependencies = [ 80 | "async-trait", 81 | "axum-core", 82 | "bitflags 1.3.2", 83 | "bytes", 84 | "futures-util", 85 | "http", 86 | "http-body", 87 | "hyper", 88 | "itoa", 89 | "matchit", 90 | "memchr", 91 | "mime", 92 | "percent-encoding", 93 | "pin-project-lite", 94 | "rustversion", 95 | "serde", 96 | "sync_wrapper", 97 | "tower", 98 | "tower-layer", 99 | "tower-service", 100 | ] 101 | 102 | [[package]] 103 | name = "axum-core" 104 | version = "0.3.4" 105 | source = "registry+https://github.com/rust-lang/crates.io-index" 106 | checksum = "759fa577a247914fd3f7f76d62972792636412fbfd634cd452f6a385a74d2d2c" 107 | dependencies = [ 108 | "async-trait", 109 | "bytes", 110 | "futures-util", 111 | "http", 112 | "http-body", 113 | "mime", 114 | "rustversion", 115 | "tower-layer", 116 | "tower-service", 117 | ] 118 | 119 | [[package]] 120 | name = "backtrace" 121 | version = "0.3.69" 122 | source = "registry+https://github.com/rust-lang/crates.io-index" 123 | checksum = "2089b7e3f35b9dd2d0ed921ead4f6d318c27680d4a5bd167b3ee120edb105837" 124 | dependencies = [ 125 | "addr2line", 126 | "cc", 127 | "cfg-if", 128 | "libc", 129 | "miniz_oxide", 130 | "object", 131 | "rustc-demangle", 132 | ] 133 | 134 | [[package]] 135 | name = "base64" 136 | version = "0.21.7" 137 | source = "registry+https://github.com/rust-lang/crates.io-index" 138 | checksum = "9d297deb1925b89f2ccc13d7635fa0714f12c87adce1c75356b39ca9b7178567" 139 | 140 | [[package]] 141 | name = "bitflags" 142 | version = "1.3.2" 143 | source = "registry+https://github.com/rust-lang/crates.io-index" 144 | checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" 145 | 146 | [[package]] 147 | name = "bitflags" 148 | version = "2.4.2" 149 | source = "registry+https://github.com/rust-lang/crates.io-index" 150 | checksum = "ed570934406eb16438a4e976b1b4500774099c13b8cb96eec99f620f05090ddf" 151 | 152 | [[package]] 153 | name = "bytes" 154 | version = "1.5.0" 155 | source = "registry+https://github.com/rust-lang/crates.io-index" 156 | checksum = "a2bd12c1caf447e69cd4528f47f94d203fd2582878ecb9e9465484c4148a8223" 157 | 158 | [[package]] 159 | name = "calculator" 160 | version = "0.1.0" 161 | dependencies = [ 162 | "tokio", 163 | "tonic", 164 | "tonic-build", 165 | "tonic-reflection", 166 | "tonic-web", 167 | "tower-http", 168 | ] 169 | 170 | [[package]] 171 | name = "cc" 172 | version = "1.0.83" 173 | source = "registry+https://github.com/rust-lang/crates.io-index" 174 | checksum = "f1174fb0b6ec23863f8b971027804a42614e347eafb0a95bf0b12cdae21fc4d0" 175 | dependencies = [ 176 | "libc", 177 | ] 178 | 179 | [[package]] 180 | name = "cfg-if" 181 | version = "1.0.0" 182 | source = "registry+https://github.com/rust-lang/crates.io-index" 183 | checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" 184 | 185 | [[package]] 186 | name = "either" 187 | version = "1.10.0" 188 | source = "registry+https://github.com/rust-lang/crates.io-index" 189 | checksum = "11157ac094ffbdde99aa67b23417ebdd801842852b500e395a45a9c0aac03e4a" 190 | 191 | [[package]] 192 | name = "equivalent" 193 | version = "1.0.1" 194 | source = "registry+https://github.com/rust-lang/crates.io-index" 195 | checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" 196 | 197 | [[package]] 198 | name = "errno" 199 | version = "0.3.8" 200 | source = "registry+https://github.com/rust-lang/crates.io-index" 201 | checksum = "a258e46cdc063eb8519c00b9fc845fc47bcfca4130e2f08e88665ceda8474245" 202 | dependencies = [ 203 | "libc", 204 | "windows-sys 0.52.0", 205 | ] 206 | 207 | [[package]] 208 | name = "fastrand" 209 | version = "2.0.1" 210 | source = "registry+https://github.com/rust-lang/crates.io-index" 211 | checksum = "25cbce373ec4653f1a01a31e8a5e5ec0c622dc27ff9c4e6606eefef5cbbed4a5" 212 | 213 | [[package]] 214 | name = "fixedbitset" 215 | version = "0.4.2" 216 | source = "registry+https://github.com/rust-lang/crates.io-index" 217 | checksum = "0ce7134b9999ecaf8bcd65542e436736ef32ddca1b3e06094cb6ec5755203b80" 218 | 219 | [[package]] 220 | name = "fnv" 221 | version = "1.0.7" 222 | source = "registry+https://github.com/rust-lang/crates.io-index" 223 | checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" 224 | 225 | [[package]] 226 | name = "futures-channel" 227 | version = "0.3.30" 228 | source = "registry+https://github.com/rust-lang/crates.io-index" 229 | checksum = "eac8f7d7865dcb88bd4373ab671c8cf4508703796caa2b1985a9ca867b3fcb78" 230 | dependencies = [ 231 | "futures-core", 232 | ] 233 | 234 | [[package]] 235 | name = "futures-core" 236 | version = "0.3.30" 237 | source = "registry+https://github.com/rust-lang/crates.io-index" 238 | checksum = "dfc6580bb841c5a68e9ef15c77ccc837b40a7504914d52e47b8b0e9bbda25a1d" 239 | 240 | [[package]] 241 | name = "futures-sink" 242 | version = "0.3.30" 243 | source = "registry+https://github.com/rust-lang/crates.io-index" 244 | checksum = "9fb8e00e87438d937621c1c6269e53f536c14d3fbd6a042bb24879e57d474fb5" 245 | 246 | [[package]] 247 | name = "futures-task" 248 | version = "0.3.30" 249 | source = "registry+https://github.com/rust-lang/crates.io-index" 250 | checksum = "38d84fa142264698cdce1a9f9172cf383a0c82de1bddcf3092901442c4097004" 251 | 252 | [[package]] 253 | name = "futures-util" 254 | version = "0.3.30" 255 | source = "registry+https://github.com/rust-lang/crates.io-index" 256 | checksum = "3d6401deb83407ab3da39eba7e33987a73c3df0c82b4bb5813ee871c19c41d48" 257 | dependencies = [ 258 | "futures-core", 259 | "futures-task", 260 | "pin-project-lite", 261 | "pin-utils", 262 | ] 263 | 264 | [[package]] 265 | name = "getrandom" 266 | version = "0.2.12" 267 | source = "registry+https://github.com/rust-lang/crates.io-index" 268 | checksum = "190092ea657667030ac6a35e305e62fc4dd69fd98ac98631e5d3a2b1575a12b5" 269 | dependencies = [ 270 | "cfg-if", 271 | "libc", 272 | "wasi", 273 | ] 274 | 275 | [[package]] 276 | name = "gimli" 277 | version = "0.28.1" 278 | source = "registry+https://github.com/rust-lang/crates.io-index" 279 | checksum = "4271d37baee1b8c7e4b708028c57d816cf9d2434acb33a549475f78c181f6253" 280 | 281 | [[package]] 282 | name = "h2" 283 | version = "0.3.24" 284 | source = "registry+https://github.com/rust-lang/crates.io-index" 285 | checksum = "bb2c4422095b67ee78da96fbb51a4cc413b3b25883c7717ff7ca1ab31022c9c9" 286 | dependencies = [ 287 | "bytes", 288 | "fnv", 289 | "futures-core", 290 | "futures-sink", 291 | "futures-util", 292 | "http", 293 | "indexmap 2.2.3", 294 | "slab", 295 | "tokio", 296 | "tokio-util", 297 | "tracing", 298 | ] 299 | 300 | [[package]] 301 | name = "hashbrown" 302 | version = "0.12.3" 303 | source = "registry+https://github.com/rust-lang/crates.io-index" 304 | checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" 305 | 306 | [[package]] 307 | name = "hashbrown" 308 | version = "0.14.3" 309 | source = "registry+https://github.com/rust-lang/crates.io-index" 310 | checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" 311 | 312 | [[package]] 313 | name = "heck" 314 | version = "0.4.1" 315 | source = "registry+https://github.com/rust-lang/crates.io-index" 316 | checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" 317 | 318 | [[package]] 319 | name = "hermit-abi" 320 | version = "0.3.6" 321 | source = "registry+https://github.com/rust-lang/crates.io-index" 322 | checksum = "bd5256b483761cd23699d0da46cc6fd2ee3be420bbe6d020ae4a091e70b7e9fd" 323 | 324 | [[package]] 325 | name = "home" 326 | version = "0.5.9" 327 | source = "registry+https://github.com/rust-lang/crates.io-index" 328 | checksum = "e3d1354bf6b7235cb4a0576c2619fd4ed18183f689b12b006a0ee7329eeff9a5" 329 | dependencies = [ 330 | "windows-sys 0.52.0", 331 | ] 332 | 333 | [[package]] 334 | name = "http" 335 | version = "0.2.11" 336 | source = "registry+https://github.com/rust-lang/crates.io-index" 337 | checksum = "8947b1a6fad4393052c7ba1f4cd97bed3e953a95c79c92ad9b051a04611d9fbb" 338 | dependencies = [ 339 | "bytes", 340 | "fnv", 341 | "itoa", 342 | ] 343 | 344 | [[package]] 345 | name = "http-body" 346 | version = "0.4.6" 347 | source = "registry+https://github.com/rust-lang/crates.io-index" 348 | checksum = "7ceab25649e9960c0311ea418d17bee82c0dcec1bd053b5f9a66e265a693bed2" 349 | dependencies = [ 350 | "bytes", 351 | "http", 352 | "pin-project-lite", 353 | ] 354 | 355 | [[package]] 356 | name = "http-range-header" 357 | version = "0.3.1" 358 | source = "registry+https://github.com/rust-lang/crates.io-index" 359 | checksum = "add0ab9360ddbd88cfeb3bd9574a1d85cfdfa14db10b3e21d3700dbc4328758f" 360 | 361 | [[package]] 362 | name = "httparse" 363 | version = "1.8.0" 364 | source = "registry+https://github.com/rust-lang/crates.io-index" 365 | checksum = "d897f394bad6a705d5f4104762e116a75639e470d80901eed05a860a95cb1904" 366 | 367 | [[package]] 368 | name = "httpdate" 369 | version = "1.0.3" 370 | source = "registry+https://github.com/rust-lang/crates.io-index" 371 | checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9" 372 | 373 | [[package]] 374 | name = "hyper" 375 | version = "0.14.28" 376 | source = "registry+https://github.com/rust-lang/crates.io-index" 377 | checksum = "bf96e135eb83a2a8ddf766e426a841d8ddd7449d5f00d34ea02b41d2f19eef80" 378 | dependencies = [ 379 | "bytes", 380 | "futures-channel", 381 | "futures-core", 382 | "futures-util", 383 | "h2", 384 | "http", 385 | "http-body", 386 | "httparse", 387 | "httpdate", 388 | "itoa", 389 | "pin-project-lite", 390 | "socket2", 391 | "tokio", 392 | "tower-service", 393 | "tracing", 394 | "want", 395 | ] 396 | 397 | [[package]] 398 | name = "hyper-timeout" 399 | version = "0.4.1" 400 | source = "registry+https://github.com/rust-lang/crates.io-index" 401 | checksum = "bbb958482e8c7be4bc3cf272a766a2b0bf1a6755e7a6ae777f017a31d11b13b1" 402 | dependencies = [ 403 | "hyper", 404 | "pin-project-lite", 405 | "tokio", 406 | "tokio-io-timeout", 407 | ] 408 | 409 | [[package]] 410 | name = "indexmap" 411 | version = "1.9.3" 412 | source = "registry+https://github.com/rust-lang/crates.io-index" 413 | checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99" 414 | dependencies = [ 415 | "autocfg", 416 | "hashbrown 0.12.3", 417 | ] 418 | 419 | [[package]] 420 | name = "indexmap" 421 | version = "2.2.3" 422 | source = "registry+https://github.com/rust-lang/crates.io-index" 423 | checksum = "233cf39063f058ea2caae4091bf4a3ef70a653afbc026f5c4a4135d114e3c177" 424 | dependencies = [ 425 | "equivalent", 426 | "hashbrown 0.14.3", 427 | ] 428 | 429 | [[package]] 430 | name = "itertools" 431 | version = "0.11.0" 432 | source = "registry+https://github.com/rust-lang/crates.io-index" 433 | checksum = "b1c173a5686ce8bfa551b3563d0c2170bf24ca44da99c7ca4bfdab5418c3fe57" 434 | dependencies = [ 435 | "either", 436 | ] 437 | 438 | [[package]] 439 | name = "itoa" 440 | version = "1.0.10" 441 | source = "registry+https://github.com/rust-lang/crates.io-index" 442 | checksum = "b1a46d1a171d865aa5f83f92695765caa047a9b4cbae2cbf37dbd613a793fd4c" 443 | 444 | [[package]] 445 | name = "libc" 446 | version = "0.2.153" 447 | source = "registry+https://github.com/rust-lang/crates.io-index" 448 | checksum = "9c198f91728a82281a64e1f4f9eeb25d82cb32a5de251c6bd1b5154d63a8e7bd" 449 | 450 | [[package]] 451 | name = "linux-raw-sys" 452 | version = "0.4.13" 453 | source = "registry+https://github.com/rust-lang/crates.io-index" 454 | checksum = "01cda141df6706de531b6c46c3a33ecca755538219bd484262fa09410c13539c" 455 | 456 | [[package]] 457 | name = "lock_api" 458 | version = "0.4.11" 459 | source = "registry+https://github.com/rust-lang/crates.io-index" 460 | checksum = "3c168f8615b12bc01f9c17e2eb0cc07dcae1940121185446edc3744920e8ef45" 461 | dependencies = [ 462 | "autocfg", 463 | "scopeguard", 464 | ] 465 | 466 | [[package]] 467 | name = "log" 468 | version = "0.4.20" 469 | source = "registry+https://github.com/rust-lang/crates.io-index" 470 | checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f" 471 | 472 | [[package]] 473 | name = "matchit" 474 | version = "0.7.3" 475 | source = "registry+https://github.com/rust-lang/crates.io-index" 476 | checksum = "0e7465ac9959cc2b1404e8e2367b43684a6d13790fe23056cc8c6c5a6b7bcb94" 477 | 478 | [[package]] 479 | name = "memchr" 480 | version = "2.7.1" 481 | source = "registry+https://github.com/rust-lang/crates.io-index" 482 | checksum = "523dc4f511e55ab87b694dc30d0f820d60906ef06413f93d4d7a1385599cc149" 483 | 484 | [[package]] 485 | name = "mime" 486 | version = "0.3.17" 487 | source = "registry+https://github.com/rust-lang/crates.io-index" 488 | checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" 489 | 490 | [[package]] 491 | name = "miniz_oxide" 492 | version = "0.7.2" 493 | source = "registry+https://github.com/rust-lang/crates.io-index" 494 | checksum = "9d811f3e15f28568be3407c8e7fdb6514c1cda3cb30683f15b6a1a1dc4ea14a7" 495 | dependencies = [ 496 | "adler", 497 | ] 498 | 499 | [[package]] 500 | name = "mio" 501 | version = "0.8.10" 502 | source = "registry+https://github.com/rust-lang/crates.io-index" 503 | checksum = "8f3d0b296e374a4e6f3c7b0a1f5a51d748a0d34c85e7dc48fc3fa9a87657fe09" 504 | dependencies = [ 505 | "libc", 506 | "wasi", 507 | "windows-sys 0.48.0", 508 | ] 509 | 510 | [[package]] 511 | name = "multimap" 512 | version = "0.8.3" 513 | source = "registry+https://github.com/rust-lang/crates.io-index" 514 | checksum = "e5ce46fe64a9d73be07dcbe690a38ce1b293be448fd8ce1e6c1b8062c9f72c6a" 515 | 516 | [[package]] 517 | name = "num_cpus" 518 | version = "1.16.0" 519 | source = "registry+https://github.com/rust-lang/crates.io-index" 520 | checksum = "4161fcb6d602d4d2081af7c3a45852d875a03dd337a6bfdd6e06407b61342a43" 521 | dependencies = [ 522 | "hermit-abi", 523 | "libc", 524 | ] 525 | 526 | [[package]] 527 | name = "object" 528 | version = "0.32.2" 529 | source = "registry+https://github.com/rust-lang/crates.io-index" 530 | checksum = "a6a622008b6e321afc04970976f62ee297fdbaa6f95318ca343e3eebb9648441" 531 | dependencies = [ 532 | "memchr", 533 | ] 534 | 535 | [[package]] 536 | name = "once_cell" 537 | version = "1.19.0" 538 | source = "registry+https://github.com/rust-lang/crates.io-index" 539 | checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" 540 | 541 | [[package]] 542 | name = "parking_lot" 543 | version = "0.12.1" 544 | source = "registry+https://github.com/rust-lang/crates.io-index" 545 | checksum = "3742b2c103b9f06bc9fff0a37ff4912935851bee6d36f3c02bcc755bcfec228f" 546 | dependencies = [ 547 | "lock_api", 548 | "parking_lot_core", 549 | ] 550 | 551 | [[package]] 552 | name = "parking_lot_core" 553 | version = "0.9.9" 554 | source = "registry+https://github.com/rust-lang/crates.io-index" 555 | checksum = "4c42a9226546d68acdd9c0a280d17ce19bfe27a46bf68784e4066115788d008e" 556 | dependencies = [ 557 | "cfg-if", 558 | "libc", 559 | "redox_syscall", 560 | "smallvec", 561 | "windows-targets 0.48.5", 562 | ] 563 | 564 | [[package]] 565 | name = "percent-encoding" 566 | version = "2.3.1" 567 | source = "registry+https://github.com/rust-lang/crates.io-index" 568 | checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" 569 | 570 | [[package]] 571 | name = "petgraph" 572 | version = "0.6.4" 573 | source = "registry+https://github.com/rust-lang/crates.io-index" 574 | checksum = "e1d3afd2628e69da2be385eb6f2fd57c8ac7977ceeff6dc166ff1657b0e386a9" 575 | dependencies = [ 576 | "fixedbitset", 577 | "indexmap 2.2.3", 578 | ] 579 | 580 | [[package]] 581 | name = "pin-project" 582 | version = "1.1.4" 583 | source = "registry+https://github.com/rust-lang/crates.io-index" 584 | checksum = "0302c4a0442c456bd56f841aee5c3bfd17967563f6fadc9ceb9f9c23cf3807e0" 585 | dependencies = [ 586 | "pin-project-internal", 587 | ] 588 | 589 | [[package]] 590 | name = "pin-project-internal" 591 | version = "1.1.4" 592 | source = "registry+https://github.com/rust-lang/crates.io-index" 593 | checksum = "266c042b60c9c76b8d53061e52b2e0d1116abc57cefc8c5cd671619a56ac3690" 594 | dependencies = [ 595 | "proc-macro2", 596 | "quote", 597 | "syn", 598 | ] 599 | 600 | [[package]] 601 | name = "pin-project-lite" 602 | version = "0.2.13" 603 | source = "registry+https://github.com/rust-lang/crates.io-index" 604 | checksum = "8afb450f006bf6385ca15ef45d71d2288452bc3683ce2e2cacc0d18e4be60b58" 605 | 606 | [[package]] 607 | name = "pin-utils" 608 | version = "0.1.0" 609 | source = "registry+https://github.com/rust-lang/crates.io-index" 610 | checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" 611 | 612 | [[package]] 613 | name = "ppv-lite86" 614 | version = "0.2.17" 615 | source = "registry+https://github.com/rust-lang/crates.io-index" 616 | checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" 617 | 618 | [[package]] 619 | name = "prettyplease" 620 | version = "0.2.16" 621 | source = "registry+https://github.com/rust-lang/crates.io-index" 622 | checksum = "a41cf62165e97c7f814d2221421dbb9afcbcdb0a88068e5ea206e19951c2cbb5" 623 | dependencies = [ 624 | "proc-macro2", 625 | "syn", 626 | ] 627 | 628 | [[package]] 629 | name = "proc-macro2" 630 | version = "1.0.78" 631 | source = "registry+https://github.com/rust-lang/crates.io-index" 632 | checksum = "e2422ad645d89c99f8f3e6b88a9fdeca7fabeac836b1002371c4367c8f984aae" 633 | dependencies = [ 634 | "unicode-ident", 635 | ] 636 | 637 | [[package]] 638 | name = "prost" 639 | version = "0.12.3" 640 | source = "registry+https://github.com/rust-lang/crates.io-index" 641 | checksum = "146c289cda302b98a28d40c8b3b90498d6e526dd24ac2ecea73e4e491685b94a" 642 | dependencies = [ 643 | "bytes", 644 | "prost-derive", 645 | ] 646 | 647 | [[package]] 648 | name = "prost-build" 649 | version = "0.12.3" 650 | source = "registry+https://github.com/rust-lang/crates.io-index" 651 | checksum = "c55e02e35260070b6f716a2423c2ff1c3bb1642ddca6f99e1f26d06268a0e2d2" 652 | dependencies = [ 653 | "bytes", 654 | "heck", 655 | "itertools", 656 | "log", 657 | "multimap", 658 | "once_cell", 659 | "petgraph", 660 | "prettyplease", 661 | "prost", 662 | "prost-types", 663 | "regex", 664 | "syn", 665 | "tempfile", 666 | "which", 667 | ] 668 | 669 | [[package]] 670 | name = "prost-derive" 671 | version = "0.12.3" 672 | source = "registry+https://github.com/rust-lang/crates.io-index" 673 | checksum = "efb6c9a1dd1def8e2124d17e83a20af56f1570d6c2d2bd9e266ccb768df3840e" 674 | dependencies = [ 675 | "anyhow", 676 | "itertools", 677 | "proc-macro2", 678 | "quote", 679 | "syn", 680 | ] 681 | 682 | [[package]] 683 | name = "prost-types" 684 | version = "0.12.3" 685 | source = "registry+https://github.com/rust-lang/crates.io-index" 686 | checksum = "193898f59edcf43c26227dcd4c8427f00d99d61e95dcde58dabd49fa291d470e" 687 | dependencies = [ 688 | "prost", 689 | ] 690 | 691 | [[package]] 692 | name = "quote" 693 | version = "1.0.35" 694 | source = "registry+https://github.com/rust-lang/crates.io-index" 695 | checksum = "291ec9ab5efd934aaf503a6466c5d5251535d108ee747472c3977cc5acc868ef" 696 | dependencies = [ 697 | "proc-macro2", 698 | ] 699 | 700 | [[package]] 701 | name = "rand" 702 | version = "0.8.5" 703 | source = "registry+https://github.com/rust-lang/crates.io-index" 704 | checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" 705 | dependencies = [ 706 | "libc", 707 | "rand_chacha", 708 | "rand_core", 709 | ] 710 | 711 | [[package]] 712 | name = "rand_chacha" 713 | version = "0.3.1" 714 | source = "registry+https://github.com/rust-lang/crates.io-index" 715 | checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" 716 | dependencies = [ 717 | "ppv-lite86", 718 | "rand_core", 719 | ] 720 | 721 | [[package]] 722 | name = "rand_core" 723 | version = "0.6.4" 724 | source = "registry+https://github.com/rust-lang/crates.io-index" 725 | checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" 726 | dependencies = [ 727 | "getrandom", 728 | ] 729 | 730 | [[package]] 731 | name = "redox_syscall" 732 | version = "0.4.1" 733 | source = "registry+https://github.com/rust-lang/crates.io-index" 734 | checksum = "4722d768eff46b75989dd134e5c353f0d6296e5aaa3132e776cbdb56be7731aa" 735 | dependencies = [ 736 | "bitflags 1.3.2", 737 | ] 738 | 739 | [[package]] 740 | name = "regex" 741 | version = "1.10.3" 742 | source = "registry+https://github.com/rust-lang/crates.io-index" 743 | checksum = "b62dbe01f0b06f9d8dc7d49e05a0785f153b00b2c227856282f671e0318c9b15" 744 | dependencies = [ 745 | "aho-corasick", 746 | "memchr", 747 | "regex-automata", 748 | "regex-syntax", 749 | ] 750 | 751 | [[package]] 752 | name = "regex-automata" 753 | version = "0.4.5" 754 | source = "registry+https://github.com/rust-lang/crates.io-index" 755 | checksum = "5bb987efffd3c6d0d8f5f89510bb458559eab11e4f869acb20bf845e016259cd" 756 | dependencies = [ 757 | "aho-corasick", 758 | "memchr", 759 | "regex-syntax", 760 | ] 761 | 762 | [[package]] 763 | name = "regex-syntax" 764 | version = "0.8.2" 765 | source = "registry+https://github.com/rust-lang/crates.io-index" 766 | checksum = "c08c74e62047bb2de4ff487b251e4a92e24f48745648451635cec7d591162d9f" 767 | 768 | [[package]] 769 | name = "rustc-demangle" 770 | version = "0.1.23" 771 | source = "registry+https://github.com/rust-lang/crates.io-index" 772 | checksum = "d626bb9dae77e28219937af045c257c28bfd3f69333c512553507f5f9798cb76" 773 | 774 | [[package]] 775 | name = "rustix" 776 | version = "0.38.31" 777 | source = "registry+https://github.com/rust-lang/crates.io-index" 778 | checksum = "6ea3e1a662af26cd7a3ba09c0297a31af215563ecf42817c98df621387f4e949" 779 | dependencies = [ 780 | "bitflags 2.4.2", 781 | "errno", 782 | "libc", 783 | "linux-raw-sys", 784 | "windows-sys 0.52.0", 785 | ] 786 | 787 | [[package]] 788 | name = "rustversion" 789 | version = "1.0.14" 790 | source = "registry+https://github.com/rust-lang/crates.io-index" 791 | checksum = "7ffc183a10b4478d04cbbbfc96d0873219d962dd5accaff2ffbd4ceb7df837f4" 792 | 793 | [[package]] 794 | name = "scopeguard" 795 | version = "1.2.0" 796 | source = "registry+https://github.com/rust-lang/crates.io-index" 797 | checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" 798 | 799 | [[package]] 800 | name = "serde" 801 | version = "1.0.196" 802 | source = "registry+https://github.com/rust-lang/crates.io-index" 803 | checksum = "870026e60fa08c69f064aa766c10f10b1d62db9ccd4d0abb206472bee0ce3b32" 804 | dependencies = [ 805 | "serde_derive", 806 | ] 807 | 808 | [[package]] 809 | name = "serde_derive" 810 | version = "1.0.196" 811 | source = "registry+https://github.com/rust-lang/crates.io-index" 812 | checksum = "33c85360c95e7d137454dc81d9a4ed2b8efd8fbe19cee57357b32b9771fccb67" 813 | dependencies = [ 814 | "proc-macro2", 815 | "quote", 816 | "syn", 817 | ] 818 | 819 | [[package]] 820 | name = "signal-hook-registry" 821 | version = "1.4.1" 822 | source = "registry+https://github.com/rust-lang/crates.io-index" 823 | checksum = "d8229b473baa5980ac72ef434c4415e70c4b5e71b423043adb4ba059f89c99a1" 824 | dependencies = [ 825 | "libc", 826 | ] 827 | 828 | [[package]] 829 | name = "slab" 830 | version = "0.4.9" 831 | source = "registry+https://github.com/rust-lang/crates.io-index" 832 | checksum = "8f92a496fb766b417c996b9c5e57daf2f7ad3b0bebe1ccfca4856390e3d3bb67" 833 | dependencies = [ 834 | "autocfg", 835 | ] 836 | 837 | [[package]] 838 | name = "smallvec" 839 | version = "1.13.1" 840 | source = "registry+https://github.com/rust-lang/crates.io-index" 841 | checksum = "e6ecd384b10a64542d77071bd64bd7b231f4ed5940fba55e98c3de13824cf3d7" 842 | 843 | [[package]] 844 | name = "socket2" 845 | version = "0.5.5" 846 | source = "registry+https://github.com/rust-lang/crates.io-index" 847 | checksum = "7b5fac59a5cb5dd637972e5fca70daf0523c9067fcdc4842f053dae04a18f8e9" 848 | dependencies = [ 849 | "libc", 850 | "windows-sys 0.48.0", 851 | ] 852 | 853 | [[package]] 854 | name = "syn" 855 | version = "2.0.48" 856 | source = "registry+https://github.com/rust-lang/crates.io-index" 857 | checksum = "0f3531638e407dfc0814761abb7c00a5b54992b849452a0646b7f65c9f770f3f" 858 | dependencies = [ 859 | "proc-macro2", 860 | "quote", 861 | "unicode-ident", 862 | ] 863 | 864 | [[package]] 865 | name = "sync_wrapper" 866 | version = "0.1.2" 867 | source = "registry+https://github.com/rust-lang/crates.io-index" 868 | checksum = "2047c6ded9c721764247e62cd3b03c09ffc529b2ba5b10ec482ae507a4a70160" 869 | 870 | [[package]] 871 | name = "tempfile" 872 | version = "3.10.0" 873 | source = "registry+https://github.com/rust-lang/crates.io-index" 874 | checksum = "a365e8cd18e44762ef95d87f284f4b5cd04107fec2ff3052bd6a3e6069669e67" 875 | dependencies = [ 876 | "cfg-if", 877 | "fastrand", 878 | "rustix", 879 | "windows-sys 0.52.0", 880 | ] 881 | 882 | [[package]] 883 | name = "tokio" 884 | version = "1.36.0" 885 | source = "registry+https://github.com/rust-lang/crates.io-index" 886 | checksum = "61285f6515fa018fb2d1e46eb21223fff441ee8db5d0f1435e8ab4f5cdb80931" 887 | dependencies = [ 888 | "backtrace", 889 | "bytes", 890 | "libc", 891 | "mio", 892 | "num_cpus", 893 | "parking_lot", 894 | "pin-project-lite", 895 | "signal-hook-registry", 896 | "socket2", 897 | "tokio-macros", 898 | "windows-sys 0.48.0", 899 | ] 900 | 901 | [[package]] 902 | name = "tokio-io-timeout" 903 | version = "1.2.0" 904 | source = "registry+https://github.com/rust-lang/crates.io-index" 905 | checksum = "30b74022ada614a1b4834de765f9bb43877f910cc8ce4be40e89042c9223a8bf" 906 | dependencies = [ 907 | "pin-project-lite", 908 | "tokio", 909 | ] 910 | 911 | [[package]] 912 | name = "tokio-macros" 913 | version = "2.2.0" 914 | source = "registry+https://github.com/rust-lang/crates.io-index" 915 | checksum = "5b8a1e28f2deaa14e508979454cb3a223b10b938b45af148bc0986de36f1923b" 916 | dependencies = [ 917 | "proc-macro2", 918 | "quote", 919 | "syn", 920 | ] 921 | 922 | [[package]] 923 | name = "tokio-stream" 924 | version = "0.1.14" 925 | source = "registry+https://github.com/rust-lang/crates.io-index" 926 | checksum = "397c988d37662c7dda6d2208364a706264bf3d6138b11d436cbac0ad38832842" 927 | dependencies = [ 928 | "futures-core", 929 | "pin-project-lite", 930 | "tokio", 931 | ] 932 | 933 | [[package]] 934 | name = "tokio-util" 935 | version = "0.7.10" 936 | source = "registry+https://github.com/rust-lang/crates.io-index" 937 | checksum = "5419f34732d9eb6ee4c3578b7989078579b7f039cbbb9ca2c4da015749371e15" 938 | dependencies = [ 939 | "bytes", 940 | "futures-core", 941 | "futures-sink", 942 | "pin-project-lite", 943 | "tokio", 944 | "tracing", 945 | ] 946 | 947 | [[package]] 948 | name = "tonic" 949 | version = "0.11.0" 950 | source = "registry+https://github.com/rust-lang/crates.io-index" 951 | checksum = "76c4eb7a4e9ef9d4763600161f12f5070b92a578e1b634db88a6887844c91a13" 952 | dependencies = [ 953 | "async-stream", 954 | "async-trait", 955 | "axum", 956 | "base64", 957 | "bytes", 958 | "h2", 959 | "http", 960 | "http-body", 961 | "hyper", 962 | "hyper-timeout", 963 | "percent-encoding", 964 | "pin-project", 965 | "prost", 966 | "tokio", 967 | "tokio-stream", 968 | "tower", 969 | "tower-layer", 970 | "tower-service", 971 | "tracing", 972 | ] 973 | 974 | [[package]] 975 | name = "tonic-build" 976 | version = "0.11.0" 977 | source = "registry+https://github.com/rust-lang/crates.io-index" 978 | checksum = "be4ef6dd70a610078cb4e338a0f79d06bc759ff1b22d2120c2ff02ae264ba9c2" 979 | dependencies = [ 980 | "prettyplease", 981 | "proc-macro2", 982 | "prost-build", 983 | "quote", 984 | "syn", 985 | ] 986 | 987 | [[package]] 988 | name = "tonic-reflection" 989 | version = "0.11.0" 990 | source = "registry+https://github.com/rust-lang/crates.io-index" 991 | checksum = "548c227bd5c0fae5925812c4ec6c66ffcfced23ea370cb823f4d18f0fc1cb6a7" 992 | dependencies = [ 993 | "prost", 994 | "prost-types", 995 | "tokio", 996 | "tokio-stream", 997 | "tonic", 998 | ] 999 | 1000 | [[package]] 1001 | name = "tonic-web" 1002 | version = "0.11.0" 1003 | source = "registry+https://github.com/rust-lang/crates.io-index" 1004 | checksum = "dc3b0e1cedbf19fdfb78ef3d672cb9928e0a91a9cb4629cc0c916e8cff8aaaa1" 1005 | dependencies = [ 1006 | "base64", 1007 | "bytes", 1008 | "http", 1009 | "http-body", 1010 | "hyper", 1011 | "pin-project", 1012 | "tokio-stream", 1013 | "tonic", 1014 | "tower-http", 1015 | "tower-layer", 1016 | "tower-service", 1017 | "tracing", 1018 | ] 1019 | 1020 | [[package]] 1021 | name = "tower" 1022 | version = "0.4.13" 1023 | source = "registry+https://github.com/rust-lang/crates.io-index" 1024 | checksum = "b8fa9be0de6cf49e536ce1851f987bd21a43b771b09473c3549a6c853db37c1c" 1025 | dependencies = [ 1026 | "futures-core", 1027 | "futures-util", 1028 | "indexmap 1.9.3", 1029 | "pin-project", 1030 | "pin-project-lite", 1031 | "rand", 1032 | "slab", 1033 | "tokio", 1034 | "tokio-util", 1035 | "tower-layer", 1036 | "tower-service", 1037 | "tracing", 1038 | ] 1039 | 1040 | [[package]] 1041 | name = "tower-http" 1042 | version = "0.4.4" 1043 | source = "registry+https://github.com/rust-lang/crates.io-index" 1044 | checksum = "61c5bb1d698276a2443e5ecfabc1008bf15a36c12e6a7176e7bf089ea9131140" 1045 | dependencies = [ 1046 | "bitflags 2.4.2", 1047 | "bytes", 1048 | "futures-core", 1049 | "futures-util", 1050 | "http", 1051 | "http-body", 1052 | "http-range-header", 1053 | "pin-project-lite", 1054 | "tower-layer", 1055 | "tower-service", 1056 | ] 1057 | 1058 | [[package]] 1059 | name = "tower-layer" 1060 | version = "0.3.2" 1061 | source = "registry+https://github.com/rust-lang/crates.io-index" 1062 | checksum = "c20c8dbed6283a09604c3e69b4b7eeb54e298b8a600d4d5ecb5ad39de609f1d0" 1063 | 1064 | [[package]] 1065 | name = "tower-service" 1066 | version = "0.3.2" 1067 | source = "registry+https://github.com/rust-lang/crates.io-index" 1068 | checksum = "b6bc1c9ce2b5135ac7f93c72918fc37feb872bdc6a5533a8b85eb4b86bfdae52" 1069 | 1070 | [[package]] 1071 | name = "tracing" 1072 | version = "0.1.40" 1073 | source = "registry+https://github.com/rust-lang/crates.io-index" 1074 | checksum = "c3523ab5a71916ccf420eebdf5521fcef02141234bbc0b8a49f2fdc4544364ef" 1075 | dependencies = [ 1076 | "pin-project-lite", 1077 | "tracing-attributes", 1078 | "tracing-core", 1079 | ] 1080 | 1081 | [[package]] 1082 | name = "tracing-attributes" 1083 | version = "0.1.27" 1084 | source = "registry+https://github.com/rust-lang/crates.io-index" 1085 | checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" 1086 | dependencies = [ 1087 | "proc-macro2", 1088 | "quote", 1089 | "syn", 1090 | ] 1091 | 1092 | [[package]] 1093 | name = "tracing-core" 1094 | version = "0.1.32" 1095 | source = "registry+https://github.com/rust-lang/crates.io-index" 1096 | checksum = "c06d3da6113f116aaee68e4d601191614c9053067f9ab7f6edbcb161237daa54" 1097 | dependencies = [ 1098 | "once_cell", 1099 | ] 1100 | 1101 | [[package]] 1102 | name = "try-lock" 1103 | version = "0.2.5" 1104 | source = "registry+https://github.com/rust-lang/crates.io-index" 1105 | checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b" 1106 | 1107 | [[package]] 1108 | name = "unicode-ident" 1109 | version = "1.0.12" 1110 | source = "registry+https://github.com/rust-lang/crates.io-index" 1111 | checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" 1112 | 1113 | [[package]] 1114 | name = "want" 1115 | version = "0.3.1" 1116 | source = "registry+https://github.com/rust-lang/crates.io-index" 1117 | checksum = "bfa7760aed19e106de2c7c0b581b509f2f25d3dacaf737cb82ac61bc6d760b0e" 1118 | dependencies = [ 1119 | "try-lock", 1120 | ] 1121 | 1122 | [[package]] 1123 | name = "wasi" 1124 | version = "0.11.0+wasi-snapshot-preview1" 1125 | source = "registry+https://github.com/rust-lang/crates.io-index" 1126 | checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" 1127 | 1128 | [[package]] 1129 | name = "which" 1130 | version = "4.4.2" 1131 | source = "registry+https://github.com/rust-lang/crates.io-index" 1132 | checksum = "87ba24419a2078cd2b0f2ede2691b6c66d8e47836da3b6db8265ebad47afbfc7" 1133 | dependencies = [ 1134 | "either", 1135 | "home", 1136 | "once_cell", 1137 | "rustix", 1138 | ] 1139 | 1140 | [[package]] 1141 | name = "windows-sys" 1142 | version = "0.48.0" 1143 | source = "registry+https://github.com/rust-lang/crates.io-index" 1144 | checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" 1145 | dependencies = [ 1146 | "windows-targets 0.48.5", 1147 | ] 1148 | 1149 | [[package]] 1150 | name = "windows-sys" 1151 | version = "0.52.0" 1152 | source = "registry+https://github.com/rust-lang/crates.io-index" 1153 | checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" 1154 | dependencies = [ 1155 | "windows-targets 0.52.0", 1156 | ] 1157 | 1158 | [[package]] 1159 | name = "windows-targets" 1160 | version = "0.48.5" 1161 | source = "registry+https://github.com/rust-lang/crates.io-index" 1162 | checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" 1163 | dependencies = [ 1164 | "windows_aarch64_gnullvm 0.48.5", 1165 | "windows_aarch64_msvc 0.48.5", 1166 | "windows_i686_gnu 0.48.5", 1167 | "windows_i686_msvc 0.48.5", 1168 | "windows_x86_64_gnu 0.48.5", 1169 | "windows_x86_64_gnullvm 0.48.5", 1170 | "windows_x86_64_msvc 0.48.5", 1171 | ] 1172 | 1173 | [[package]] 1174 | name = "windows-targets" 1175 | version = "0.52.0" 1176 | source = "registry+https://github.com/rust-lang/crates.io-index" 1177 | checksum = "8a18201040b24831fbb9e4eb208f8892e1f50a37feb53cc7ff887feb8f50e7cd" 1178 | dependencies = [ 1179 | "windows_aarch64_gnullvm 0.52.0", 1180 | "windows_aarch64_msvc 0.52.0", 1181 | "windows_i686_gnu 0.52.0", 1182 | "windows_i686_msvc 0.52.0", 1183 | "windows_x86_64_gnu 0.52.0", 1184 | "windows_x86_64_gnullvm 0.52.0", 1185 | "windows_x86_64_msvc 0.52.0", 1186 | ] 1187 | 1188 | [[package]] 1189 | name = "windows_aarch64_gnullvm" 1190 | version = "0.48.5" 1191 | source = "registry+https://github.com/rust-lang/crates.io-index" 1192 | checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" 1193 | 1194 | [[package]] 1195 | name = "windows_aarch64_gnullvm" 1196 | version = "0.52.0" 1197 | source = "registry+https://github.com/rust-lang/crates.io-index" 1198 | checksum = "cb7764e35d4db8a7921e09562a0304bf2f93e0a51bfccee0bd0bb0b666b015ea" 1199 | 1200 | [[package]] 1201 | name = "windows_aarch64_msvc" 1202 | version = "0.48.5" 1203 | source = "registry+https://github.com/rust-lang/crates.io-index" 1204 | checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" 1205 | 1206 | [[package]] 1207 | name = "windows_aarch64_msvc" 1208 | version = "0.52.0" 1209 | source = "registry+https://github.com/rust-lang/crates.io-index" 1210 | checksum = "bbaa0368d4f1d2aaefc55b6fcfee13f41544ddf36801e793edbbfd7d7df075ef" 1211 | 1212 | [[package]] 1213 | name = "windows_i686_gnu" 1214 | version = "0.48.5" 1215 | source = "registry+https://github.com/rust-lang/crates.io-index" 1216 | checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" 1217 | 1218 | [[package]] 1219 | name = "windows_i686_gnu" 1220 | version = "0.52.0" 1221 | source = "registry+https://github.com/rust-lang/crates.io-index" 1222 | checksum = "a28637cb1fa3560a16915793afb20081aba2c92ee8af57b4d5f28e4b3e7df313" 1223 | 1224 | [[package]] 1225 | name = "windows_i686_msvc" 1226 | version = "0.48.5" 1227 | source = "registry+https://github.com/rust-lang/crates.io-index" 1228 | checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" 1229 | 1230 | [[package]] 1231 | name = "windows_i686_msvc" 1232 | version = "0.52.0" 1233 | source = "registry+https://github.com/rust-lang/crates.io-index" 1234 | checksum = "ffe5e8e31046ce6230cc7215707b816e339ff4d4d67c65dffa206fd0f7aa7b9a" 1235 | 1236 | [[package]] 1237 | name = "windows_x86_64_gnu" 1238 | version = "0.48.5" 1239 | source = "registry+https://github.com/rust-lang/crates.io-index" 1240 | checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" 1241 | 1242 | [[package]] 1243 | name = "windows_x86_64_gnu" 1244 | version = "0.52.0" 1245 | source = "registry+https://github.com/rust-lang/crates.io-index" 1246 | checksum = "3d6fa32db2bc4a2f5abeacf2b69f7992cd09dca97498da74a151a3132c26befd" 1247 | 1248 | [[package]] 1249 | name = "windows_x86_64_gnullvm" 1250 | version = "0.48.5" 1251 | source = "registry+https://github.com/rust-lang/crates.io-index" 1252 | checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" 1253 | 1254 | [[package]] 1255 | name = "windows_x86_64_gnullvm" 1256 | version = "0.52.0" 1257 | source = "registry+https://github.com/rust-lang/crates.io-index" 1258 | checksum = "1a657e1e9d3f514745a572a6846d3c7aa7dbe1658c056ed9c3344c4109a6949e" 1259 | 1260 | [[package]] 1261 | name = "windows_x86_64_msvc" 1262 | version = "0.48.5" 1263 | source = "registry+https://github.com/rust-lang/crates.io-index" 1264 | checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" 1265 | 1266 | [[package]] 1267 | name = "windows_x86_64_msvc" 1268 | version = "0.52.0" 1269 | source = "registry+https://github.com/rust-lang/crates.io-index" 1270 | checksum = "dff9641d1cd4be8d1a070daf9e3773c5f67e78b4d9d42263020c057706765c04" 1271 | -------------------------------------------------------------------------------- /Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "calculator" 3 | version = "0.1.0" 4 | edition = "2021" 5 | 6 | # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html 7 | 8 | [dependencies] 9 | tonic = "0.11" 10 | tokio = { version = "1", features = ["full"] } 11 | tonic-reflection = "0.11" 12 | prost = "0.12.3" 13 | tonic-web = "0.11" 14 | tower-http = "0.4" 15 | 16 | [build-dependencies] 17 | tonic-build = "0.11" 18 | 19 | [[bin]] 20 | name = "server" 21 | path = "src/main.rs" 22 | 23 | [[bin]] 24 | name = "client" 25 | path = "src/client.rs" 26 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | GNU AFFERO GENERAL PUBLIC LICENSE 2 | Version 3, 19 November 2007 3 | 4 | Copyright (C) 2007 Free Software Foundation, Inc. 5 | Everyone is permitted to copy and distribute verbatim copies 6 | of this license document, but changing it is not allowed. 7 | 8 | Preamble 9 | 10 | The GNU Affero General Public License is a free, copyleft license for 11 | software and other kinds of works, specifically designed to ensure 12 | cooperation with the community in the case of network server software. 13 | 14 | The licenses for most software and other practical works are designed 15 | to take away your freedom to share and change the works. By contrast, 16 | our General Public Licenses are intended to guarantee your freedom to 17 | share and change all versions of a program--to make sure it remains free 18 | software for all its users. 19 | 20 | When we speak of free software, we are referring to freedom, not 21 | price. Our General Public Licenses are designed to make sure that you 22 | have the freedom to distribute copies of free software (and charge for 23 | them if you wish), that you receive source code or can get it if you 24 | want it, that you can change the software or use pieces of it in new 25 | free programs, and that you know you can do these things. 26 | 27 | Developers that use our General Public Licenses protect your rights 28 | with two steps: (1) assert copyright on the software, and (2) offer 29 | you this License which gives you legal permission to copy, distribute 30 | and/or modify the software. 31 | 32 | A secondary benefit of defending all users' freedom is that 33 | improvements made in alternate versions of the program, if they 34 | receive widespread use, become available for other developers to 35 | incorporate. Many developers of free software are heartened and 36 | encouraged by the resulting cooperation. However, in the case of 37 | software used on network servers, this result may fail to come about. 38 | The GNU General Public License permits making a modified version and 39 | letting the public access it on a server without ever releasing its 40 | source code to the public. 41 | 42 | The GNU Affero General Public License is designed specifically to 43 | ensure that, in such cases, the modified source code becomes available 44 | to the community. It requires the operator of a network server to 45 | provide the source code of the modified version running there to the 46 | users of that server. Therefore, public use of a modified version, on 47 | a publicly accessible server, gives the public access to the source 48 | code of the modified version. 49 | 50 | An older license, called the Affero General Public License and 51 | published by Affero, was designed to accomplish similar goals. This is 52 | a different license, not a version of the Affero GPL, but Affero has 53 | released a new version of the Affero GPL which permits relicensing under 54 | this license. 55 | 56 | The precise terms and conditions for copying, distribution and 57 | modification follow. 58 | 59 | TERMS AND CONDITIONS 60 | 61 | 0. Definitions. 62 | 63 | "This License" refers to version 3 of the GNU Affero General Public License. 64 | 65 | "Copyright" also means copyright-like laws that apply to other kinds of 66 | works, such as semiconductor masks. 67 | 68 | "The Program" refers to any copyrightable work licensed under this 69 | License. Each licensee is addressed as "you". "Licensees" and 70 | "recipients" may be individuals or organizations. 71 | 72 | To "modify" a work means to copy from or adapt all or part of the work 73 | in a fashion requiring copyright permission, other than the making of an 74 | exact copy. The resulting work is called a "modified version" of the 75 | earlier work or a work "based on" the earlier work. 76 | 77 | A "covered work" means either the unmodified Program or a work based 78 | on the Program. 79 | 80 | To "propagate" a work means to do anything with it that, without 81 | permission, would make you directly or secondarily liable for 82 | infringement under applicable copyright law, except executing it on a 83 | computer or modifying a private copy. Propagation includes copying, 84 | distribution (with or without modification), making available to the 85 | public, and in some countries other activities as well. 86 | 87 | To "convey" a work means any kind of propagation that enables other 88 | parties to make or receive copies. Mere interaction with a user through 89 | a computer network, with no transfer of a copy, is not conveying. 90 | 91 | An interactive user interface displays "Appropriate Legal Notices" 92 | to the extent that it includes a convenient and prominently visible 93 | feature that (1) displays an appropriate copyright notice, and (2) 94 | tells the user that there is no warranty for the work (except to the 95 | extent that warranties are provided), that licensees may convey the 96 | work under this License, and how to view a copy of this License. If 97 | the interface presents a list of user commands or options, such as a 98 | menu, a prominent item in the list meets this criterion. 99 | 100 | 1. Source Code. 101 | 102 | The "source code" for a work means the preferred form of the work 103 | for making modifications to it. "Object code" means any non-source 104 | form of a work. 105 | 106 | A "Standard Interface" means an interface that either is an official 107 | standard defined by a recognized standards body, or, in the case of 108 | interfaces specified for a particular programming language, one that 109 | is widely used among developers working in that language. 110 | 111 | The "System Libraries" of an executable work include anything, other 112 | than the work as a whole, that (a) is included in the normal form of 113 | packaging a Major Component, but which is not part of that Major 114 | Component, and (b) serves only to enable use of the work with that 115 | Major Component, or to implement a Standard Interface for which an 116 | implementation is available to the public in source code form. A 117 | "Major Component", in this context, means a major essential component 118 | (kernel, window system, and so on) of the specific operating system 119 | (if any) on which the executable work runs, or a compiler used to 120 | produce the work, or an object code interpreter used to run it. 121 | 122 | The "Corresponding Source" for a work in object code form means all 123 | the source code needed to generate, install, and (for an executable 124 | work) run the object code and to modify the work, including scripts to 125 | control those activities. However, it does not include the work's 126 | System Libraries, or general-purpose tools or generally available free 127 | programs which are used unmodified in performing those activities but 128 | which are not part of the work. For example, Corresponding Source 129 | includes interface definition files associated with source files for 130 | the work, and the source code for shared libraries and dynamically 131 | linked subprograms that the work is specifically designed to require, 132 | such as by intimate data communication or control flow between those 133 | subprograms and other parts of the work. 134 | 135 | The Corresponding Source need not include anything that users 136 | can regenerate automatically from other parts of the Corresponding 137 | Source. 138 | 139 | The Corresponding Source for a work in source code form is that 140 | same work. 141 | 142 | 2. Basic Permissions. 143 | 144 | All rights granted under this License are granted for the term of 145 | copyright on the Program, and are irrevocable provided the stated 146 | conditions are met. This License explicitly affirms your unlimited 147 | permission to run the unmodified Program. The output from running a 148 | covered work is covered by this License only if the output, given its 149 | content, constitutes a covered work. This License acknowledges your 150 | rights of fair use or other equivalent, as provided by copyright law. 151 | 152 | You may make, run and propagate covered works that you do not 153 | convey, without conditions so long as your license otherwise remains 154 | in force. You may convey covered works to others for the sole purpose 155 | of having them make modifications exclusively for you, or provide you 156 | with facilities for running those works, provided that you comply with 157 | the terms of this License in conveying all material for which you do 158 | not control copyright. Those thus making or running the covered works 159 | for you must do so exclusively on your behalf, under your direction 160 | and control, on terms that prohibit them from making any copies of 161 | your copyrighted material outside their relationship with you. 162 | 163 | Conveying under any other circumstances is permitted solely under 164 | the conditions stated below. Sublicensing is not allowed; section 10 165 | makes it unnecessary. 166 | 167 | 3. Protecting Users' Legal Rights From Anti-Circumvention Law. 168 | 169 | No covered work shall be deemed part of an effective technological 170 | measure under any applicable law fulfilling obligations under article 171 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or 172 | similar laws prohibiting or restricting circumvention of such 173 | measures. 174 | 175 | When you convey a covered work, you waive any legal power to forbid 176 | circumvention of technological measures to the extent such circumvention 177 | is effected by exercising rights under this License with respect to 178 | the covered work, and you disclaim any intention to limit operation or 179 | modification of the work as a means of enforcing, against the work's 180 | users, your or third parties' legal rights to forbid circumvention of 181 | technological measures. 182 | 183 | 4. Conveying Verbatim Copies. 184 | 185 | You may convey verbatim copies of the Program's source code as you 186 | receive it, in any medium, provided that you conspicuously and 187 | appropriately publish on each copy an appropriate copyright notice; 188 | keep intact all notices stating that this License and any 189 | non-permissive terms added in accord with section 7 apply to the code; 190 | keep intact all notices of the absence of any warranty; and give all 191 | recipients a copy of this License along with the Program. 192 | 193 | You may charge any price or no price for each copy that you convey, 194 | and you may offer support or warranty protection for a fee. 195 | 196 | 5. Conveying Modified Source Versions. 197 | 198 | You may convey a work based on the Program, or the modifications to 199 | produce it from the Program, in the form of source code under the 200 | terms of section 4, provided that you also meet all of these conditions: 201 | 202 | a) The work must carry prominent notices stating that you modified 203 | it, and giving a relevant date. 204 | 205 | b) The work must carry prominent notices stating that it is 206 | released under this License and any conditions added under section 207 | 7. This requirement modifies the requirement in section 4 to 208 | "keep intact all notices". 209 | 210 | c) You must license the entire work, as a whole, under this 211 | License to anyone who comes into possession of a copy. This 212 | License will therefore apply, along with any applicable section 7 213 | additional terms, to the whole of the work, and all its parts, 214 | regardless of how they are packaged. This License gives no 215 | permission to license the work in any other way, but it does not 216 | invalidate such permission if you have separately received it. 217 | 218 | d) If the work has interactive user interfaces, each must display 219 | Appropriate Legal Notices; however, if the Program has interactive 220 | interfaces that do not display Appropriate Legal Notices, your 221 | work need not make them do so. 222 | 223 | A compilation of a covered work with other separate and independent 224 | works, which are not by their nature extensions of the covered work, 225 | and which are not combined with it such as to form a larger program, 226 | in or on a volume of a storage or distribution medium, is called an 227 | "aggregate" if the compilation and its resulting copyright are not 228 | used to limit the access or legal rights of the compilation's users 229 | beyond what the individual works permit. Inclusion of a covered work 230 | in an aggregate does not cause this License to apply to the other 231 | parts of the aggregate. 232 | 233 | 6. Conveying Non-Source Forms. 234 | 235 | You may convey a covered work in object code form under the terms 236 | of sections 4 and 5, provided that you also convey the 237 | machine-readable Corresponding Source under the terms of this License, 238 | in one of these ways: 239 | 240 | a) Convey the object code in, or embodied in, a physical product 241 | (including a physical distribution medium), accompanied by the 242 | Corresponding Source fixed on a durable physical medium 243 | customarily used for software interchange. 244 | 245 | b) Convey the object code in, or embodied in, a physical product 246 | (including a physical distribution medium), accompanied by a 247 | written offer, valid for at least three years and valid for as 248 | long as you offer spare parts or customer support for that product 249 | model, to give anyone who possesses the object code either (1) a 250 | copy of the Corresponding Source for all the software in the 251 | product that is covered by this License, on a durable physical 252 | medium customarily used for software interchange, for a price no 253 | more than your reasonable cost of physically performing this 254 | conveying of source, or (2) access to copy the 255 | Corresponding Source from a network server at no charge. 256 | 257 | c) Convey individual copies of the object code with a copy of the 258 | written offer to provide the Corresponding Source. This 259 | alternative is allowed only occasionally and noncommercially, and 260 | only if you received the object code with such an offer, in accord 261 | with subsection 6b. 262 | 263 | d) Convey the object code by offering access from a designated 264 | place (gratis or for a charge), and offer equivalent access to the 265 | Corresponding Source in the same way through the same place at no 266 | further charge. You need not require recipients to copy the 267 | Corresponding Source along with the object code. If the place to 268 | copy the object code is a network server, the Corresponding Source 269 | may be on a different server (operated by you or a third party) 270 | that supports equivalent copying facilities, provided you maintain 271 | clear directions next to the object code saying where to find the 272 | Corresponding Source. Regardless of what server hosts the 273 | Corresponding Source, you remain obligated to ensure that it is 274 | available for as long as needed to satisfy these requirements. 275 | 276 | e) Convey the object code using peer-to-peer transmission, provided 277 | you inform other peers where the object code and Corresponding 278 | Source of the work are being offered to the general public at no 279 | charge under subsection 6d. 280 | 281 | A separable portion of the object code, whose source code is excluded 282 | from the Corresponding Source as a System Library, need not be 283 | included in conveying the object code work. 284 | 285 | A "User Product" is either (1) a "consumer product", which means any 286 | tangible personal property which is normally used for personal, family, 287 | or household purposes, or (2) anything designed or sold for incorporation 288 | into a dwelling. In determining whether a product is a consumer product, 289 | doubtful cases shall be resolved in favor of coverage. For a particular 290 | product received by a particular user, "normally used" refers to a 291 | typical or common use of that class of product, regardless of the status 292 | of the particular user or of the way in which the particular user 293 | actually uses, or expects or is expected to use, the product. A product 294 | is a consumer product regardless of whether the product has substantial 295 | commercial, industrial or non-consumer uses, unless such uses represent 296 | the only significant mode of use of the product. 297 | 298 | "Installation Information" for a User Product means any methods, 299 | procedures, authorization keys, or other information required to install 300 | and execute modified versions of a covered work in that User Product from 301 | a modified version of its Corresponding Source. The information must 302 | suffice to ensure that the continued functioning of the modified object 303 | code is in no case prevented or interfered with solely because 304 | modification has been made. 305 | 306 | If you convey an object code work under this section in, or with, or 307 | specifically for use in, a User Product, and the conveying occurs as 308 | part of a transaction in which the right of possession and use of the 309 | User Product is transferred to the recipient in perpetuity or for a 310 | fixed term (regardless of how the transaction is characterized), the 311 | Corresponding Source conveyed under this section must be accompanied 312 | by the Installation Information. But this requirement does not apply 313 | if neither you nor any third party retains the ability to install 314 | modified object code on the User Product (for example, the work has 315 | been installed in ROM). 316 | 317 | The requirement to provide Installation Information does not include a 318 | requirement to continue to provide support service, warranty, or updates 319 | for a work that has been modified or installed by the recipient, or for 320 | the User Product in which it has been modified or installed. Access to a 321 | network may be denied when the modification itself materially and 322 | adversely affects the operation of the network or violates the rules and 323 | protocols for communication across the network. 324 | 325 | Corresponding Source conveyed, and Installation Information provided, 326 | in accord with this section must be in a format that is publicly 327 | documented (and with an implementation available to the public in 328 | source code form), and must require no special password or key for 329 | unpacking, reading or copying. 330 | 331 | 7. Additional Terms. 332 | 333 | "Additional permissions" are terms that supplement the terms of this 334 | License by making exceptions from one or more of its conditions. 335 | Additional permissions that are applicable to the entire Program shall 336 | be treated as though they were included in this License, to the extent 337 | that they are valid under applicable law. If additional permissions 338 | apply only to part of the Program, that part may be used separately 339 | under those permissions, but the entire Program remains governed by 340 | this License without regard to the additional permissions. 341 | 342 | When you convey a copy of a covered work, you may at your option 343 | remove any additional permissions from that copy, or from any part of 344 | it. (Additional permissions may be written to require their own 345 | removal in certain cases when you modify the work.) You may place 346 | additional permissions on material, added by you to a covered work, 347 | for which you have or can give appropriate copyright permission. 348 | 349 | Notwithstanding any other provision of this License, for material you 350 | add to a covered work, you may (if authorized by the copyright holders of 351 | that material) supplement the terms of this License with terms: 352 | 353 | a) Disclaiming warranty or limiting liability differently from the 354 | terms of sections 15 and 16 of this License; or 355 | 356 | b) Requiring preservation of specified reasonable legal notices or 357 | author attributions in that material or in the Appropriate Legal 358 | Notices displayed by works containing it; or 359 | 360 | c) Prohibiting misrepresentation of the origin of that material, or 361 | requiring that modified versions of such material be marked in 362 | reasonable ways as different from the original version; or 363 | 364 | d) Limiting the use for publicity purposes of names of licensors or 365 | authors of the material; or 366 | 367 | e) Declining to grant rights under trademark law for use of some 368 | trade names, trademarks, or service marks; or 369 | 370 | f) Requiring indemnification of licensors and authors of that 371 | material by anyone who conveys the material (or modified versions of 372 | it) with contractual assumptions of liability to the recipient, for 373 | any liability that these contractual assumptions directly impose on 374 | those licensors and authors. 375 | 376 | All other non-permissive additional terms are considered "further 377 | restrictions" within the meaning of section 10. If the Program as you 378 | received it, or any part of it, contains a notice stating that it is 379 | governed by this License along with a term that is a further 380 | restriction, you may remove that term. If a license document contains 381 | a further restriction but permits relicensing or conveying under this 382 | License, you may add to a covered work material governed by the terms 383 | of that license document, provided that the further restriction does 384 | not survive such relicensing or conveying. 385 | 386 | If you add terms to a covered work in accord with this section, you 387 | must place, in the relevant source files, a statement of the 388 | additional terms that apply to those files, or a notice indicating 389 | where to find the applicable terms. 390 | 391 | Additional terms, permissive or non-permissive, may be stated in the 392 | form of a separately written license, or stated as exceptions; 393 | the above requirements apply either way. 394 | 395 | 8. Termination. 396 | 397 | You may not propagate or modify a covered work except as expressly 398 | provided under this License. Any attempt otherwise to propagate or 399 | modify it is void, and will automatically terminate your rights under 400 | this License (including any patent licenses granted under the third 401 | paragraph of section 11). 402 | 403 | However, if you cease all violation of this License, then your 404 | license from a particular copyright holder is reinstated (a) 405 | provisionally, unless and until the copyright holder explicitly and 406 | finally terminates your license, and (b) permanently, if the copyright 407 | holder fails to notify you of the violation by some reasonable means 408 | prior to 60 days after the cessation. 409 | 410 | Moreover, your license from a particular copyright holder is 411 | reinstated permanently if the copyright holder notifies you of the 412 | violation by some reasonable means, this is the first time you have 413 | received notice of violation of this License (for any work) from that 414 | copyright holder, and you cure the violation prior to 30 days after 415 | your receipt of the notice. 416 | 417 | Termination of your rights under this section does not terminate the 418 | licenses of parties who have received copies or rights from you under 419 | this License. If your rights have been terminated and not permanently 420 | reinstated, you do not qualify to receive new licenses for the same 421 | material under section 10. 422 | 423 | 9. Acceptance Not Required for Having Copies. 424 | 425 | You are not required to accept this License in order to receive or 426 | run a copy of the Program. Ancillary propagation of a covered work 427 | occurring solely as a consequence of using peer-to-peer transmission 428 | to receive a copy likewise does not require acceptance. However, 429 | nothing other than this License grants you permission to propagate or 430 | modify any covered work. These actions infringe copyright if you do 431 | not accept this License. Therefore, by modifying or propagating a 432 | covered work, you indicate your acceptance of this License to do so. 433 | 434 | 10. Automatic Licensing of Downstream Recipients. 435 | 436 | Each time you convey a covered work, the recipient automatically 437 | receives a license from the original licensors, to run, modify and 438 | propagate that work, subject to this License. You are not responsible 439 | for enforcing compliance by third parties with this License. 440 | 441 | An "entity transaction" is a transaction transferring control of an 442 | organization, or substantially all assets of one, or subdividing an 443 | organization, or merging organizations. If propagation of a covered 444 | work results from an entity transaction, each party to that 445 | transaction who receives a copy of the work also receives whatever 446 | licenses to the work the party's predecessor in interest had or could 447 | give under the previous paragraph, plus a right to possession of the 448 | Corresponding Source of the work from the predecessor in interest, if 449 | the predecessor has it or can get it with reasonable efforts. 450 | 451 | You may not impose any further restrictions on the exercise of the 452 | rights granted or affirmed under this License. For example, you may 453 | not impose a license fee, royalty, or other charge for exercise of 454 | rights granted under this License, and you may not initiate litigation 455 | (including a cross-claim or counterclaim in a lawsuit) alleging that 456 | any patent claim is infringed by making, using, selling, offering for 457 | sale, or importing the Program or any portion of it. 458 | 459 | 11. Patents. 460 | 461 | A "contributor" is a copyright holder who authorizes use under this 462 | License of the Program or a work on which the Program is based. The 463 | work thus licensed is called the contributor's "contributor version". 464 | 465 | A contributor's "essential patent claims" are all patent claims 466 | owned or controlled by the contributor, whether already acquired or 467 | hereafter acquired, that would be infringed by some manner, permitted 468 | by this License, of making, using, or selling its contributor version, 469 | but do not include claims that would be infringed only as a 470 | consequence of further modification of the contributor version. For 471 | purposes of this definition, "control" includes the right to grant 472 | patent sublicenses in a manner consistent with the requirements of 473 | this License. 474 | 475 | Each contributor grants you a non-exclusive, worldwide, royalty-free 476 | patent license under the contributor's essential patent claims, to 477 | make, use, sell, offer for sale, import and otherwise run, modify and 478 | propagate the contents of its contributor version. 479 | 480 | In the following three paragraphs, a "patent license" is any express 481 | agreement or commitment, however denominated, not to enforce a patent 482 | (such as an express permission to practice a patent or covenant not to 483 | sue for patent infringement). To "grant" such a patent license to a 484 | party means to make such an agreement or commitment not to enforce a 485 | patent against the party. 486 | 487 | If you convey a covered work, knowingly relying on a patent license, 488 | and the Corresponding Source of the work is not available for anyone 489 | to copy, free of charge and under the terms of this License, through a 490 | publicly available network server or other readily accessible means, 491 | then you must either (1) cause the Corresponding Source to be so 492 | available, or (2) arrange to deprive yourself of the benefit of the 493 | patent license for this particular work, or (3) arrange, in a manner 494 | consistent with the requirements of this License, to extend the patent 495 | license to downstream recipients. "Knowingly relying" means you have 496 | actual knowledge that, but for the patent license, your conveying the 497 | covered work in a country, or your recipient's use of the covered work 498 | in a country, would infringe one or more identifiable patents in that 499 | country that you have reason to believe are valid. 500 | 501 | If, pursuant to or in connection with a single transaction or 502 | arrangement, you convey, or propagate by procuring conveyance of, a 503 | covered work, and grant a patent license to some of the parties 504 | receiving the covered work authorizing them to use, propagate, modify 505 | or convey a specific copy of the covered work, then the patent license 506 | you grant is automatically extended to all recipients of the covered 507 | work and works based on it. 508 | 509 | A patent license is "discriminatory" if it does not include within 510 | the scope of its coverage, prohibits the exercise of, or is 511 | conditioned on the non-exercise of one or more of the rights that are 512 | specifically granted under this License. You may not convey a covered 513 | work if you are a party to an arrangement with a third party that is 514 | in the business of distributing software, under which you make payment 515 | to the third party based on the extent of your activity of conveying 516 | the work, and under which the third party grants, to any of the 517 | parties who would receive the covered work from you, a discriminatory 518 | patent license (a) in connection with copies of the covered work 519 | conveyed by you (or copies made from those copies), or (b) primarily 520 | for and in connection with specific products or compilations that 521 | contain the covered work, unless you entered into that arrangement, 522 | or that patent license was granted, prior to 28 March 2007. 523 | 524 | Nothing in this License shall be construed as excluding or limiting 525 | any implied license or other defenses to infringement that may 526 | otherwise be available to you under applicable patent law. 527 | 528 | 12. No Surrender of Others' Freedom. 529 | 530 | If conditions are imposed on you (whether by court order, agreement or 531 | otherwise) that contradict the conditions of this License, they do not 532 | excuse you from the conditions of this License. If you cannot convey a 533 | covered work so as to satisfy simultaneously your obligations under this 534 | License and any other pertinent obligations, then as a consequence you may 535 | not convey it at all. For example, if you agree to terms that obligate you 536 | to collect a royalty for further conveying from those to whom you convey 537 | the Program, the only way you could satisfy both those terms and this 538 | License would be to refrain entirely from conveying the Program. 539 | 540 | 13. Remote Network Interaction; Use with the GNU General Public License. 541 | 542 | Notwithstanding any other provision of this License, if you modify the 543 | Program, your modified version must prominently offer all users 544 | interacting with it remotely through a computer network (if your version 545 | supports such interaction) an opportunity to receive the Corresponding 546 | Source of your version by providing access to the Corresponding Source 547 | from a network server at no charge, through some standard or customary 548 | means of facilitating copying of software. This Corresponding Source 549 | shall include the Corresponding Source for any work covered by version 3 550 | of the GNU General Public License that is incorporated pursuant to the 551 | following paragraph. 552 | 553 | Notwithstanding any other provision of this License, you have 554 | permission to link or combine any covered work with a work licensed 555 | under version 3 of the GNU General Public License into a single 556 | combined work, and to convey the resulting work. The terms of this 557 | License will continue to apply to the part which is the covered work, 558 | but the work with which it is combined will remain governed by version 559 | 3 of the GNU General Public License. 560 | 561 | 14. Revised Versions of this License. 562 | 563 | The Free Software Foundation may publish revised and/or new versions of 564 | the GNU Affero General Public License from time to time. Such new versions 565 | will be similar in spirit to the present version, but may differ in detail to 566 | address new problems or concerns. 567 | 568 | Each version is given a distinguishing version number. If the 569 | Program specifies that a certain numbered version of the GNU Affero General 570 | Public License "or any later version" applies to it, you have the 571 | option of following the terms and conditions either of that numbered 572 | version or of any later version published by the Free Software 573 | Foundation. If the Program does not specify a version number of the 574 | GNU Affero General Public License, you may choose any version ever published 575 | by the Free Software Foundation. 576 | 577 | If the Program specifies that a proxy can decide which future 578 | versions of the GNU Affero General Public License can be used, that proxy's 579 | public statement of acceptance of a version permanently authorizes you 580 | to choose that version for the Program. 581 | 582 | Later license versions may give you additional or different 583 | permissions. However, no additional obligations are imposed on any 584 | author or copyright holder as a result of your choosing to follow a 585 | later version. 586 | 587 | 15. Disclaimer of Warranty. 588 | 589 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY 590 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT 591 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY 592 | OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, 593 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 594 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM 595 | IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF 596 | ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 597 | 598 | 16. Limitation of Liability. 599 | 600 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 601 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS 602 | THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY 603 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE 604 | USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF 605 | DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD 606 | PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), 607 | EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF 608 | SUCH DAMAGES. 609 | 610 | 17. Interpretation of Sections 15 and 16. 611 | 612 | If the disclaimer of warranty and limitation of liability provided 613 | above cannot be given local legal effect according to their terms, 614 | reviewing courts shall apply local law that most closely approximates 615 | an absolute waiver of all civil liability in connection with the 616 | Program, unless a warranty or assumption of liability accompanies a 617 | copy of the Program in return for a fee. 618 | 619 | END OF TERMS AND CONDITIONS 620 | 621 | How to Apply These Terms to Your New Programs 622 | 623 | If you develop a new program, and you want it to be of the greatest 624 | possible use to the public, the best way to achieve this is to make it 625 | free software which everyone can redistribute and change under these terms. 626 | 627 | To do so, attach the following notices to the program. It is safest 628 | to attach them to the start of each source file to most effectively 629 | state the exclusion of warranty; and each file should have at least 630 | the "copyright" line and a pointer to where the full notice is found. 631 | 632 | 633 | Copyright (C) 634 | 635 | This program is free software: you can redistribute it and/or modify 636 | it under the terms of the GNU Affero General Public License as published by 637 | the Free Software Foundation, either version 3 of the License, or 638 | (at your option) any later version. 639 | 640 | This program is distributed in the hope that it will be useful, 641 | but WITHOUT ANY WARRANTY; without even the implied warranty of 642 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 643 | GNU Affero General Public License for more details. 644 | 645 | You should have received a copy of the GNU Affero General Public License 646 | along with this program. If not, see . 647 | 648 | Also add information on how to contact you by electronic and paper mail. 649 | 650 | If your software can interact with users remotely through a computer 651 | network, you should also make sure that it provides a way for users to 652 | get its source. For example, if your program is a web application, its 653 | interface could display a "Source" link that leads users to an archive 654 | of the code. There are many ways you could offer source, and different 655 | solutions will be better for different programs; see section 13 for the 656 | specific requirements. 657 | 658 | You should also get your employer (if you work as a programmer) or school, 659 | if any, to sign a "copyright disclaimer" for the program, if necessary. 660 | For more information on this, and how to apply and follow the GNU AGPL, see 661 | . 662 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # grpcalculator-rs 2 | 3 | This is the companion project to the Dreams of Code YouTube video on [Rust and gRPC with Tonic](https://youtu.be/kerKXChDmsE) 4 | 5 | Please see the linked video for more information. 6 | 7 | # Requirements 8 | 9 | ## Rust 10 | In order to run this code, you'll need at least Rust 1.76 installed on your system. 11 | 12 | ## Protoc 13 | As well as rust, you'll also need the protobuf compiler as well. 14 | 15 | ### Arch 16 | 17 | ``` 18 | pacman -S protobuf 19 | ``` 20 | 21 | ### macOS 22 | 23 | ``` 24 | brew install protobuf 25 | ``` 26 | 27 | # Running 28 | 29 | This project contains two binaries, a server and a client. 30 | 31 | ## Server 32 | 33 | ``` 34 | cargo run --bin server 35 | ``` 36 | 37 | ## Client 38 | 39 | ``` 40 | cargo run --bin client 41 | ``` 42 | 43 | # Frontend 44 | 45 | There is a companion frontend project that goes with this code found [here](https://github.com/dreamsofcode-io/grpcalculator-web) 46 | -------------------------------------------------------------------------------- /build.rs: -------------------------------------------------------------------------------- 1 | use std::error::Error; 2 | use std::{env, path::PathBuf}; 3 | 4 | fn main() -> Result<(), Box> { 5 | let out_dir = PathBuf::from(env::var("OUT_DIR").unwrap()); 6 | 7 | tonic_build::configure() 8 | .file_descriptor_set_path(out_dir.join("calculator_descriptor.bin")) 9 | .compile(&["proto/calculator.proto"], &["proto"])?; 10 | 11 | tonic_build::compile_protos("proto/calculator.proto")?; 12 | 13 | Ok(()) 14 | } 15 | -------------------------------------------------------------------------------- /proto/calculator.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package calculator; 4 | 5 | service Calculator { 6 | rpc Add(CalculationRequest) returns (CalculationResponse); 7 | rpc Divide(CalculationRequest) returns (CalculationResponse); 8 | } 9 | 10 | message CalculationRequest { 11 | int64 a = 1; 12 | int64 b = 2; 13 | } 14 | 15 | message CalculationResponse { int64 result = 1; } 16 | 17 | service Admin { 18 | rpc GetRequestCount(GetCountRequest) returns (CounterResponse); 19 | } 20 | 21 | message GetCountRequest {} 22 | 23 | message CounterResponse { uint64 count = 1; } 24 | -------------------------------------------------------------------------------- /src/client.rs: -------------------------------------------------------------------------------- 1 | use proto::calculator_client::CalculatorClient; 2 | use std::error::Error; 3 | 4 | pub mod proto { 5 | tonic::include_proto!("calculator"); 6 | } 7 | 8 | #[tokio::main] 9 | async fn main() -> Result<(), Box> { 10 | let url = "http://[::1]:50051"; 11 | let mut client = CalculatorClient::connect(url).await?; 12 | 13 | let req = proto::CalculationRequest { a: 4, b: 5 }; 14 | let request = tonic::Request::new(req); 15 | 16 | let response = client.add(request).await?; 17 | 18 | println!("Response: {:?}", response.get_ref().result); 19 | 20 | Ok(()) 21 | } 22 | -------------------------------------------------------------------------------- /src/main.rs: -------------------------------------------------------------------------------- 1 | use proto::admin_server::{Admin, AdminServer}; 2 | use proto::calculator_server::{Calculator, CalculatorServer}; 3 | use tonic::transport::Server; 4 | 5 | mod proto { 6 | tonic::include_proto!("calculator"); 7 | 8 | pub(crate) const FILE_DESCRIPTOR_SET: &[u8] = 9 | tonic::include_file_descriptor_set!("calculator_descriptor"); 10 | } 11 | 12 | type State = std::sync::Arc>; 13 | 14 | #[derive(Debug, Default)] 15 | struct CalculatorService { 16 | state: State, 17 | } 18 | 19 | impl CalculatorService { 20 | async fn increment_counter(&self) { 21 | let mut count = self.state.write().await; 22 | *count += 1; 23 | } 24 | } 25 | 26 | #[tonic::async_trait] 27 | impl Calculator for CalculatorService { 28 | async fn add( 29 | &self, 30 | request: tonic::Request, 31 | ) -> Result, tonic::Status> { 32 | self.increment_counter().await; 33 | 34 | let input = request.get_ref(); 35 | 36 | let response = proto::CalculationResponse { 37 | result: input.a + input.b, 38 | }; 39 | 40 | Ok(tonic::Response::new(response)) 41 | } 42 | 43 | async fn divide( 44 | &self, 45 | request: tonic::Request, 46 | ) -> Result, tonic::Status> { 47 | self.increment_counter().await; 48 | 49 | let input = request.get_ref(); 50 | 51 | if input.b == 0 { 52 | return Err(tonic::Status::invalid_argument("cannot divide by zero")); 53 | } 54 | 55 | let response = proto::CalculationResponse { 56 | result: input.a / input.b, 57 | }; 58 | 59 | Ok(tonic::Response::new(response)) 60 | } 61 | } 62 | 63 | #[derive(Default, Debug)] 64 | struct AdminService { 65 | state: State, 66 | } 67 | 68 | #[tonic::async_trait] 69 | impl Admin for AdminService { 70 | async fn get_request_count( 71 | &self, 72 | _request: tonic::Request, 73 | ) -> Result, tonic::Status> { 74 | let count = self.state.read().await; 75 | let response = proto::CounterResponse { count: *count }; 76 | 77 | Ok(tonic::Response::new(response)) 78 | } 79 | } 80 | 81 | use tonic::metadata::MetadataValue; 82 | use tonic::{Request, Status}; 83 | 84 | fn check_auth(req: Request<()>) -> Result, Status> { 85 | let token: MetadataValue<_> = "Bearer some-secret-token".parse().unwrap(); 86 | 87 | match req.metadata().get("authorization") { 88 | Some(t) if token == t => Ok(req), 89 | _ => Err(Status::unauthenticated("No valid auth token")), 90 | } 91 | } 92 | 93 | #[tokio::main] 94 | async fn main() -> Result<(), Box> { 95 | let addr = "[::1]:50051".parse()?; 96 | 97 | let state = State::default(); 98 | 99 | let calc = CalculatorService { 100 | state: state.clone(), 101 | }; 102 | 103 | let admin = AdminService { 104 | state: state.clone(), 105 | }; 106 | 107 | let service = tonic_reflection::server::Builder::configure() 108 | .register_encoded_file_descriptor_set(proto::FILE_DESCRIPTOR_SET) 109 | .build()?; 110 | 111 | Server::builder() 112 | .accept_http1(true) 113 | .layer(tower_http::cors::CorsLayer::permissive()) 114 | .add_service(service) 115 | .add_service(tonic_web::enable(CalculatorServer::new(calc))) 116 | .add_service(AdminServer::with_interceptor(admin, check_auth)) 117 | .serve(addr) 118 | .await?; 119 | 120 | Ok(()) 121 | } 122 | --------------------------------------------------------------------------------