A modern Music Player Daemon based on Rockbox open source high quality audio player
libadwaita audio rust zig deno mpris rockbox mpd
2
fork

Configure Feed

Select the types of activity you want to include in your feed.

[rocksky] control rockbox remotely with rocksky web ui (websocket)

+9617 -95
+205 -74
Cargo.lock
··· 122 122 "mime", 123 123 "percent-encoding", 124 124 "pin-project-lite", 125 - "rand", 125 + "rand 0.8.5", 126 126 "sha1", 127 127 "smallvec", 128 128 "tokio", ··· 373 373 checksum = "e89da841a80418a9b391ebaea17f5c112ffaaa96f621d2c285b5174da76b9011" 374 374 dependencies = [ 375 375 "cfg-if 1.0.0", 376 - "getrandom", 376 + "getrandom 0.2.15", 377 377 "once_cell", 378 378 "version_check", 379 - "zerocopy", 379 + "zerocopy 0.7.35", 380 380 ] 381 381 382 382 [[package]] ··· 1375 1375 1376 1376 [[package]] 1377 1377 name = "bytes" 1378 - version = "1.7.1" 1378 + version = "1.10.1" 1379 1379 source = "registry+https://github.com/rust-lang/crates.io-index" 1380 - checksum = "8318a53db07bb3f8dca91a600466bdb3f2eaadeedfdbcf02e1accbad9271ba50" 1380 + checksum = "d71b6127be86fdcfddb610f7182ac57211d4b18a3e9c82eb2d17662f2227ad6a" 1381 1381 dependencies = [ 1382 1382 "serde", 1383 1383 ] ··· 1959 1959 checksum = "0dc92fb57ca44df6db8059111ab3af99a63d5d0f8375d9972e319a379c6bab76" 1960 1960 dependencies = [ 1961 1961 "generic-array", 1962 - "rand_core", 1962 + "rand_core 0.6.4", 1963 1963 "subtle", 1964 1964 "zeroize", 1965 1965 ] ··· 1971 1971 checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" 1972 1972 dependencies = [ 1973 1973 "generic-array", 1974 - "rand_core", 1974 + "rand_core 0.6.4", 1975 1975 "typenum", 1976 1976 ] 1977 1977 ··· 2002 2002 "hostname 0.4.0", 2003 2003 "num", 2004 2004 "once_cell", 2005 - "rand", 2005 + "rand 0.8.5", 2006 2006 "uuid", 2007 2007 ] 2008 2008 ··· 2019 2019 checksum = "50e281dc36864ea88fae2ec4e21eb280e8239487acb1ddc59b528b0afa7997bd" 2020 2020 dependencies = [ 2021 2021 "cuid-util", 2022 - "getrandom", 2022 + "getrandom 0.2.15", 2023 2023 "num", 2024 - "rand", 2024 + "rand 0.8.5", 2025 2025 "sha3", 2026 2026 ] 2027 2027 ··· 2235 2235 "pretty_assertions", 2236 2236 "pretty_yaml", 2237 2237 "quick-junit", 2238 - "rand", 2238 + "rand 0.8.5", 2239 2239 "regex", 2240 2240 "ring", 2241 2241 "runtimelib", ··· 2505 2505 "p256", 2506 2506 "p384", 2507 2507 "p521", 2508 - "rand", 2508 + "rand 0.8.5", 2509 2509 "ring", 2510 2510 "rsa", 2511 2511 "sec1", ··· 2645 2645 "junction", 2646 2646 "libc", 2647 2647 "nix 0.27.1", 2648 - "rand", 2648 + "rand 0.8.5", 2649 2649 "rayon", 2650 2650 "serde", 2651 2651 "thiserror 2.0.9", ··· 2712 2712 "percent-encoding", 2713 2713 "phf", 2714 2714 "pin-project", 2715 - "rand", 2715 + "rand 0.8.5", 2716 2716 "ring", 2717 2717 "scopeguard", 2718 2718 "serde", ··· 2736 2736 "os_pipe", 2737 2737 "parking_lot", 2738 2738 "pin-project", 2739 - "rand", 2739 + "rand 0.8.5", 2740 2740 "tokio", 2741 2741 "uuid", 2742 2742 "winapi", ··· 2768 2768 "num-bigint", 2769 2769 "prost", 2770 2770 "prost-build", 2771 - "rand", 2771 + "rand 0.8.5", 2772 2772 "rusqlite", 2773 2773 "serde", 2774 2774 "thiserror 2.0.9", ··· 2925 2925 "pbkdf2", 2926 2926 "pin-project-lite", 2927 2927 "pkcs8", 2928 - "rand", 2928 + "rand 0.8.5", 2929 2929 "regex", 2930 2930 "ring", 2931 2931 "ripemd", ··· 2992 2992 "log", 2993 2993 "parking_lot", 2994 2994 "percent-encoding", 2995 - "rand", 2995 + "rand 0.8.5", 2996 2996 "ring", 2997 2997 "serde_json", 2998 2998 "tar", ··· 3408 3408 "http 1.1.0", 3409 3409 "log", 3410 3410 "prost", 3411 - "rand", 3411 + "rand 0.8.5", 3412 3412 "serde", 3413 3413 "serde_json", 3414 3414 "tokio", ··· 3432 3432 "hex", 3433 3433 "log", 3434 3434 "num-bigint", 3435 - "rand", 3435 + "rand 0.8.5", 3436 3436 "rusqlite", 3437 3437 "serde_json", 3438 3438 "thiserror 1.0.63", ··· 3918 3918 dependencies = [ 3919 3919 "curve25519-dalek", 3920 3920 "ed25519", 3921 - "rand_core", 3921 + "rand_core 0.6.4", 3922 3922 "serde", 3923 3923 "sha2", 3924 3924 "signature", ··· 3948 3948 "indexmap 2.5.0", 3949 3949 "log", 3950 3950 "thiserror 1.0.63", 3951 - "zerocopy", 3951 + "zerocopy 0.7.35", 3952 3952 ] 3953 3953 3954 3954 [[package]] ··· 3976 3976 "hkdf", 3977 3977 "pem-rfc7468", 3978 3978 "pkcs8", 3979 - "rand_core", 3979 + "rand_core 0.6.4", 3980 3980 "sec1", 3981 3981 "serde_json", 3982 3982 "serdect", ··· 4293 4293 "hyper 1.4.1", 4294 4294 "hyper-util", 4295 4295 "pin-project", 4296 - "rand", 4296 + "rand 0.8.5", 4297 4297 "sha1", 4298 4298 "simdutf8", 4299 4299 "thiserror 1.0.63", ··· 4327 4327 source = "registry+https://github.com/rust-lang/crates.io-index" 4328 4328 checksum = "ded41244b729663b1e574f1b4fb731469f69f79c17667b5d776b16cda0479449" 4329 4329 dependencies = [ 4330 - "rand_core", 4330 + "rand_core 0.6.4", 4331 4331 "subtle", 4332 4332 ] 4333 4333 ··· 4743 4743 "cfg-if 1.0.0", 4744 4744 "js-sys", 4745 4745 "libc", 4746 - "wasi", 4746 + "wasi 0.11.0+wasi-snapshot-preview1", 4747 4747 "wasm-bindgen", 4748 4748 ] 4749 4749 4750 4750 [[package]] 4751 + name = "getrandom" 4752 + version = "0.3.2" 4753 + source = "registry+https://github.com/rust-lang/crates.io-index" 4754 + checksum = "73fea8450eea4bac3940448fb7ae50d91f034f941199fcd9d909a5a07aa455f0" 4755 + dependencies = [ 4756 + "cfg-if 1.0.0", 4757 + "libc", 4758 + "r-efi", 4759 + "wasi 0.14.2+wasi-0.2.4", 4760 + ] 4761 + 4762 + [[package]] 4751 4763 name = "ghash" 4752 4764 version = "0.5.1" 4753 4765 source = "registry+https://github.com/rust-lang/crates.io-index" ··· 4999 5011 checksum = "f0f9ef7462f7c099f518d754361858f86d8a07af53ba9af0fe635bbccb151a63" 5000 5012 dependencies = [ 5001 5013 "ff", 5002 - "rand_core", 5014 + "rand_core 0.6.4", 5003 5015 "subtle", 5004 5016 ] 5005 5017 ··· 5320 5332 "idna", 5321 5333 "ipnet", 5322 5334 "once_cell", 5323 - "rand", 5335 + "rand 0.8.5", 5324 5336 "serde", 5325 5337 "thiserror 2.0.9", 5326 5338 "tinyvec", ··· 5342 5354 "moka", 5343 5355 "once_cell", 5344 5356 "parking_lot", 5345 - "rand", 5357 + "rand 0.8.5", 5346 5358 "resolv-conf", 5347 5359 "serde", 5348 5360 "smallvec", ··· 6386 6398 "if-addrs 0.12.0", 6387 6399 "log", 6388 6400 "multimap", 6389 - "rand", 6401 + "rand 0.8.5", 6390 6402 "socket2 0.5.7", 6391 6403 "thiserror 1.0.63", 6392 6404 "tokio", ··· 6424 6436 "libc", 6425 6437 "sha2", 6426 6438 "windows-sys 0.48.0", 6427 - "zerocopy", 6439 + "zerocopy 0.7.35", 6428 6440 ] 6429 6441 6430 6442 [[package]] ··· 6814 6826 dependencies = [ 6815 6827 "libc", 6816 6828 "log", 6817 - "wasi", 6829 + "wasi 0.11.0+wasi-snapshot-preview1", 6818 6830 "windows-sys 0.48.0", 6819 6831 ] 6820 6832 ··· 6827 6839 "hermit-abi 0.3.9", 6828 6840 "libc", 6829 6841 "log", 6830 - "wasi", 6842 + "wasi 0.11.0+wasi-snapshot-preview1", 6831 6843 "windows-sys 0.52.0", 6832 6844 ] 6833 6845 ··· 7145 7157 dependencies = [ 7146 7158 "num-integer", 7147 7159 "num-traits", 7148 - "rand", 7160 + "rand 0.8.5", 7149 7161 "serde", 7150 7162 ] 7151 7163 ··· 7161 7173 "num-integer", 7162 7174 "num-iter", 7163 7175 "num-traits", 7164 - "rand", 7176 + "rand 0.8.5", 7165 7177 "serde", 7166 7178 "smallvec", 7167 7179 "zeroize", ··· 7431 7443 "glob", 7432 7444 "opentelemetry", 7433 7445 "percent-encoding", 7434 - "rand", 7446 + "rand 0.8.5", 7435 7447 "serde_json", 7436 7448 "thiserror 1.0.63", 7437 7449 "tracing", ··· 7560 7572 "ecdsa", 7561 7573 "elliptic-curve", 7562 7574 "primeorder", 7563 - "rand_core", 7575 + "rand_core 0.6.4", 7564 7576 "sha2", 7565 7577 ] 7566 7578 ··· 7624 7636 checksum = "346f04948ba92c43e8469c1ee6736c7563d71012b17d40745260fe106aac2166" 7625 7637 dependencies = [ 7626 7638 "base64ct", 7627 - "rand_core", 7639 + "rand_core 0.6.4", 7628 7640 "subtle", 7629 7641 ] 7630 7642 ··· 7762 7774 checksum = "48e4cc64c2ad9ebe670cb8fd69dd50ae301650392e81c05f9bfcb2d5bdbc24b0" 7763 7775 dependencies = [ 7764 7776 "phf_shared", 7765 - "rand", 7777 + "rand 0.8.5", 7766 7778 ] 7767 7779 7768 7780 [[package]] ··· 7864 7876 dependencies = [ 7865 7877 "der", 7866 7878 "pkcs5", 7867 - "rand_core", 7879 + "rand_core 0.6.4", 7868 7880 "spki", 7869 7881 ] 7870 7882 ··· 7942 7954 source = "registry+https://github.com/rust-lang/crates.io-index" 7943 7955 checksum = "77957b295656769bb8ad2b6a6b09d897d94f05c41b069aede1fcdaa675eaea04" 7944 7956 dependencies = [ 7945 - "zerocopy", 7957 + "zerocopy 0.7.35", 7946 7958 ] 7947 7959 7948 7960 [[package]] ··· 8232 8244 "libc", 8233 8245 "once_cell", 8234 8246 "raw-cpuid", 8235 - "wasi", 8247 + "wasi 0.11.0+wasi-snapshot-preview1", 8236 8248 "web-sys", 8237 8249 "winapi", 8238 8250 ] ··· 8310 8322 checksum = "a2fe5ef3495d7d2e377ff17b1a8ce2ee2ec2a18cde8b6ad6619d65d0701c135d" 8311 8323 dependencies = [ 8312 8324 "bytes", 8313 - "getrandom", 8314 - "rand", 8325 + "getrandom 0.2.15", 8326 + "rand 0.8.5", 8315 8327 "ring", 8316 8328 "rustc-hash 2.0.0", 8317 8329 "rustls 0.23.13", ··· 8346 8358 ] 8347 8359 8348 8360 [[package]] 8361 + name = "r-efi" 8362 + version = "5.2.0" 8363 + source = "registry+https://github.com/rust-lang/crates.io-index" 8364 + checksum = "74765f6d916ee2faa39bc8e68e4f3ed8949b48cccdac59983d287a7cb71ce9c5" 8365 + 8366 + [[package]] 8349 8367 name = "radium" 8350 8368 version = "0.7.0" 8351 8369 source = "registry+https://github.com/rust-lang/crates.io-index" ··· 8395 8413 checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" 8396 8414 dependencies = [ 8397 8415 "libc", 8398 - "rand_chacha", 8399 - "rand_core", 8416 + "rand_chacha 0.3.1", 8417 + "rand_core 0.6.4", 8418 + ] 8419 + 8420 + [[package]] 8421 + name = "rand" 8422 + version = "0.9.0" 8423 + source = "registry+https://github.com/rust-lang/crates.io-index" 8424 + checksum = "3779b94aeb87e8bd4e834cee3650289ee9e0d5677f976ecdb6d219e5f4f6cd94" 8425 + dependencies = [ 8426 + "rand_chacha 0.9.0", 8427 + "rand_core 0.9.3", 8428 + "zerocopy 0.8.24", 8400 8429 ] 8401 8430 8402 8431 [[package]] ··· 8406 8435 checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" 8407 8436 dependencies = [ 8408 8437 "ppv-lite86", 8409 - "rand_core", 8438 + "rand_core 0.6.4", 8439 + ] 8440 + 8441 + [[package]] 8442 + name = "rand_chacha" 8443 + version = "0.9.0" 8444 + source = "registry+https://github.com/rust-lang/crates.io-index" 8445 + checksum = "d3022b5f1df60f26e1ffddd6c66e8aa15de382ae63b3a0c1bfc0e4d3e3f325cb" 8446 + dependencies = [ 8447 + "ppv-lite86", 8448 + "rand_core 0.9.3", 8410 8449 ] 8411 8450 8412 8451 [[package]] ··· 8415 8454 source = "registry+https://github.com/rust-lang/crates.io-index" 8416 8455 checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" 8417 8456 dependencies = [ 8418 - "getrandom", 8457 + "getrandom 0.2.15", 8458 + ] 8459 + 8460 + [[package]] 8461 + name = "rand_core" 8462 + version = "0.9.3" 8463 + source = "registry+https://github.com/rust-lang/crates.io-index" 8464 + checksum = "99d9a13982dcf210057a8a78572b2217b667c3beacbf3a0d8b454f6f82837d38" 8465 + dependencies = [ 8466 + "getrandom 0.3.2", 8419 8467 ] 8420 8468 8421 8469 [[package]] ··· 8425 8473 checksum = "32cb0b9bc82b0a0876c2dd994a7e7a2683d3e7390ca40e6886785ef0c7e3ee31" 8426 8474 dependencies = [ 8427 8475 "num-traits", 8428 - "rand", 8476 + "rand 0.8.5", 8429 8477 ] 8430 8478 8431 8479 [[package]] ··· 8482 8530 "once_cell", 8483 8531 "paste", 8484 8532 "profiling", 8485 - "rand", 8486 - "rand_chacha", 8533 + "rand 0.8.5", 8534 + "rand_chacha 0.3.1", 8487 8535 "simd_helpers", 8488 8536 "system-deps 6.2.2", 8489 8537 "thiserror 1.0.63", ··· 8556 8604 source = "registry+https://github.com/rust-lang/crates.io-index" 8557 8605 checksum = "ba009ff324d1fc1b900bd1fdb31564febe58a8ccc8a6fdbb93b543d33b13ca43" 8558 8606 dependencies = [ 8559 - "getrandom", 8607 + "getrandom 0.2.15", 8560 8608 "libredox", 8561 8609 "thiserror 1.0.63", 8562 8610 ] ··· 8567 8615 source = "registry+https://github.com/rust-lang/crates.io-index" 8568 8616 checksum = "dd6f9d3d47bdd2ad6945c5015a226ec6155d0bcdfd8f7cd29f86b71f8de99d2b" 8569 8617 dependencies = [ 8570 - "getrandom", 8618 + "getrandom 0.2.15", 8571 8619 "libredox", 8572 8620 "thiserror 2.0.9", 8573 8621 ] ··· 8716 8764 dependencies = [ 8717 8765 "cc", 8718 8766 "cfg-if 1.0.0", 8719 - "getrandom", 8767 + "getrandom 0.2.15", 8720 8768 "libc", 8721 8769 "spin", 8722 8770 "untrusted", ··· 8822 8870 "clap", 8823 8871 "owo-colors 4.1.0", 8824 8872 "rockbox-library", 8873 + "rockbox-rocksky", 8825 8874 "rockbox-search", 8826 8875 "rockbox-settings", 8827 8876 "tokio", ··· 8961 9010 dependencies = [ 8962 9011 "anyhow", 8963 9012 "dirs 6.0.0", 9013 + "futures-util", 8964 9014 "lofty", 9015 + "prost", 8965 9016 "reqwest", 8966 9017 "rockbox-library", 8967 9018 "serde", 8968 9019 "serde_json", 8969 9020 "sha256", 8970 9021 "tokio", 9022 + "tokio-stream", 9023 + "tokio-tungstenite 0.26.2", 9024 + "tonic", 9025 + "tonic-build", 9026 + "tonic-reflection", 9027 + "tonic-web", 9028 + "tungstenite 0.26.2", 8971 9029 ] 8972 9030 8973 9031 [[package]] ··· 9023 9081 "md5", 9024 9082 "owo-colors 4.1.0", 9025 9083 "queryst", 9026 - "rand", 9084 + "rand 0.8.5", 9027 9085 "reqwest", 9028 9086 "rockbox-chromecast", 9029 9087 "rockbox-discovery", ··· 9073 9131 name = "rockbox-tracklist" 9074 9132 version = "0.1.0" 9075 9133 dependencies = [ 9076 - "rand", 9134 + "rand 0.8.5", 9077 9135 "rockbox-traits", 9078 9136 ] 9079 9137 ··· 9149 9207 "num-traits", 9150 9208 "pkcs1", 9151 9209 "pkcs8", 9152 - "rand_core", 9210 + "rand_core 0.6.4", 9153 9211 "signature", 9154 9212 "spki", 9155 9213 "subtle", ··· 9171 9229 "futures", 9172 9230 "glob", 9173 9231 "jupyter-serde", 9174 - "rand", 9232 + "rand 0.8.5", 9175 9233 "ring", 9176 9234 "serde", 9177 9235 "serde_json", ··· 9829 9887 checksum = "77549399552de45a898a580c1b41d445bf730df867cc44e6c0233bbc4b8329de" 9830 9888 dependencies = [ 9831 9889 "digest", 9832 - "rand_core", 9890 + "rand_core 0.6.4", 9833 9891 ] 9834 9892 9835 9893 [[package]] ··· 9853 9911 source = "registry+https://github.com/rust-lang/crates.io-index" 9854 9912 checksum = "aa2bcf6c6e164e81bc7a5d49fc6988b3d515d9e8c07457d7b74ffb9324b9cd40" 9855 9913 dependencies = [ 9856 - "getrandom", 9914 + "getrandom 0.2.15", 9857 9915 "halfbrown", 9858 9916 "ref-cast", 9859 9917 "serde", ··· 10188 10246 "memchr", 10189 10247 "once_cell", 10190 10248 "percent-encoding", 10191 - "rand", 10249 + "rand 0.8.5", 10192 10250 "rsa", 10193 10251 "serde", 10194 10252 "sha1", ··· 10228 10286 "md-5", 10229 10287 "memchr", 10230 10288 "once_cell", 10231 - "rand", 10289 + "rand 0.8.5", 10232 10290 "serde", 10233 10291 "serde_json", 10234 10292 "sha2", ··· 11430 11488 11431 11489 [[package]] 11432 11490 name = "tokio-stream" 11433 - version = "0.1.16" 11491 + version = "0.1.17" 11434 11492 source = "registry+https://github.com/rust-lang/crates.io-index" 11435 - checksum = "4f4e6ce100d0eb49a2734f8c0812bcd324cf357d21810932c5df6b96ef2b86f1" 11493 + checksum = "eca58d7bba4a75707817a2c44174253f9236b2d5fbd055602e9d5c07c139a047" 11436 11494 dependencies = [ 11437 11495 "futures-core", 11438 11496 "pin-project-lite", ··· 11448 11506 "futures-util", 11449 11507 "log", 11450 11508 "tokio", 11451 - "tungstenite", 11509 + "tungstenite 0.21.0", 11510 + ] 11511 + 11512 + [[package]] 11513 + name = "tokio-tungstenite" 11514 + version = "0.26.2" 11515 + source = "registry+https://github.com/rust-lang/crates.io-index" 11516 + checksum = "7a9daff607c6d2bf6c16fd681ccb7eecc83e4e2cdc1ca067ffaadfca5de7f084" 11517 + dependencies = [ 11518 + "futures-util", 11519 + "log", 11520 + "rustls 0.23.13", 11521 + "rustls-pki-types", 11522 + "tokio", 11523 + "tokio-rustls", 11524 + "tungstenite 0.26.2", 11525 + "webpki-roots 0.26.3", 11452 11526 ] 11453 11527 11454 11528 [[package]] ··· 11599 11673 "indexmap 1.9.3", 11600 11674 "pin-project", 11601 11675 "pin-project-lite", 11602 - "rand", 11676 + "rand 0.8.5", 11603 11677 "slab", 11604 11678 "tokio", 11605 11679 "tokio-util", ··· 11742 11816 "http 1.1.0", 11743 11817 "httparse", 11744 11818 "log", 11745 - "rand", 11819 + "rand 0.8.5", 11746 11820 "sha1", 11747 11821 "thiserror 1.0.63", 11748 11822 "url", ··· 11750 11824 ] 11751 11825 11752 11826 [[package]] 11827 + name = "tungstenite" 11828 + version = "0.26.2" 11829 + source = "registry+https://github.com/rust-lang/crates.io-index" 11830 + checksum = "4793cb5e56680ecbb1d843515b23b6de9a75eb04b66643e256a396d43be33c13" 11831 + dependencies = [ 11832 + "bytes", 11833 + "data-encoding", 11834 + "http 1.1.0", 11835 + "httparse", 11836 + "log", 11837 + "rand 0.9.0", 11838 + "rustls 0.23.13", 11839 + "rustls-pki-types", 11840 + "sha1", 11841 + "thiserror 2.0.9", 11842 + "utf-8", 11843 + ] 11844 + 11845 + [[package]] 11753 11846 name = "twox-hash" 11754 11847 version = "1.6.3" 11755 11848 source = "registry+https://github.com/rust-lang/crates.io-index" 11756 11849 checksum = "97fee6b57c6a41524a810daee9286c02d7752c4253064d0b05472833a438f675" 11757 11850 dependencies = [ 11758 11851 "cfg-if 1.0.0", 11759 - "rand", 11852 + "rand 0.8.5", 11760 11853 "static_assertions", 11761 11854 ] 11762 11855 ··· 12007 12100 source = "registry+https://github.com/rust-lang/crates.io-index" 12008 12101 checksum = "81dfa00651efa65069b0b6b651f4aaa31ba9e3c3ce0137aaad053604ee7e0314" 12009 12102 dependencies = [ 12010 - "getrandom", 12103 + "getrandom 0.2.15", 12011 12104 "serde", 12012 12105 "sha1_smol", 12013 12106 ] ··· 12205 12298 "serde_json", 12206 12299 "serde_urlencoded", 12207 12300 "tokio", 12208 - "tokio-tungstenite", 12301 + "tokio-tungstenite 0.21.0", 12209 12302 "tokio-util", 12210 12303 "tower-service", 12211 12304 "tracing", ··· 12216 12309 version = "0.11.0+wasi-snapshot-preview1" 12217 12310 source = "registry+https://github.com/rust-lang/crates.io-index" 12218 12311 checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" 12312 + 12313 + [[package]] 12314 + name = "wasi" 12315 + version = "0.14.2+wasi-0.2.4" 12316 + source = "registry+https://github.com/rust-lang/crates.io-index" 12317 + checksum = "9683f9a5a998d873c0d21fcbe3c083009670149a8fab228644b8bd36b2c48cb3" 12318 + dependencies = [ 12319 + "wit-bindgen-rt", 12320 + ] 12219 12321 12220 12322 [[package]] 12221 12323 name = "wasite" ··· 12805 12907 checksum = "d135d17ab770252ad95e9a872d365cf3090e3be864a34ab46f48555993efc904" 12806 12908 12807 12909 [[package]] 12910 + name = "wit-bindgen-rt" 12911 + version = "0.39.0" 12912 + source = "registry+https://github.com/rust-lang/crates.io-index" 12913 + checksum = "6f42320e61fe2cfd34354ecb597f86f413484a798ba44a8ca1165c58d42da6c1" 12914 + dependencies = [ 12915 + "bitflags 2.6.0", 12916 + ] 12917 + 12918 + [[package]] 12808 12919 name = "write16" 12809 12920 version = "1.0.0" 12810 12921 source = "registry+https://github.com/rust-lang/crates.io-index" ··· 12838 12949 checksum = "c7e468321c81fb07fa7f4c636c3972b9100f0346e5b6a9f2bd0603a52f7ed277" 12839 12950 dependencies = [ 12840 12951 "curve25519-dalek", 12841 - "rand_core", 12952 + "rand_core 0.6.4", 12842 12953 "serde", 12843 12954 "zeroize", 12844 12955 ] ··· 12951 13062 "hex", 12952 13063 "nix 0.29.0", 12953 13064 "ordered-stream", 12954 - "rand", 13065 + "rand 0.8.5", 12955 13066 "serde", 12956 13067 "serde_repr", 12957 13068 "sha1", ··· 12996 13107 checksum = "1b9b4fd18abc82b8136838da5d50bae7bdea537c574d8dc1a34ed098d6c166f0" 12997 13108 dependencies = [ 12998 13109 "byteorder", 12999 - "zerocopy-derive", 13110 + "zerocopy-derive 0.7.35", 13111 + ] 13112 + 13113 + [[package]] 13114 + name = "zerocopy" 13115 + version = "0.8.24" 13116 + source = "registry+https://github.com/rust-lang/crates.io-index" 13117 + checksum = "2586fea28e186957ef732a5f8b3be2da217d65c5969d4b1e17f973ebbe876879" 13118 + dependencies = [ 13119 + "zerocopy-derive 0.8.24", 13000 13120 ] 13001 13121 13002 13122 [[package]] ··· 13004 13124 version = "0.7.35" 13005 13125 source = "registry+https://github.com/rust-lang/crates.io-index" 13006 13126 checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" 13127 + dependencies = [ 13128 + "proc-macro2", 13129 + "quote", 13130 + "syn 2.0.91", 13131 + ] 13132 + 13133 + [[package]] 13134 + name = "zerocopy-derive" 13135 + version = "0.8.24" 13136 + source = "registry+https://github.com/rust-lang/crates.io-index" 13137 + checksum = "a996a8f63c5c4448cd959ac1bab0aaa3306ccfd060472f85943ee0750f0169be" 13007 13138 dependencies = [ 13008 13139 "proc-macro2", 13009 13140 "quote", ··· 13070 13201 "num-traits", 13071 13202 "once_cell", 13072 13203 "parking_lot", 13073 - "rand", 13204 + "rand 0.8.5", 13074 13205 "regex", 13075 13206 "thiserror 1.0.63", 13076 13207 "tokio",
+1
crates/cli/Cargo.toml
··· 13 13 rockbox-library = {path = "../library"} 14 14 rockbox-search = {path = "../search"} 15 15 rockbox-settings = {path = "../settings"} 16 + rockbox-rocksky = {path = "../rocksky"} 16 17 tokio = {version = "1.36.0", features = ["full"]}
+10
crates/cli/src/lib.rs
··· 7 7 use rockbox_search::artist::Artist; 8 8 use rockbox_search::track::Track; 9 9 use rockbox_search::{create_indexes, delete_all_documents, index_entity}; 10 + use std::thread::sleep; 11 + use std::time::Duration; 10 12 use std::{env, ffi::CStr}; 11 13 use std::{fs, thread}; 12 14 ··· 126 128 Ok::<(), Error>(()) 127 129 }) 128 130 .unwrap(); 131 + 132 + thread::spawn(move || { 133 + sleep(Duration::from_secs(5)); 134 + match rockbox_rocksky::register_rockbox() { 135 + Ok(_) => println!("Successfully registered Rockbox with Rocksky server"), 136 + Err(e) => eprintln!("Failed to register Rockbox with Rocksky server: {}", e), 137 + }; 138 + }); 129 139 130 140 const BANNER: &str = r#" 131 141 __________ __ ___.
+11
crates/rocksky/Cargo.toml
··· 10 10 anyhow.workspace = true 11 11 lofty = "0.21.1" 12 12 dirs = "6.0.0" 13 + prost = "0.13.2" 13 14 rockbox-library = { path = "../library" } 14 15 reqwest = { version = "0.12.5", features = [ 15 16 "rustls-tls", ··· 20 21 serde_json = "1.0.128" 21 22 sha256 = "1.5.0" 22 23 tokio = { version = "1.36.0", features = ["full"] } 24 + tonic = "0.12.3" 25 + tonic-reflection = "0.12.3" 26 + tonic-web = "0.12.3" 27 + tungstenite = { version = "0.26.2", features = ["rustls"] } 28 + tokio-tungstenite = { version = "0.26.2", features = ["tokio-rustls", "rustls-tls-webpki-roots"] } 29 + futures-util = "0.3.31" 30 + tokio-stream = "0.1.17" 31 + 32 + [build-dependencies] 33 + tonic-build = "0.12.3"
+19
crates/rocksky/build.rs
··· 1 + fn main() -> Result<(), Box<dyn std::error::Error>> { 2 + tonic_build::configure() 3 + .out_dir("src/api") 4 + .file_descriptor_set_path("src/api/rockbox_descriptor.bin") 5 + .compile_protos( 6 + &[ 7 + "proto/rockbox/v1alpha1/browse.proto", 8 + "proto/rockbox/v1alpha1/library.proto", 9 + "proto/rockbox/v1alpha1/metadata.proto", 10 + "proto/rockbox/v1alpha1/playback.proto", 11 + "proto/rockbox/v1alpha1/playlist.proto", 12 + "proto/rockbox/v1alpha1/settings.proto", 13 + "proto/rockbox/v1alpha1/sound.proto", 14 + "proto/rockbox/v1alpha1/system.proto", 15 + ], 16 + &["proto"], 17 + )?; 18 + Ok(()) 19 + }
+1
crates/rocksky/proto
··· 1 + ../../crates/rpc/proto
+9144
crates/rocksky/src/api/rockbox.v1alpha1.rs
··· 1 + // This file is @generated by prost-build. 2 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 3 + pub struct RockboxBrowseRequest {} 4 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 5 + pub struct RockboxBrowseResponse {} 6 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 7 + pub struct TreeGetContextRequest {} 8 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 9 + pub struct TreeGetContextResponse {} 10 + #[derive(Clone, PartialEq, ::prost::Message)] 11 + pub struct TreeGetEntriesRequest { 12 + #[prost(string, optional, tag = "1")] 13 + pub path: ::core::option::Option<::prost::alloc::string::String>, 14 + } 15 + #[derive(Clone, PartialEq, ::prost::Message)] 16 + pub struct Entry { 17 + #[prost(string, tag = "1")] 18 + pub name: ::prost::alloc::string::String, 19 + #[prost(int32, tag = "2")] 20 + pub attr: i32, 21 + #[prost(uint32, tag = "3")] 22 + pub time_write: u32, 23 + #[prost(int32, tag = "4")] 24 + pub customaction: i32, 25 + } 26 + #[derive(Clone, PartialEq, ::prost::Message)] 27 + pub struct TreeGetEntriesResponse { 28 + #[prost(message, repeated, tag = "1")] 29 + pub entries: ::prost::alloc::vec::Vec<Entry>, 30 + } 31 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 32 + pub struct TreeGetEntryAtRequest {} 33 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 34 + pub struct TreeGetEntryAtResponse {} 35 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 36 + pub struct BrowseId3Request {} 37 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 38 + pub struct BrowseId3Response {} 39 + /// Generated client implementations. 40 + pub mod browse_service_client { 41 + #![allow( 42 + unused_variables, 43 + dead_code, 44 + missing_docs, 45 + clippy::wildcard_imports, 46 + clippy::let_unit_value, 47 + )] 48 + use tonic::codegen::*; 49 + use tonic::codegen::http::Uri; 50 + #[derive(Debug, Clone)] 51 + pub struct BrowseServiceClient<T> { 52 + inner: tonic::client::Grpc<T>, 53 + } 54 + impl BrowseServiceClient<tonic::transport::Channel> { 55 + /// Attempt to create a new client by connecting to a given endpoint. 56 + pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error> 57 + where 58 + D: TryInto<tonic::transport::Endpoint>, 59 + D::Error: Into<StdError>, 60 + { 61 + let conn = tonic::transport::Endpoint::new(dst)?.connect().await?; 62 + Ok(Self::new(conn)) 63 + } 64 + } 65 + impl<T> BrowseServiceClient<T> 66 + where 67 + T: tonic::client::GrpcService<tonic::body::BoxBody>, 68 + T::Error: Into<StdError>, 69 + T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static, 70 + <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send, 71 + { 72 + pub fn new(inner: T) -> Self { 73 + let inner = tonic::client::Grpc::new(inner); 74 + Self { inner } 75 + } 76 + pub fn with_origin(inner: T, origin: Uri) -> Self { 77 + let inner = tonic::client::Grpc::with_origin(inner, origin); 78 + Self { inner } 79 + } 80 + pub fn with_interceptor<F>( 81 + inner: T, 82 + interceptor: F, 83 + ) -> BrowseServiceClient<InterceptedService<T, F>> 84 + where 85 + F: tonic::service::Interceptor, 86 + T::ResponseBody: Default, 87 + T: tonic::codegen::Service< 88 + http::Request<tonic::body::BoxBody>, 89 + Response = http::Response< 90 + <T as tonic::client::GrpcService<tonic::body::BoxBody>>::ResponseBody, 91 + >, 92 + >, 93 + <T as tonic::codegen::Service< 94 + http::Request<tonic::body::BoxBody>, 95 + >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync, 96 + { 97 + BrowseServiceClient::new(InterceptedService::new(inner, interceptor)) 98 + } 99 + /// Compress requests with the given encoding. 100 + /// 101 + /// This requires the server to support it otherwise it might respond with an 102 + /// error. 103 + #[must_use] 104 + pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { 105 + self.inner = self.inner.send_compressed(encoding); 106 + self 107 + } 108 + /// Enable decompressing responses. 109 + #[must_use] 110 + pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { 111 + self.inner = self.inner.accept_compressed(encoding); 112 + self 113 + } 114 + /// Limits the maximum size of a decoded message. 115 + /// 116 + /// Default: `4MB` 117 + #[must_use] 118 + pub fn max_decoding_message_size(mut self, limit: usize) -> Self { 119 + self.inner = self.inner.max_decoding_message_size(limit); 120 + self 121 + } 122 + /// Limits the maximum size of an encoded message. 123 + /// 124 + /// Default: `usize::MAX` 125 + #[must_use] 126 + pub fn max_encoding_message_size(mut self, limit: usize) -> Self { 127 + self.inner = self.inner.max_encoding_message_size(limit); 128 + self 129 + } 130 + pub async fn tree_get_entries( 131 + &mut self, 132 + request: impl tonic::IntoRequest<super::TreeGetEntriesRequest>, 133 + ) -> std::result::Result< 134 + tonic::Response<super::TreeGetEntriesResponse>, 135 + tonic::Status, 136 + > { 137 + self.inner 138 + .ready() 139 + .await 140 + .map_err(|e| { 141 + tonic::Status::unknown( 142 + format!("Service was not ready: {}", e.into()), 143 + ) 144 + })?; 145 + let codec = tonic::codec::ProstCodec::default(); 146 + let path = http::uri::PathAndQuery::from_static( 147 + "/rockbox.v1alpha1.BrowseService/TreeGetEntries", 148 + ); 149 + let mut req = request.into_request(); 150 + req.extensions_mut() 151 + .insert( 152 + GrpcMethod::new("rockbox.v1alpha1.BrowseService", "TreeGetEntries"), 153 + ); 154 + self.inner.unary(req, path, codec).await 155 + } 156 + } 157 + } 158 + /// Generated server implementations. 159 + pub mod browse_service_server { 160 + #![allow( 161 + unused_variables, 162 + dead_code, 163 + missing_docs, 164 + clippy::wildcard_imports, 165 + clippy::let_unit_value, 166 + )] 167 + use tonic::codegen::*; 168 + /// Generated trait containing gRPC methods that should be implemented for use with BrowseServiceServer. 169 + #[async_trait] 170 + pub trait BrowseService: std::marker::Send + std::marker::Sync + 'static { 171 + async fn tree_get_entries( 172 + &self, 173 + request: tonic::Request<super::TreeGetEntriesRequest>, 174 + ) -> std::result::Result< 175 + tonic::Response<super::TreeGetEntriesResponse>, 176 + tonic::Status, 177 + >; 178 + } 179 + #[derive(Debug)] 180 + pub struct BrowseServiceServer<T> { 181 + inner: Arc<T>, 182 + accept_compression_encodings: EnabledCompressionEncodings, 183 + send_compression_encodings: EnabledCompressionEncodings, 184 + max_decoding_message_size: Option<usize>, 185 + max_encoding_message_size: Option<usize>, 186 + } 187 + impl<T> BrowseServiceServer<T> { 188 + pub fn new(inner: T) -> Self { 189 + Self::from_arc(Arc::new(inner)) 190 + } 191 + pub fn from_arc(inner: Arc<T>) -> Self { 192 + Self { 193 + inner, 194 + accept_compression_encodings: Default::default(), 195 + send_compression_encodings: Default::default(), 196 + max_decoding_message_size: None, 197 + max_encoding_message_size: None, 198 + } 199 + } 200 + pub fn with_interceptor<F>( 201 + inner: T, 202 + interceptor: F, 203 + ) -> InterceptedService<Self, F> 204 + where 205 + F: tonic::service::Interceptor, 206 + { 207 + InterceptedService::new(Self::new(inner), interceptor) 208 + } 209 + /// Enable decompressing requests with the given encoding. 210 + #[must_use] 211 + pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { 212 + self.accept_compression_encodings.enable(encoding); 213 + self 214 + } 215 + /// Compress responses with the given encoding, if the client supports it. 216 + #[must_use] 217 + pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { 218 + self.send_compression_encodings.enable(encoding); 219 + self 220 + } 221 + /// Limits the maximum size of a decoded message. 222 + /// 223 + /// Default: `4MB` 224 + #[must_use] 225 + pub fn max_decoding_message_size(mut self, limit: usize) -> Self { 226 + self.max_decoding_message_size = Some(limit); 227 + self 228 + } 229 + /// Limits the maximum size of an encoded message. 230 + /// 231 + /// Default: `usize::MAX` 232 + #[must_use] 233 + pub fn max_encoding_message_size(mut self, limit: usize) -> Self { 234 + self.max_encoding_message_size = Some(limit); 235 + self 236 + } 237 + } 238 + impl<T, B> tonic::codegen::Service<http::Request<B>> for BrowseServiceServer<T> 239 + where 240 + T: BrowseService, 241 + B: Body + std::marker::Send + 'static, 242 + B::Error: Into<StdError> + std::marker::Send + 'static, 243 + { 244 + type Response = http::Response<tonic::body::BoxBody>; 245 + type Error = std::convert::Infallible; 246 + type Future = BoxFuture<Self::Response, Self::Error>; 247 + fn poll_ready( 248 + &mut self, 249 + _cx: &mut Context<'_>, 250 + ) -> Poll<std::result::Result<(), Self::Error>> { 251 + Poll::Ready(Ok(())) 252 + } 253 + fn call(&mut self, req: http::Request<B>) -> Self::Future { 254 + match req.uri().path() { 255 + "/rockbox.v1alpha1.BrowseService/TreeGetEntries" => { 256 + #[allow(non_camel_case_types)] 257 + struct TreeGetEntriesSvc<T: BrowseService>(pub Arc<T>); 258 + impl< 259 + T: BrowseService, 260 + > tonic::server::UnaryService<super::TreeGetEntriesRequest> 261 + for TreeGetEntriesSvc<T> { 262 + type Response = super::TreeGetEntriesResponse; 263 + type Future = BoxFuture< 264 + tonic::Response<Self::Response>, 265 + tonic::Status, 266 + >; 267 + fn call( 268 + &mut self, 269 + request: tonic::Request<super::TreeGetEntriesRequest>, 270 + ) -> Self::Future { 271 + let inner = Arc::clone(&self.0); 272 + let fut = async move { 273 + <T as BrowseService>::tree_get_entries(&inner, request) 274 + .await 275 + }; 276 + Box::pin(fut) 277 + } 278 + } 279 + let accept_compression_encodings = self.accept_compression_encodings; 280 + let send_compression_encodings = self.send_compression_encodings; 281 + let max_decoding_message_size = self.max_decoding_message_size; 282 + let max_encoding_message_size = self.max_encoding_message_size; 283 + let inner = self.inner.clone(); 284 + let fut = async move { 285 + let method = TreeGetEntriesSvc(inner); 286 + let codec = tonic::codec::ProstCodec::default(); 287 + let mut grpc = tonic::server::Grpc::new(codec) 288 + .apply_compression_config( 289 + accept_compression_encodings, 290 + send_compression_encodings, 291 + ) 292 + .apply_max_message_size_config( 293 + max_decoding_message_size, 294 + max_encoding_message_size, 295 + ); 296 + let res = grpc.unary(method, req).await; 297 + Ok(res) 298 + }; 299 + Box::pin(fut) 300 + } 301 + _ => { 302 + Box::pin(async move { 303 + let mut response = http::Response::new(empty_body()); 304 + let headers = response.headers_mut(); 305 + headers 306 + .insert( 307 + tonic::Status::GRPC_STATUS, 308 + (tonic::Code::Unimplemented as i32).into(), 309 + ); 310 + headers 311 + .insert( 312 + http::header::CONTENT_TYPE, 313 + tonic::metadata::GRPC_CONTENT_TYPE, 314 + ); 315 + Ok(response) 316 + }) 317 + } 318 + } 319 + } 320 + } 321 + impl<T> Clone for BrowseServiceServer<T> { 322 + fn clone(&self) -> Self { 323 + let inner = self.inner.clone(); 324 + Self { 325 + inner, 326 + accept_compression_encodings: self.accept_compression_encodings, 327 + send_compression_encodings: self.send_compression_encodings, 328 + max_decoding_message_size: self.max_decoding_message_size, 329 + max_encoding_message_size: self.max_encoding_message_size, 330 + } 331 + } 332 + } 333 + /// Generated gRPC service name 334 + pub const SERVICE_NAME: &str = "rockbox.v1alpha1.BrowseService"; 335 + impl<T> tonic::server::NamedService for BrowseServiceServer<T> { 336 + const NAME: &'static str = SERVICE_NAME; 337 + } 338 + } 339 + #[derive(Clone, PartialEq, ::prost::Message)] 340 + pub struct Track { 341 + #[prost(string, tag = "1")] 342 + pub id: ::prost::alloc::string::String, 343 + #[prost(string, tag = "2")] 344 + pub path: ::prost::alloc::string::String, 345 + #[prost(string, tag = "3")] 346 + pub title: ::prost::alloc::string::String, 347 + #[prost(string, tag = "4")] 348 + pub artist: ::prost::alloc::string::String, 349 + #[prost(string, tag = "5")] 350 + pub album: ::prost::alloc::string::String, 351 + #[prost(string, tag = "6")] 352 + pub album_artist: ::prost::alloc::string::String, 353 + #[prost(uint32, tag = "7")] 354 + pub bitrate: u32, 355 + #[prost(string, tag = "8")] 356 + pub composer: ::prost::alloc::string::String, 357 + #[prost(uint32, tag = "9")] 358 + pub disc_number: u32, 359 + #[prost(uint32, tag = "10")] 360 + pub filesize: u32, 361 + #[prost(uint32, tag = "11")] 362 + pub frequency: u32, 363 + #[prost(uint32, tag = "12")] 364 + pub length: u32, 365 + #[prost(uint32, tag = "13")] 366 + pub track_number: u32, 367 + #[prost(uint32, tag = "14")] 368 + pub year: u32, 369 + #[prost(string, tag = "15")] 370 + pub year_string: ::prost::alloc::string::String, 371 + #[prost(string, tag = "16")] 372 + pub genre: ::prost::alloc::string::String, 373 + #[prost(string, tag = "17")] 374 + pub md5: ::prost::alloc::string::String, 375 + #[prost(string, optional, tag = "18")] 376 + pub album_art: ::core::option::Option<::prost::alloc::string::String>, 377 + #[prost(string, optional, tag = "19")] 378 + pub artist_id: ::core::option::Option<::prost::alloc::string::String>, 379 + #[prost(string, optional, tag = "20")] 380 + pub album_id: ::core::option::Option<::prost::alloc::string::String>, 381 + #[prost(string, optional, tag = "21")] 382 + pub genre_id: ::core::option::Option<::prost::alloc::string::String>, 383 + #[prost(string, tag = "22")] 384 + pub created_at: ::prost::alloc::string::String, 385 + #[prost(string, tag = "23")] 386 + pub updated_at: ::prost::alloc::string::String, 387 + } 388 + #[derive(Clone, PartialEq, ::prost::Message)] 389 + pub struct Artist { 390 + #[prost(string, tag = "1")] 391 + pub id: ::prost::alloc::string::String, 392 + #[prost(string, tag = "2")] 393 + pub name: ::prost::alloc::string::String, 394 + #[prost(string, optional, tag = "3")] 395 + pub bio: ::core::option::Option<::prost::alloc::string::String>, 396 + #[prost(string, optional, tag = "4")] 397 + pub image: ::core::option::Option<::prost::alloc::string::String>, 398 + #[prost(message, repeated, tag = "5")] 399 + pub albums: ::prost::alloc::vec::Vec<Album>, 400 + #[prost(message, repeated, tag = "6")] 401 + pub tracks: ::prost::alloc::vec::Vec<Track>, 402 + } 403 + #[derive(Clone, PartialEq, ::prost::Message)] 404 + pub struct Album { 405 + #[prost(string, tag = "1")] 406 + pub id: ::prost::alloc::string::String, 407 + #[prost(string, tag = "2")] 408 + pub title: ::prost::alloc::string::String, 409 + #[prost(string, tag = "3")] 410 + pub artist: ::prost::alloc::string::String, 411 + #[prost(uint32, tag = "4")] 412 + pub year: u32, 413 + #[prost(string, tag = "5")] 414 + pub year_string: ::prost::alloc::string::String, 415 + #[prost(string, optional, tag = "6")] 416 + pub album_art: ::core::option::Option<::prost::alloc::string::String>, 417 + #[prost(string, tag = "7")] 418 + pub md5: ::prost::alloc::string::String, 419 + #[prost(string, tag = "8")] 420 + pub artist_id: ::prost::alloc::string::String, 421 + #[prost(message, repeated, tag = "9")] 422 + pub tracks: ::prost::alloc::vec::Vec<Track>, 423 + } 424 + #[derive(Clone, PartialEq, ::prost::Message)] 425 + pub struct GetAlbumRequest { 426 + #[prost(string, tag = "1")] 427 + pub id: ::prost::alloc::string::String, 428 + } 429 + #[derive(Clone, PartialEq, ::prost::Message)] 430 + pub struct GetAlbumResponse { 431 + #[prost(message, optional, tag = "1")] 432 + pub album: ::core::option::Option<Album>, 433 + } 434 + #[derive(Clone, PartialEq, ::prost::Message)] 435 + pub struct GetArtistRequest { 436 + #[prost(string, tag = "1")] 437 + pub id: ::prost::alloc::string::String, 438 + } 439 + #[derive(Clone, PartialEq, ::prost::Message)] 440 + pub struct GetArtistResponse { 441 + #[prost(message, optional, tag = "1")] 442 + pub artist: ::core::option::Option<Artist>, 443 + } 444 + #[derive(Clone, PartialEq, ::prost::Message)] 445 + pub struct GetTrackRequest { 446 + #[prost(string, tag = "1")] 447 + pub id: ::prost::alloc::string::String, 448 + } 449 + #[derive(Clone, PartialEq, ::prost::Message)] 450 + pub struct GetTrackResponse { 451 + #[prost(message, optional, tag = "1")] 452 + pub track: ::core::option::Option<Track>, 453 + } 454 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 455 + pub struct GetAlbumsRequest {} 456 + #[derive(Clone, PartialEq, ::prost::Message)] 457 + pub struct GetAlbumsResponse { 458 + #[prost(message, repeated, tag = "1")] 459 + pub albums: ::prost::alloc::vec::Vec<Album>, 460 + } 461 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 462 + pub struct GetArtistsRequest {} 463 + #[derive(Clone, PartialEq, ::prost::Message)] 464 + pub struct GetArtistsResponse { 465 + #[prost(message, repeated, tag = "1")] 466 + pub artists: ::prost::alloc::vec::Vec<Artist>, 467 + } 468 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 469 + pub struct GetTracksRequest {} 470 + #[derive(Clone, PartialEq, ::prost::Message)] 471 + pub struct GetTracksResponse { 472 + #[prost(message, repeated, tag = "1")] 473 + pub tracks: ::prost::alloc::vec::Vec<Track>, 474 + } 475 + #[derive(Clone, PartialEq, ::prost::Message)] 476 + pub struct LikeTrackRequest { 477 + #[prost(string, tag = "1")] 478 + pub id: ::prost::alloc::string::String, 479 + } 480 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 481 + pub struct LikeTrackResponse {} 482 + #[derive(Clone, PartialEq, ::prost::Message)] 483 + pub struct LikeAlbumRequest { 484 + #[prost(string, tag = "1")] 485 + pub id: ::prost::alloc::string::String, 486 + } 487 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 488 + pub struct LikeAlbumResponse {} 489 + #[derive(Clone, PartialEq, ::prost::Message)] 490 + pub struct UnlikeTrackRequest { 491 + #[prost(string, tag = "1")] 492 + pub id: ::prost::alloc::string::String, 493 + } 494 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 495 + pub struct UnlikeTrackResponse {} 496 + #[derive(Clone, PartialEq, ::prost::Message)] 497 + pub struct UnlikeAlbumRequest { 498 + #[prost(string, tag = "1")] 499 + pub id: ::prost::alloc::string::String, 500 + } 501 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 502 + pub struct UnlikeAlbumResponse {} 503 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 504 + pub struct GetLikedTracksRequest {} 505 + #[derive(Clone, PartialEq, ::prost::Message)] 506 + pub struct GetLikedTracksResponse { 507 + #[prost(message, repeated, tag = "1")] 508 + pub tracks: ::prost::alloc::vec::Vec<Track>, 509 + } 510 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 511 + pub struct GetLikedAlbumsRequest {} 512 + #[derive(Clone, PartialEq, ::prost::Message)] 513 + pub struct GetLikedAlbumsResponse { 514 + #[prost(message, repeated, tag = "1")] 515 + pub albums: ::prost::alloc::vec::Vec<Album>, 516 + } 517 + #[derive(Clone, PartialEq, ::prost::Message)] 518 + pub struct ScanLibraryRequest { 519 + #[prost(string, optional, tag = "1")] 520 + pub path: ::core::option::Option<::prost::alloc::string::String>, 521 + } 522 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 523 + pub struct ScanLibraryResponse {} 524 + #[derive(Clone, PartialEq, ::prost::Message)] 525 + pub struct SearchRequest { 526 + #[prost(string, tag = "1")] 527 + pub term: ::prost::alloc::string::String, 528 + } 529 + #[derive(Clone, PartialEq, ::prost::Message)] 530 + pub struct SearchResponse { 531 + #[prost(message, repeated, tag = "1")] 532 + pub tracks: ::prost::alloc::vec::Vec<Track>, 533 + #[prost(message, repeated, tag = "2")] 534 + pub albums: ::prost::alloc::vec::Vec<Album>, 535 + #[prost(message, repeated, tag = "3")] 536 + pub artists: ::prost::alloc::vec::Vec<Artist>, 537 + } 538 + /// Generated client implementations. 539 + pub mod library_service_client { 540 + #![allow( 541 + unused_variables, 542 + dead_code, 543 + missing_docs, 544 + clippy::wildcard_imports, 545 + clippy::let_unit_value, 546 + )] 547 + use tonic::codegen::*; 548 + use tonic::codegen::http::Uri; 549 + #[derive(Debug, Clone)] 550 + pub struct LibraryServiceClient<T> { 551 + inner: tonic::client::Grpc<T>, 552 + } 553 + impl LibraryServiceClient<tonic::transport::Channel> { 554 + /// Attempt to create a new client by connecting to a given endpoint. 555 + pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error> 556 + where 557 + D: TryInto<tonic::transport::Endpoint>, 558 + D::Error: Into<StdError>, 559 + { 560 + let conn = tonic::transport::Endpoint::new(dst)?.connect().await?; 561 + Ok(Self::new(conn)) 562 + } 563 + } 564 + impl<T> LibraryServiceClient<T> 565 + where 566 + T: tonic::client::GrpcService<tonic::body::BoxBody>, 567 + T::Error: Into<StdError>, 568 + T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static, 569 + <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send, 570 + { 571 + pub fn new(inner: T) -> Self { 572 + let inner = tonic::client::Grpc::new(inner); 573 + Self { inner } 574 + } 575 + pub fn with_origin(inner: T, origin: Uri) -> Self { 576 + let inner = tonic::client::Grpc::with_origin(inner, origin); 577 + Self { inner } 578 + } 579 + pub fn with_interceptor<F>( 580 + inner: T, 581 + interceptor: F, 582 + ) -> LibraryServiceClient<InterceptedService<T, F>> 583 + where 584 + F: tonic::service::Interceptor, 585 + T::ResponseBody: Default, 586 + T: tonic::codegen::Service< 587 + http::Request<tonic::body::BoxBody>, 588 + Response = http::Response< 589 + <T as tonic::client::GrpcService<tonic::body::BoxBody>>::ResponseBody, 590 + >, 591 + >, 592 + <T as tonic::codegen::Service< 593 + http::Request<tonic::body::BoxBody>, 594 + >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync, 595 + { 596 + LibraryServiceClient::new(InterceptedService::new(inner, interceptor)) 597 + } 598 + /// Compress requests with the given encoding. 599 + /// 600 + /// This requires the server to support it otherwise it might respond with an 601 + /// error. 602 + #[must_use] 603 + pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { 604 + self.inner = self.inner.send_compressed(encoding); 605 + self 606 + } 607 + /// Enable decompressing responses. 608 + #[must_use] 609 + pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { 610 + self.inner = self.inner.accept_compressed(encoding); 611 + self 612 + } 613 + /// Limits the maximum size of a decoded message. 614 + /// 615 + /// Default: `4MB` 616 + #[must_use] 617 + pub fn max_decoding_message_size(mut self, limit: usize) -> Self { 618 + self.inner = self.inner.max_decoding_message_size(limit); 619 + self 620 + } 621 + /// Limits the maximum size of an encoded message. 622 + /// 623 + /// Default: `usize::MAX` 624 + #[must_use] 625 + pub fn max_encoding_message_size(mut self, limit: usize) -> Self { 626 + self.inner = self.inner.max_encoding_message_size(limit); 627 + self 628 + } 629 + pub async fn get_albums( 630 + &mut self, 631 + request: impl tonic::IntoRequest<super::GetAlbumsRequest>, 632 + ) -> std::result::Result< 633 + tonic::Response<super::GetAlbumsResponse>, 634 + tonic::Status, 635 + > { 636 + self.inner 637 + .ready() 638 + .await 639 + .map_err(|e| { 640 + tonic::Status::unknown( 641 + format!("Service was not ready: {}", e.into()), 642 + ) 643 + })?; 644 + let codec = tonic::codec::ProstCodec::default(); 645 + let path = http::uri::PathAndQuery::from_static( 646 + "/rockbox.v1alpha1.LibraryService/GetAlbums", 647 + ); 648 + let mut req = request.into_request(); 649 + req.extensions_mut() 650 + .insert(GrpcMethod::new("rockbox.v1alpha1.LibraryService", "GetAlbums")); 651 + self.inner.unary(req, path, codec).await 652 + } 653 + pub async fn get_artists( 654 + &mut self, 655 + request: impl tonic::IntoRequest<super::GetArtistsRequest>, 656 + ) -> std::result::Result< 657 + tonic::Response<super::GetArtistsResponse>, 658 + tonic::Status, 659 + > { 660 + self.inner 661 + .ready() 662 + .await 663 + .map_err(|e| { 664 + tonic::Status::unknown( 665 + format!("Service was not ready: {}", e.into()), 666 + ) 667 + })?; 668 + let codec = tonic::codec::ProstCodec::default(); 669 + let path = http::uri::PathAndQuery::from_static( 670 + "/rockbox.v1alpha1.LibraryService/GetArtists", 671 + ); 672 + let mut req = request.into_request(); 673 + req.extensions_mut() 674 + .insert( 675 + GrpcMethod::new("rockbox.v1alpha1.LibraryService", "GetArtists"), 676 + ); 677 + self.inner.unary(req, path, codec).await 678 + } 679 + pub async fn get_tracks( 680 + &mut self, 681 + request: impl tonic::IntoRequest<super::GetTracksRequest>, 682 + ) -> std::result::Result< 683 + tonic::Response<super::GetTracksResponse>, 684 + tonic::Status, 685 + > { 686 + self.inner 687 + .ready() 688 + .await 689 + .map_err(|e| { 690 + tonic::Status::unknown( 691 + format!("Service was not ready: {}", e.into()), 692 + ) 693 + })?; 694 + let codec = tonic::codec::ProstCodec::default(); 695 + let path = http::uri::PathAndQuery::from_static( 696 + "/rockbox.v1alpha1.LibraryService/GetTracks", 697 + ); 698 + let mut req = request.into_request(); 699 + req.extensions_mut() 700 + .insert(GrpcMethod::new("rockbox.v1alpha1.LibraryService", "GetTracks")); 701 + self.inner.unary(req, path, codec).await 702 + } 703 + pub async fn get_album( 704 + &mut self, 705 + request: impl tonic::IntoRequest<super::GetAlbumRequest>, 706 + ) -> std::result::Result< 707 + tonic::Response<super::GetAlbumResponse>, 708 + tonic::Status, 709 + > { 710 + self.inner 711 + .ready() 712 + .await 713 + .map_err(|e| { 714 + tonic::Status::unknown( 715 + format!("Service was not ready: {}", e.into()), 716 + ) 717 + })?; 718 + let codec = tonic::codec::ProstCodec::default(); 719 + let path = http::uri::PathAndQuery::from_static( 720 + "/rockbox.v1alpha1.LibraryService/GetAlbum", 721 + ); 722 + let mut req = request.into_request(); 723 + req.extensions_mut() 724 + .insert(GrpcMethod::new("rockbox.v1alpha1.LibraryService", "GetAlbum")); 725 + self.inner.unary(req, path, codec).await 726 + } 727 + pub async fn get_artist( 728 + &mut self, 729 + request: impl tonic::IntoRequest<super::GetArtistRequest>, 730 + ) -> std::result::Result< 731 + tonic::Response<super::GetArtistResponse>, 732 + tonic::Status, 733 + > { 734 + self.inner 735 + .ready() 736 + .await 737 + .map_err(|e| { 738 + tonic::Status::unknown( 739 + format!("Service was not ready: {}", e.into()), 740 + ) 741 + })?; 742 + let codec = tonic::codec::ProstCodec::default(); 743 + let path = http::uri::PathAndQuery::from_static( 744 + "/rockbox.v1alpha1.LibraryService/GetArtist", 745 + ); 746 + let mut req = request.into_request(); 747 + req.extensions_mut() 748 + .insert(GrpcMethod::new("rockbox.v1alpha1.LibraryService", "GetArtist")); 749 + self.inner.unary(req, path, codec).await 750 + } 751 + pub async fn get_track( 752 + &mut self, 753 + request: impl tonic::IntoRequest<super::GetTrackRequest>, 754 + ) -> std::result::Result< 755 + tonic::Response<super::GetTrackResponse>, 756 + tonic::Status, 757 + > { 758 + self.inner 759 + .ready() 760 + .await 761 + .map_err(|e| { 762 + tonic::Status::unknown( 763 + format!("Service was not ready: {}", e.into()), 764 + ) 765 + })?; 766 + let codec = tonic::codec::ProstCodec::default(); 767 + let path = http::uri::PathAndQuery::from_static( 768 + "/rockbox.v1alpha1.LibraryService/GetTrack", 769 + ); 770 + let mut req = request.into_request(); 771 + req.extensions_mut() 772 + .insert(GrpcMethod::new("rockbox.v1alpha1.LibraryService", "GetTrack")); 773 + self.inner.unary(req, path, codec).await 774 + } 775 + pub async fn like_track( 776 + &mut self, 777 + request: impl tonic::IntoRequest<super::LikeTrackRequest>, 778 + ) -> std::result::Result< 779 + tonic::Response<super::LikeTrackResponse>, 780 + tonic::Status, 781 + > { 782 + self.inner 783 + .ready() 784 + .await 785 + .map_err(|e| { 786 + tonic::Status::unknown( 787 + format!("Service was not ready: {}", e.into()), 788 + ) 789 + })?; 790 + let codec = tonic::codec::ProstCodec::default(); 791 + let path = http::uri::PathAndQuery::from_static( 792 + "/rockbox.v1alpha1.LibraryService/LikeTrack", 793 + ); 794 + let mut req = request.into_request(); 795 + req.extensions_mut() 796 + .insert(GrpcMethod::new("rockbox.v1alpha1.LibraryService", "LikeTrack")); 797 + self.inner.unary(req, path, codec).await 798 + } 799 + pub async fn unlike_track( 800 + &mut self, 801 + request: impl tonic::IntoRequest<super::UnlikeTrackRequest>, 802 + ) -> std::result::Result< 803 + tonic::Response<super::UnlikeTrackResponse>, 804 + tonic::Status, 805 + > { 806 + self.inner 807 + .ready() 808 + .await 809 + .map_err(|e| { 810 + tonic::Status::unknown( 811 + format!("Service was not ready: {}", e.into()), 812 + ) 813 + })?; 814 + let codec = tonic::codec::ProstCodec::default(); 815 + let path = http::uri::PathAndQuery::from_static( 816 + "/rockbox.v1alpha1.LibraryService/UnlikeTrack", 817 + ); 818 + let mut req = request.into_request(); 819 + req.extensions_mut() 820 + .insert( 821 + GrpcMethod::new("rockbox.v1alpha1.LibraryService", "UnlikeTrack"), 822 + ); 823 + self.inner.unary(req, path, codec).await 824 + } 825 + pub async fn like_album( 826 + &mut self, 827 + request: impl tonic::IntoRequest<super::LikeAlbumRequest>, 828 + ) -> std::result::Result< 829 + tonic::Response<super::LikeAlbumResponse>, 830 + tonic::Status, 831 + > { 832 + self.inner 833 + .ready() 834 + .await 835 + .map_err(|e| { 836 + tonic::Status::unknown( 837 + format!("Service was not ready: {}", e.into()), 838 + ) 839 + })?; 840 + let codec = tonic::codec::ProstCodec::default(); 841 + let path = http::uri::PathAndQuery::from_static( 842 + "/rockbox.v1alpha1.LibraryService/LikeAlbum", 843 + ); 844 + let mut req = request.into_request(); 845 + req.extensions_mut() 846 + .insert(GrpcMethod::new("rockbox.v1alpha1.LibraryService", "LikeAlbum")); 847 + self.inner.unary(req, path, codec).await 848 + } 849 + pub async fn unlike_album( 850 + &mut self, 851 + request: impl tonic::IntoRequest<super::UnlikeAlbumRequest>, 852 + ) -> std::result::Result< 853 + tonic::Response<super::UnlikeAlbumResponse>, 854 + tonic::Status, 855 + > { 856 + self.inner 857 + .ready() 858 + .await 859 + .map_err(|e| { 860 + tonic::Status::unknown( 861 + format!("Service was not ready: {}", e.into()), 862 + ) 863 + })?; 864 + let codec = tonic::codec::ProstCodec::default(); 865 + let path = http::uri::PathAndQuery::from_static( 866 + "/rockbox.v1alpha1.LibraryService/UnlikeAlbum", 867 + ); 868 + let mut req = request.into_request(); 869 + req.extensions_mut() 870 + .insert( 871 + GrpcMethod::new("rockbox.v1alpha1.LibraryService", "UnlikeAlbum"), 872 + ); 873 + self.inner.unary(req, path, codec).await 874 + } 875 + pub async fn get_liked_tracks( 876 + &mut self, 877 + request: impl tonic::IntoRequest<super::GetLikedTracksRequest>, 878 + ) -> std::result::Result< 879 + tonic::Response<super::GetLikedTracksResponse>, 880 + tonic::Status, 881 + > { 882 + self.inner 883 + .ready() 884 + .await 885 + .map_err(|e| { 886 + tonic::Status::unknown( 887 + format!("Service was not ready: {}", e.into()), 888 + ) 889 + })?; 890 + let codec = tonic::codec::ProstCodec::default(); 891 + let path = http::uri::PathAndQuery::from_static( 892 + "/rockbox.v1alpha1.LibraryService/GetLikedTracks", 893 + ); 894 + let mut req = request.into_request(); 895 + req.extensions_mut() 896 + .insert( 897 + GrpcMethod::new("rockbox.v1alpha1.LibraryService", "GetLikedTracks"), 898 + ); 899 + self.inner.unary(req, path, codec).await 900 + } 901 + pub async fn get_liked_albums( 902 + &mut self, 903 + request: impl tonic::IntoRequest<super::GetLikedAlbumsRequest>, 904 + ) -> std::result::Result< 905 + tonic::Response<super::GetLikedAlbumsResponse>, 906 + tonic::Status, 907 + > { 908 + self.inner 909 + .ready() 910 + .await 911 + .map_err(|e| { 912 + tonic::Status::unknown( 913 + format!("Service was not ready: {}", e.into()), 914 + ) 915 + })?; 916 + let codec = tonic::codec::ProstCodec::default(); 917 + let path = http::uri::PathAndQuery::from_static( 918 + "/rockbox.v1alpha1.LibraryService/GetLikedAlbums", 919 + ); 920 + let mut req = request.into_request(); 921 + req.extensions_mut() 922 + .insert( 923 + GrpcMethod::new("rockbox.v1alpha1.LibraryService", "GetLikedAlbums"), 924 + ); 925 + self.inner.unary(req, path, codec).await 926 + } 927 + pub async fn scan_library( 928 + &mut self, 929 + request: impl tonic::IntoRequest<super::ScanLibraryRequest>, 930 + ) -> std::result::Result< 931 + tonic::Response<super::ScanLibraryResponse>, 932 + tonic::Status, 933 + > { 934 + self.inner 935 + .ready() 936 + .await 937 + .map_err(|e| { 938 + tonic::Status::unknown( 939 + format!("Service was not ready: {}", e.into()), 940 + ) 941 + })?; 942 + let codec = tonic::codec::ProstCodec::default(); 943 + let path = http::uri::PathAndQuery::from_static( 944 + "/rockbox.v1alpha1.LibraryService/ScanLibrary", 945 + ); 946 + let mut req = request.into_request(); 947 + req.extensions_mut() 948 + .insert( 949 + GrpcMethod::new("rockbox.v1alpha1.LibraryService", "ScanLibrary"), 950 + ); 951 + self.inner.unary(req, path, codec).await 952 + } 953 + pub async fn search( 954 + &mut self, 955 + request: impl tonic::IntoRequest<super::SearchRequest>, 956 + ) -> std::result::Result<tonic::Response<super::SearchResponse>, tonic::Status> { 957 + self.inner 958 + .ready() 959 + .await 960 + .map_err(|e| { 961 + tonic::Status::unknown( 962 + format!("Service was not ready: {}", e.into()), 963 + ) 964 + })?; 965 + let codec = tonic::codec::ProstCodec::default(); 966 + let path = http::uri::PathAndQuery::from_static( 967 + "/rockbox.v1alpha1.LibraryService/Search", 968 + ); 969 + let mut req = request.into_request(); 970 + req.extensions_mut() 971 + .insert(GrpcMethod::new("rockbox.v1alpha1.LibraryService", "Search")); 972 + self.inner.unary(req, path, codec).await 973 + } 974 + } 975 + } 976 + /// Generated server implementations. 977 + pub mod library_service_server { 978 + #![allow( 979 + unused_variables, 980 + dead_code, 981 + missing_docs, 982 + clippy::wildcard_imports, 983 + clippy::let_unit_value, 984 + )] 985 + use tonic::codegen::*; 986 + /// Generated trait containing gRPC methods that should be implemented for use with LibraryServiceServer. 987 + #[async_trait] 988 + pub trait LibraryService: std::marker::Send + std::marker::Sync + 'static { 989 + async fn get_albums( 990 + &self, 991 + request: tonic::Request<super::GetAlbumsRequest>, 992 + ) -> std::result::Result< 993 + tonic::Response<super::GetAlbumsResponse>, 994 + tonic::Status, 995 + >; 996 + async fn get_artists( 997 + &self, 998 + request: tonic::Request<super::GetArtistsRequest>, 999 + ) -> std::result::Result< 1000 + tonic::Response<super::GetArtistsResponse>, 1001 + tonic::Status, 1002 + >; 1003 + async fn get_tracks( 1004 + &self, 1005 + request: tonic::Request<super::GetTracksRequest>, 1006 + ) -> std::result::Result< 1007 + tonic::Response<super::GetTracksResponse>, 1008 + tonic::Status, 1009 + >; 1010 + async fn get_album( 1011 + &self, 1012 + request: tonic::Request<super::GetAlbumRequest>, 1013 + ) -> std::result::Result< 1014 + tonic::Response<super::GetAlbumResponse>, 1015 + tonic::Status, 1016 + >; 1017 + async fn get_artist( 1018 + &self, 1019 + request: tonic::Request<super::GetArtistRequest>, 1020 + ) -> std::result::Result< 1021 + tonic::Response<super::GetArtistResponse>, 1022 + tonic::Status, 1023 + >; 1024 + async fn get_track( 1025 + &self, 1026 + request: tonic::Request<super::GetTrackRequest>, 1027 + ) -> std::result::Result< 1028 + tonic::Response<super::GetTrackResponse>, 1029 + tonic::Status, 1030 + >; 1031 + async fn like_track( 1032 + &self, 1033 + request: tonic::Request<super::LikeTrackRequest>, 1034 + ) -> std::result::Result< 1035 + tonic::Response<super::LikeTrackResponse>, 1036 + tonic::Status, 1037 + >; 1038 + async fn unlike_track( 1039 + &self, 1040 + request: tonic::Request<super::UnlikeTrackRequest>, 1041 + ) -> std::result::Result< 1042 + tonic::Response<super::UnlikeTrackResponse>, 1043 + tonic::Status, 1044 + >; 1045 + async fn like_album( 1046 + &self, 1047 + request: tonic::Request<super::LikeAlbumRequest>, 1048 + ) -> std::result::Result< 1049 + tonic::Response<super::LikeAlbumResponse>, 1050 + tonic::Status, 1051 + >; 1052 + async fn unlike_album( 1053 + &self, 1054 + request: tonic::Request<super::UnlikeAlbumRequest>, 1055 + ) -> std::result::Result< 1056 + tonic::Response<super::UnlikeAlbumResponse>, 1057 + tonic::Status, 1058 + >; 1059 + async fn get_liked_tracks( 1060 + &self, 1061 + request: tonic::Request<super::GetLikedTracksRequest>, 1062 + ) -> std::result::Result< 1063 + tonic::Response<super::GetLikedTracksResponse>, 1064 + tonic::Status, 1065 + >; 1066 + async fn get_liked_albums( 1067 + &self, 1068 + request: tonic::Request<super::GetLikedAlbumsRequest>, 1069 + ) -> std::result::Result< 1070 + tonic::Response<super::GetLikedAlbumsResponse>, 1071 + tonic::Status, 1072 + >; 1073 + async fn scan_library( 1074 + &self, 1075 + request: tonic::Request<super::ScanLibraryRequest>, 1076 + ) -> std::result::Result< 1077 + tonic::Response<super::ScanLibraryResponse>, 1078 + tonic::Status, 1079 + >; 1080 + async fn search( 1081 + &self, 1082 + request: tonic::Request<super::SearchRequest>, 1083 + ) -> std::result::Result<tonic::Response<super::SearchResponse>, tonic::Status>; 1084 + } 1085 + #[derive(Debug)] 1086 + pub struct LibraryServiceServer<T> { 1087 + inner: Arc<T>, 1088 + accept_compression_encodings: EnabledCompressionEncodings, 1089 + send_compression_encodings: EnabledCompressionEncodings, 1090 + max_decoding_message_size: Option<usize>, 1091 + max_encoding_message_size: Option<usize>, 1092 + } 1093 + impl<T> LibraryServiceServer<T> { 1094 + pub fn new(inner: T) -> Self { 1095 + Self::from_arc(Arc::new(inner)) 1096 + } 1097 + pub fn from_arc(inner: Arc<T>) -> Self { 1098 + Self { 1099 + inner, 1100 + accept_compression_encodings: Default::default(), 1101 + send_compression_encodings: Default::default(), 1102 + max_decoding_message_size: None, 1103 + max_encoding_message_size: None, 1104 + } 1105 + } 1106 + pub fn with_interceptor<F>( 1107 + inner: T, 1108 + interceptor: F, 1109 + ) -> InterceptedService<Self, F> 1110 + where 1111 + F: tonic::service::Interceptor, 1112 + { 1113 + InterceptedService::new(Self::new(inner), interceptor) 1114 + } 1115 + /// Enable decompressing requests with the given encoding. 1116 + #[must_use] 1117 + pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { 1118 + self.accept_compression_encodings.enable(encoding); 1119 + self 1120 + } 1121 + /// Compress responses with the given encoding, if the client supports it. 1122 + #[must_use] 1123 + pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { 1124 + self.send_compression_encodings.enable(encoding); 1125 + self 1126 + } 1127 + /// Limits the maximum size of a decoded message. 1128 + /// 1129 + /// Default: `4MB` 1130 + #[must_use] 1131 + pub fn max_decoding_message_size(mut self, limit: usize) -> Self { 1132 + self.max_decoding_message_size = Some(limit); 1133 + self 1134 + } 1135 + /// Limits the maximum size of an encoded message. 1136 + /// 1137 + /// Default: `usize::MAX` 1138 + #[must_use] 1139 + pub fn max_encoding_message_size(mut self, limit: usize) -> Self { 1140 + self.max_encoding_message_size = Some(limit); 1141 + self 1142 + } 1143 + } 1144 + impl<T, B> tonic::codegen::Service<http::Request<B>> for LibraryServiceServer<T> 1145 + where 1146 + T: LibraryService, 1147 + B: Body + std::marker::Send + 'static, 1148 + B::Error: Into<StdError> + std::marker::Send + 'static, 1149 + { 1150 + type Response = http::Response<tonic::body::BoxBody>; 1151 + type Error = std::convert::Infallible; 1152 + type Future = BoxFuture<Self::Response, Self::Error>; 1153 + fn poll_ready( 1154 + &mut self, 1155 + _cx: &mut Context<'_>, 1156 + ) -> Poll<std::result::Result<(), Self::Error>> { 1157 + Poll::Ready(Ok(())) 1158 + } 1159 + fn call(&mut self, req: http::Request<B>) -> Self::Future { 1160 + match req.uri().path() { 1161 + "/rockbox.v1alpha1.LibraryService/GetAlbums" => { 1162 + #[allow(non_camel_case_types)] 1163 + struct GetAlbumsSvc<T: LibraryService>(pub Arc<T>); 1164 + impl< 1165 + T: LibraryService, 1166 + > tonic::server::UnaryService<super::GetAlbumsRequest> 1167 + for GetAlbumsSvc<T> { 1168 + type Response = super::GetAlbumsResponse; 1169 + type Future = BoxFuture< 1170 + tonic::Response<Self::Response>, 1171 + tonic::Status, 1172 + >; 1173 + fn call( 1174 + &mut self, 1175 + request: tonic::Request<super::GetAlbumsRequest>, 1176 + ) -> Self::Future { 1177 + let inner = Arc::clone(&self.0); 1178 + let fut = async move { 1179 + <T as LibraryService>::get_albums(&inner, request).await 1180 + }; 1181 + Box::pin(fut) 1182 + } 1183 + } 1184 + let accept_compression_encodings = self.accept_compression_encodings; 1185 + let send_compression_encodings = self.send_compression_encodings; 1186 + let max_decoding_message_size = self.max_decoding_message_size; 1187 + let max_encoding_message_size = self.max_encoding_message_size; 1188 + let inner = self.inner.clone(); 1189 + let fut = async move { 1190 + let method = GetAlbumsSvc(inner); 1191 + let codec = tonic::codec::ProstCodec::default(); 1192 + let mut grpc = tonic::server::Grpc::new(codec) 1193 + .apply_compression_config( 1194 + accept_compression_encodings, 1195 + send_compression_encodings, 1196 + ) 1197 + .apply_max_message_size_config( 1198 + max_decoding_message_size, 1199 + max_encoding_message_size, 1200 + ); 1201 + let res = grpc.unary(method, req).await; 1202 + Ok(res) 1203 + }; 1204 + Box::pin(fut) 1205 + } 1206 + "/rockbox.v1alpha1.LibraryService/GetArtists" => { 1207 + #[allow(non_camel_case_types)] 1208 + struct GetArtistsSvc<T: LibraryService>(pub Arc<T>); 1209 + impl< 1210 + T: LibraryService, 1211 + > tonic::server::UnaryService<super::GetArtistsRequest> 1212 + for GetArtistsSvc<T> { 1213 + type Response = super::GetArtistsResponse; 1214 + type Future = BoxFuture< 1215 + tonic::Response<Self::Response>, 1216 + tonic::Status, 1217 + >; 1218 + fn call( 1219 + &mut self, 1220 + request: tonic::Request<super::GetArtistsRequest>, 1221 + ) -> Self::Future { 1222 + let inner = Arc::clone(&self.0); 1223 + let fut = async move { 1224 + <T as LibraryService>::get_artists(&inner, request).await 1225 + }; 1226 + Box::pin(fut) 1227 + } 1228 + } 1229 + let accept_compression_encodings = self.accept_compression_encodings; 1230 + let send_compression_encodings = self.send_compression_encodings; 1231 + let max_decoding_message_size = self.max_decoding_message_size; 1232 + let max_encoding_message_size = self.max_encoding_message_size; 1233 + let inner = self.inner.clone(); 1234 + let fut = async move { 1235 + let method = GetArtistsSvc(inner); 1236 + let codec = tonic::codec::ProstCodec::default(); 1237 + let mut grpc = tonic::server::Grpc::new(codec) 1238 + .apply_compression_config( 1239 + accept_compression_encodings, 1240 + send_compression_encodings, 1241 + ) 1242 + .apply_max_message_size_config( 1243 + max_decoding_message_size, 1244 + max_encoding_message_size, 1245 + ); 1246 + let res = grpc.unary(method, req).await; 1247 + Ok(res) 1248 + }; 1249 + Box::pin(fut) 1250 + } 1251 + "/rockbox.v1alpha1.LibraryService/GetTracks" => { 1252 + #[allow(non_camel_case_types)] 1253 + struct GetTracksSvc<T: LibraryService>(pub Arc<T>); 1254 + impl< 1255 + T: LibraryService, 1256 + > tonic::server::UnaryService<super::GetTracksRequest> 1257 + for GetTracksSvc<T> { 1258 + type Response = super::GetTracksResponse; 1259 + type Future = BoxFuture< 1260 + tonic::Response<Self::Response>, 1261 + tonic::Status, 1262 + >; 1263 + fn call( 1264 + &mut self, 1265 + request: tonic::Request<super::GetTracksRequest>, 1266 + ) -> Self::Future { 1267 + let inner = Arc::clone(&self.0); 1268 + let fut = async move { 1269 + <T as LibraryService>::get_tracks(&inner, request).await 1270 + }; 1271 + Box::pin(fut) 1272 + } 1273 + } 1274 + let accept_compression_encodings = self.accept_compression_encodings; 1275 + let send_compression_encodings = self.send_compression_encodings; 1276 + let max_decoding_message_size = self.max_decoding_message_size; 1277 + let max_encoding_message_size = self.max_encoding_message_size; 1278 + let inner = self.inner.clone(); 1279 + let fut = async move { 1280 + let method = GetTracksSvc(inner); 1281 + let codec = tonic::codec::ProstCodec::default(); 1282 + let mut grpc = tonic::server::Grpc::new(codec) 1283 + .apply_compression_config( 1284 + accept_compression_encodings, 1285 + send_compression_encodings, 1286 + ) 1287 + .apply_max_message_size_config( 1288 + max_decoding_message_size, 1289 + max_encoding_message_size, 1290 + ); 1291 + let res = grpc.unary(method, req).await; 1292 + Ok(res) 1293 + }; 1294 + Box::pin(fut) 1295 + } 1296 + "/rockbox.v1alpha1.LibraryService/GetAlbum" => { 1297 + #[allow(non_camel_case_types)] 1298 + struct GetAlbumSvc<T: LibraryService>(pub Arc<T>); 1299 + impl< 1300 + T: LibraryService, 1301 + > tonic::server::UnaryService<super::GetAlbumRequest> 1302 + for GetAlbumSvc<T> { 1303 + type Response = super::GetAlbumResponse; 1304 + type Future = BoxFuture< 1305 + tonic::Response<Self::Response>, 1306 + tonic::Status, 1307 + >; 1308 + fn call( 1309 + &mut self, 1310 + request: tonic::Request<super::GetAlbumRequest>, 1311 + ) -> Self::Future { 1312 + let inner = Arc::clone(&self.0); 1313 + let fut = async move { 1314 + <T as LibraryService>::get_album(&inner, request).await 1315 + }; 1316 + Box::pin(fut) 1317 + } 1318 + } 1319 + let accept_compression_encodings = self.accept_compression_encodings; 1320 + let send_compression_encodings = self.send_compression_encodings; 1321 + let max_decoding_message_size = self.max_decoding_message_size; 1322 + let max_encoding_message_size = self.max_encoding_message_size; 1323 + let inner = self.inner.clone(); 1324 + let fut = async move { 1325 + let method = GetAlbumSvc(inner); 1326 + let codec = tonic::codec::ProstCodec::default(); 1327 + let mut grpc = tonic::server::Grpc::new(codec) 1328 + .apply_compression_config( 1329 + accept_compression_encodings, 1330 + send_compression_encodings, 1331 + ) 1332 + .apply_max_message_size_config( 1333 + max_decoding_message_size, 1334 + max_encoding_message_size, 1335 + ); 1336 + let res = grpc.unary(method, req).await; 1337 + Ok(res) 1338 + }; 1339 + Box::pin(fut) 1340 + } 1341 + "/rockbox.v1alpha1.LibraryService/GetArtist" => { 1342 + #[allow(non_camel_case_types)] 1343 + struct GetArtistSvc<T: LibraryService>(pub Arc<T>); 1344 + impl< 1345 + T: LibraryService, 1346 + > tonic::server::UnaryService<super::GetArtistRequest> 1347 + for GetArtistSvc<T> { 1348 + type Response = super::GetArtistResponse; 1349 + type Future = BoxFuture< 1350 + tonic::Response<Self::Response>, 1351 + tonic::Status, 1352 + >; 1353 + fn call( 1354 + &mut self, 1355 + request: tonic::Request<super::GetArtistRequest>, 1356 + ) -> Self::Future { 1357 + let inner = Arc::clone(&self.0); 1358 + let fut = async move { 1359 + <T as LibraryService>::get_artist(&inner, request).await 1360 + }; 1361 + Box::pin(fut) 1362 + } 1363 + } 1364 + let accept_compression_encodings = self.accept_compression_encodings; 1365 + let send_compression_encodings = self.send_compression_encodings; 1366 + let max_decoding_message_size = self.max_decoding_message_size; 1367 + let max_encoding_message_size = self.max_encoding_message_size; 1368 + let inner = self.inner.clone(); 1369 + let fut = async move { 1370 + let method = GetArtistSvc(inner); 1371 + let codec = tonic::codec::ProstCodec::default(); 1372 + let mut grpc = tonic::server::Grpc::new(codec) 1373 + .apply_compression_config( 1374 + accept_compression_encodings, 1375 + send_compression_encodings, 1376 + ) 1377 + .apply_max_message_size_config( 1378 + max_decoding_message_size, 1379 + max_encoding_message_size, 1380 + ); 1381 + let res = grpc.unary(method, req).await; 1382 + Ok(res) 1383 + }; 1384 + Box::pin(fut) 1385 + } 1386 + "/rockbox.v1alpha1.LibraryService/GetTrack" => { 1387 + #[allow(non_camel_case_types)] 1388 + struct GetTrackSvc<T: LibraryService>(pub Arc<T>); 1389 + impl< 1390 + T: LibraryService, 1391 + > tonic::server::UnaryService<super::GetTrackRequest> 1392 + for GetTrackSvc<T> { 1393 + type Response = super::GetTrackResponse; 1394 + type Future = BoxFuture< 1395 + tonic::Response<Self::Response>, 1396 + tonic::Status, 1397 + >; 1398 + fn call( 1399 + &mut self, 1400 + request: tonic::Request<super::GetTrackRequest>, 1401 + ) -> Self::Future { 1402 + let inner = Arc::clone(&self.0); 1403 + let fut = async move { 1404 + <T as LibraryService>::get_track(&inner, request).await 1405 + }; 1406 + Box::pin(fut) 1407 + } 1408 + } 1409 + let accept_compression_encodings = self.accept_compression_encodings; 1410 + let send_compression_encodings = self.send_compression_encodings; 1411 + let max_decoding_message_size = self.max_decoding_message_size; 1412 + let max_encoding_message_size = self.max_encoding_message_size; 1413 + let inner = self.inner.clone(); 1414 + let fut = async move { 1415 + let method = GetTrackSvc(inner); 1416 + let codec = tonic::codec::ProstCodec::default(); 1417 + let mut grpc = tonic::server::Grpc::new(codec) 1418 + .apply_compression_config( 1419 + accept_compression_encodings, 1420 + send_compression_encodings, 1421 + ) 1422 + .apply_max_message_size_config( 1423 + max_decoding_message_size, 1424 + max_encoding_message_size, 1425 + ); 1426 + let res = grpc.unary(method, req).await; 1427 + Ok(res) 1428 + }; 1429 + Box::pin(fut) 1430 + } 1431 + "/rockbox.v1alpha1.LibraryService/LikeTrack" => { 1432 + #[allow(non_camel_case_types)] 1433 + struct LikeTrackSvc<T: LibraryService>(pub Arc<T>); 1434 + impl< 1435 + T: LibraryService, 1436 + > tonic::server::UnaryService<super::LikeTrackRequest> 1437 + for LikeTrackSvc<T> { 1438 + type Response = super::LikeTrackResponse; 1439 + type Future = BoxFuture< 1440 + tonic::Response<Self::Response>, 1441 + tonic::Status, 1442 + >; 1443 + fn call( 1444 + &mut self, 1445 + request: tonic::Request<super::LikeTrackRequest>, 1446 + ) -> Self::Future { 1447 + let inner = Arc::clone(&self.0); 1448 + let fut = async move { 1449 + <T as LibraryService>::like_track(&inner, request).await 1450 + }; 1451 + Box::pin(fut) 1452 + } 1453 + } 1454 + let accept_compression_encodings = self.accept_compression_encodings; 1455 + let send_compression_encodings = self.send_compression_encodings; 1456 + let max_decoding_message_size = self.max_decoding_message_size; 1457 + let max_encoding_message_size = self.max_encoding_message_size; 1458 + let inner = self.inner.clone(); 1459 + let fut = async move { 1460 + let method = LikeTrackSvc(inner); 1461 + let codec = tonic::codec::ProstCodec::default(); 1462 + let mut grpc = tonic::server::Grpc::new(codec) 1463 + .apply_compression_config( 1464 + accept_compression_encodings, 1465 + send_compression_encodings, 1466 + ) 1467 + .apply_max_message_size_config( 1468 + max_decoding_message_size, 1469 + max_encoding_message_size, 1470 + ); 1471 + let res = grpc.unary(method, req).await; 1472 + Ok(res) 1473 + }; 1474 + Box::pin(fut) 1475 + } 1476 + "/rockbox.v1alpha1.LibraryService/UnlikeTrack" => { 1477 + #[allow(non_camel_case_types)] 1478 + struct UnlikeTrackSvc<T: LibraryService>(pub Arc<T>); 1479 + impl< 1480 + T: LibraryService, 1481 + > tonic::server::UnaryService<super::UnlikeTrackRequest> 1482 + for UnlikeTrackSvc<T> { 1483 + type Response = super::UnlikeTrackResponse; 1484 + type Future = BoxFuture< 1485 + tonic::Response<Self::Response>, 1486 + tonic::Status, 1487 + >; 1488 + fn call( 1489 + &mut self, 1490 + request: tonic::Request<super::UnlikeTrackRequest>, 1491 + ) -> Self::Future { 1492 + let inner = Arc::clone(&self.0); 1493 + let fut = async move { 1494 + <T as LibraryService>::unlike_track(&inner, request).await 1495 + }; 1496 + Box::pin(fut) 1497 + } 1498 + } 1499 + let accept_compression_encodings = self.accept_compression_encodings; 1500 + let send_compression_encodings = self.send_compression_encodings; 1501 + let max_decoding_message_size = self.max_decoding_message_size; 1502 + let max_encoding_message_size = self.max_encoding_message_size; 1503 + let inner = self.inner.clone(); 1504 + let fut = async move { 1505 + let method = UnlikeTrackSvc(inner); 1506 + let codec = tonic::codec::ProstCodec::default(); 1507 + let mut grpc = tonic::server::Grpc::new(codec) 1508 + .apply_compression_config( 1509 + accept_compression_encodings, 1510 + send_compression_encodings, 1511 + ) 1512 + .apply_max_message_size_config( 1513 + max_decoding_message_size, 1514 + max_encoding_message_size, 1515 + ); 1516 + let res = grpc.unary(method, req).await; 1517 + Ok(res) 1518 + }; 1519 + Box::pin(fut) 1520 + } 1521 + "/rockbox.v1alpha1.LibraryService/LikeAlbum" => { 1522 + #[allow(non_camel_case_types)] 1523 + struct LikeAlbumSvc<T: LibraryService>(pub Arc<T>); 1524 + impl< 1525 + T: LibraryService, 1526 + > tonic::server::UnaryService<super::LikeAlbumRequest> 1527 + for LikeAlbumSvc<T> { 1528 + type Response = super::LikeAlbumResponse; 1529 + type Future = BoxFuture< 1530 + tonic::Response<Self::Response>, 1531 + tonic::Status, 1532 + >; 1533 + fn call( 1534 + &mut self, 1535 + request: tonic::Request<super::LikeAlbumRequest>, 1536 + ) -> Self::Future { 1537 + let inner = Arc::clone(&self.0); 1538 + let fut = async move { 1539 + <T as LibraryService>::like_album(&inner, request).await 1540 + }; 1541 + Box::pin(fut) 1542 + } 1543 + } 1544 + let accept_compression_encodings = self.accept_compression_encodings; 1545 + let send_compression_encodings = self.send_compression_encodings; 1546 + let max_decoding_message_size = self.max_decoding_message_size; 1547 + let max_encoding_message_size = self.max_encoding_message_size; 1548 + let inner = self.inner.clone(); 1549 + let fut = async move { 1550 + let method = LikeAlbumSvc(inner); 1551 + let codec = tonic::codec::ProstCodec::default(); 1552 + let mut grpc = tonic::server::Grpc::new(codec) 1553 + .apply_compression_config( 1554 + accept_compression_encodings, 1555 + send_compression_encodings, 1556 + ) 1557 + .apply_max_message_size_config( 1558 + max_decoding_message_size, 1559 + max_encoding_message_size, 1560 + ); 1561 + let res = grpc.unary(method, req).await; 1562 + Ok(res) 1563 + }; 1564 + Box::pin(fut) 1565 + } 1566 + "/rockbox.v1alpha1.LibraryService/UnlikeAlbum" => { 1567 + #[allow(non_camel_case_types)] 1568 + struct UnlikeAlbumSvc<T: LibraryService>(pub Arc<T>); 1569 + impl< 1570 + T: LibraryService, 1571 + > tonic::server::UnaryService<super::UnlikeAlbumRequest> 1572 + for UnlikeAlbumSvc<T> { 1573 + type Response = super::UnlikeAlbumResponse; 1574 + type Future = BoxFuture< 1575 + tonic::Response<Self::Response>, 1576 + tonic::Status, 1577 + >; 1578 + fn call( 1579 + &mut self, 1580 + request: tonic::Request<super::UnlikeAlbumRequest>, 1581 + ) -> Self::Future { 1582 + let inner = Arc::clone(&self.0); 1583 + let fut = async move { 1584 + <T as LibraryService>::unlike_album(&inner, request).await 1585 + }; 1586 + Box::pin(fut) 1587 + } 1588 + } 1589 + let accept_compression_encodings = self.accept_compression_encodings; 1590 + let send_compression_encodings = self.send_compression_encodings; 1591 + let max_decoding_message_size = self.max_decoding_message_size; 1592 + let max_encoding_message_size = self.max_encoding_message_size; 1593 + let inner = self.inner.clone(); 1594 + let fut = async move { 1595 + let method = UnlikeAlbumSvc(inner); 1596 + let codec = tonic::codec::ProstCodec::default(); 1597 + let mut grpc = tonic::server::Grpc::new(codec) 1598 + .apply_compression_config( 1599 + accept_compression_encodings, 1600 + send_compression_encodings, 1601 + ) 1602 + .apply_max_message_size_config( 1603 + max_decoding_message_size, 1604 + max_encoding_message_size, 1605 + ); 1606 + let res = grpc.unary(method, req).await; 1607 + Ok(res) 1608 + }; 1609 + Box::pin(fut) 1610 + } 1611 + "/rockbox.v1alpha1.LibraryService/GetLikedTracks" => { 1612 + #[allow(non_camel_case_types)] 1613 + struct GetLikedTracksSvc<T: LibraryService>(pub Arc<T>); 1614 + impl< 1615 + T: LibraryService, 1616 + > tonic::server::UnaryService<super::GetLikedTracksRequest> 1617 + for GetLikedTracksSvc<T> { 1618 + type Response = super::GetLikedTracksResponse; 1619 + type Future = BoxFuture< 1620 + tonic::Response<Self::Response>, 1621 + tonic::Status, 1622 + >; 1623 + fn call( 1624 + &mut self, 1625 + request: tonic::Request<super::GetLikedTracksRequest>, 1626 + ) -> Self::Future { 1627 + let inner = Arc::clone(&self.0); 1628 + let fut = async move { 1629 + <T as LibraryService>::get_liked_tracks(&inner, request) 1630 + .await 1631 + }; 1632 + Box::pin(fut) 1633 + } 1634 + } 1635 + let accept_compression_encodings = self.accept_compression_encodings; 1636 + let send_compression_encodings = self.send_compression_encodings; 1637 + let max_decoding_message_size = self.max_decoding_message_size; 1638 + let max_encoding_message_size = self.max_encoding_message_size; 1639 + let inner = self.inner.clone(); 1640 + let fut = async move { 1641 + let method = GetLikedTracksSvc(inner); 1642 + let codec = tonic::codec::ProstCodec::default(); 1643 + let mut grpc = tonic::server::Grpc::new(codec) 1644 + .apply_compression_config( 1645 + accept_compression_encodings, 1646 + send_compression_encodings, 1647 + ) 1648 + .apply_max_message_size_config( 1649 + max_decoding_message_size, 1650 + max_encoding_message_size, 1651 + ); 1652 + let res = grpc.unary(method, req).await; 1653 + Ok(res) 1654 + }; 1655 + Box::pin(fut) 1656 + } 1657 + "/rockbox.v1alpha1.LibraryService/GetLikedAlbums" => { 1658 + #[allow(non_camel_case_types)] 1659 + struct GetLikedAlbumsSvc<T: LibraryService>(pub Arc<T>); 1660 + impl< 1661 + T: LibraryService, 1662 + > tonic::server::UnaryService<super::GetLikedAlbumsRequest> 1663 + for GetLikedAlbumsSvc<T> { 1664 + type Response = super::GetLikedAlbumsResponse; 1665 + type Future = BoxFuture< 1666 + tonic::Response<Self::Response>, 1667 + tonic::Status, 1668 + >; 1669 + fn call( 1670 + &mut self, 1671 + request: tonic::Request<super::GetLikedAlbumsRequest>, 1672 + ) -> Self::Future { 1673 + let inner = Arc::clone(&self.0); 1674 + let fut = async move { 1675 + <T as LibraryService>::get_liked_albums(&inner, request) 1676 + .await 1677 + }; 1678 + Box::pin(fut) 1679 + } 1680 + } 1681 + let accept_compression_encodings = self.accept_compression_encodings; 1682 + let send_compression_encodings = self.send_compression_encodings; 1683 + let max_decoding_message_size = self.max_decoding_message_size; 1684 + let max_encoding_message_size = self.max_encoding_message_size; 1685 + let inner = self.inner.clone(); 1686 + let fut = async move { 1687 + let method = GetLikedAlbumsSvc(inner); 1688 + let codec = tonic::codec::ProstCodec::default(); 1689 + let mut grpc = tonic::server::Grpc::new(codec) 1690 + .apply_compression_config( 1691 + accept_compression_encodings, 1692 + send_compression_encodings, 1693 + ) 1694 + .apply_max_message_size_config( 1695 + max_decoding_message_size, 1696 + max_encoding_message_size, 1697 + ); 1698 + let res = grpc.unary(method, req).await; 1699 + Ok(res) 1700 + }; 1701 + Box::pin(fut) 1702 + } 1703 + "/rockbox.v1alpha1.LibraryService/ScanLibrary" => { 1704 + #[allow(non_camel_case_types)] 1705 + struct ScanLibrarySvc<T: LibraryService>(pub Arc<T>); 1706 + impl< 1707 + T: LibraryService, 1708 + > tonic::server::UnaryService<super::ScanLibraryRequest> 1709 + for ScanLibrarySvc<T> { 1710 + type Response = super::ScanLibraryResponse; 1711 + type Future = BoxFuture< 1712 + tonic::Response<Self::Response>, 1713 + tonic::Status, 1714 + >; 1715 + fn call( 1716 + &mut self, 1717 + request: tonic::Request<super::ScanLibraryRequest>, 1718 + ) -> Self::Future { 1719 + let inner = Arc::clone(&self.0); 1720 + let fut = async move { 1721 + <T as LibraryService>::scan_library(&inner, request).await 1722 + }; 1723 + Box::pin(fut) 1724 + } 1725 + } 1726 + let accept_compression_encodings = self.accept_compression_encodings; 1727 + let send_compression_encodings = self.send_compression_encodings; 1728 + let max_decoding_message_size = self.max_decoding_message_size; 1729 + let max_encoding_message_size = self.max_encoding_message_size; 1730 + let inner = self.inner.clone(); 1731 + let fut = async move { 1732 + let method = ScanLibrarySvc(inner); 1733 + let codec = tonic::codec::ProstCodec::default(); 1734 + let mut grpc = tonic::server::Grpc::new(codec) 1735 + .apply_compression_config( 1736 + accept_compression_encodings, 1737 + send_compression_encodings, 1738 + ) 1739 + .apply_max_message_size_config( 1740 + max_decoding_message_size, 1741 + max_encoding_message_size, 1742 + ); 1743 + let res = grpc.unary(method, req).await; 1744 + Ok(res) 1745 + }; 1746 + Box::pin(fut) 1747 + } 1748 + "/rockbox.v1alpha1.LibraryService/Search" => { 1749 + #[allow(non_camel_case_types)] 1750 + struct SearchSvc<T: LibraryService>(pub Arc<T>); 1751 + impl< 1752 + T: LibraryService, 1753 + > tonic::server::UnaryService<super::SearchRequest> 1754 + for SearchSvc<T> { 1755 + type Response = super::SearchResponse; 1756 + type Future = BoxFuture< 1757 + tonic::Response<Self::Response>, 1758 + tonic::Status, 1759 + >; 1760 + fn call( 1761 + &mut self, 1762 + request: tonic::Request<super::SearchRequest>, 1763 + ) -> Self::Future { 1764 + let inner = Arc::clone(&self.0); 1765 + let fut = async move { 1766 + <T as LibraryService>::search(&inner, request).await 1767 + }; 1768 + Box::pin(fut) 1769 + } 1770 + } 1771 + let accept_compression_encodings = self.accept_compression_encodings; 1772 + let send_compression_encodings = self.send_compression_encodings; 1773 + let max_decoding_message_size = self.max_decoding_message_size; 1774 + let max_encoding_message_size = self.max_encoding_message_size; 1775 + let inner = self.inner.clone(); 1776 + let fut = async move { 1777 + let method = SearchSvc(inner); 1778 + let codec = tonic::codec::ProstCodec::default(); 1779 + let mut grpc = tonic::server::Grpc::new(codec) 1780 + .apply_compression_config( 1781 + accept_compression_encodings, 1782 + send_compression_encodings, 1783 + ) 1784 + .apply_max_message_size_config( 1785 + max_decoding_message_size, 1786 + max_encoding_message_size, 1787 + ); 1788 + let res = grpc.unary(method, req).await; 1789 + Ok(res) 1790 + }; 1791 + Box::pin(fut) 1792 + } 1793 + _ => { 1794 + Box::pin(async move { 1795 + let mut response = http::Response::new(empty_body()); 1796 + let headers = response.headers_mut(); 1797 + headers 1798 + .insert( 1799 + tonic::Status::GRPC_STATUS, 1800 + (tonic::Code::Unimplemented as i32).into(), 1801 + ); 1802 + headers 1803 + .insert( 1804 + http::header::CONTENT_TYPE, 1805 + tonic::metadata::GRPC_CONTENT_TYPE, 1806 + ); 1807 + Ok(response) 1808 + }) 1809 + } 1810 + } 1811 + } 1812 + } 1813 + impl<T> Clone for LibraryServiceServer<T> { 1814 + fn clone(&self) -> Self { 1815 + let inner = self.inner.clone(); 1816 + Self { 1817 + inner, 1818 + accept_compression_encodings: self.accept_compression_encodings, 1819 + send_compression_encodings: self.send_compression_encodings, 1820 + max_decoding_message_size: self.max_decoding_message_size, 1821 + max_encoding_message_size: self.max_encoding_message_size, 1822 + } 1823 + } 1824 + } 1825 + /// Generated gRPC service name 1826 + pub const SERVICE_NAME: &str = "rockbox.v1alpha1.LibraryService"; 1827 + impl<T> tonic::server::NamedService for LibraryServiceServer<T> { 1828 + const NAME: &'static str = SERVICE_NAME; 1829 + } 1830 + } 1831 + /// Generated client implementations. 1832 + pub mod metadata_service_client { 1833 + #![allow( 1834 + unused_variables, 1835 + dead_code, 1836 + missing_docs, 1837 + clippy::wildcard_imports, 1838 + clippy::let_unit_value, 1839 + )] 1840 + use tonic::codegen::*; 1841 + use tonic::codegen::http::Uri; 1842 + #[derive(Debug, Clone)] 1843 + pub struct MetadataServiceClient<T> { 1844 + inner: tonic::client::Grpc<T>, 1845 + } 1846 + impl MetadataServiceClient<tonic::transport::Channel> { 1847 + /// Attempt to create a new client by connecting to a given endpoint. 1848 + pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error> 1849 + where 1850 + D: TryInto<tonic::transport::Endpoint>, 1851 + D::Error: Into<StdError>, 1852 + { 1853 + let conn = tonic::transport::Endpoint::new(dst)?.connect().await?; 1854 + Ok(Self::new(conn)) 1855 + } 1856 + } 1857 + impl<T> MetadataServiceClient<T> 1858 + where 1859 + T: tonic::client::GrpcService<tonic::body::BoxBody>, 1860 + T::Error: Into<StdError>, 1861 + T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static, 1862 + <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send, 1863 + { 1864 + pub fn new(inner: T) -> Self { 1865 + let inner = tonic::client::Grpc::new(inner); 1866 + Self { inner } 1867 + } 1868 + pub fn with_origin(inner: T, origin: Uri) -> Self { 1869 + let inner = tonic::client::Grpc::with_origin(inner, origin); 1870 + Self { inner } 1871 + } 1872 + pub fn with_interceptor<F>( 1873 + inner: T, 1874 + interceptor: F, 1875 + ) -> MetadataServiceClient<InterceptedService<T, F>> 1876 + where 1877 + F: tonic::service::Interceptor, 1878 + T::ResponseBody: Default, 1879 + T: tonic::codegen::Service< 1880 + http::Request<tonic::body::BoxBody>, 1881 + Response = http::Response< 1882 + <T as tonic::client::GrpcService<tonic::body::BoxBody>>::ResponseBody, 1883 + >, 1884 + >, 1885 + <T as tonic::codegen::Service< 1886 + http::Request<tonic::body::BoxBody>, 1887 + >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync, 1888 + { 1889 + MetadataServiceClient::new(InterceptedService::new(inner, interceptor)) 1890 + } 1891 + /// Compress requests with the given encoding. 1892 + /// 1893 + /// This requires the server to support it otherwise it might respond with an 1894 + /// error. 1895 + #[must_use] 1896 + pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { 1897 + self.inner = self.inner.send_compressed(encoding); 1898 + self 1899 + } 1900 + /// Enable decompressing responses. 1901 + #[must_use] 1902 + pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { 1903 + self.inner = self.inner.accept_compressed(encoding); 1904 + self 1905 + } 1906 + /// Limits the maximum size of a decoded message. 1907 + /// 1908 + /// Default: `4MB` 1909 + #[must_use] 1910 + pub fn max_decoding_message_size(mut self, limit: usize) -> Self { 1911 + self.inner = self.inner.max_decoding_message_size(limit); 1912 + self 1913 + } 1914 + /// Limits the maximum size of an encoded message. 1915 + /// 1916 + /// Default: `usize::MAX` 1917 + #[must_use] 1918 + pub fn max_encoding_message_size(mut self, limit: usize) -> Self { 1919 + self.inner = self.inner.max_encoding_message_size(limit); 1920 + self 1921 + } 1922 + } 1923 + } 1924 + /// Generated server implementations. 1925 + pub mod metadata_service_server { 1926 + #![allow( 1927 + unused_variables, 1928 + dead_code, 1929 + missing_docs, 1930 + clippy::wildcard_imports, 1931 + clippy::let_unit_value, 1932 + )] 1933 + use tonic::codegen::*; 1934 + /// Generated trait containing gRPC methods that should be implemented for use with MetadataServiceServer. 1935 + #[async_trait] 1936 + pub trait MetadataService: std::marker::Send + std::marker::Sync + 'static {} 1937 + #[derive(Debug)] 1938 + pub struct MetadataServiceServer<T> { 1939 + inner: Arc<T>, 1940 + accept_compression_encodings: EnabledCompressionEncodings, 1941 + send_compression_encodings: EnabledCompressionEncodings, 1942 + max_decoding_message_size: Option<usize>, 1943 + max_encoding_message_size: Option<usize>, 1944 + } 1945 + impl<T> MetadataServiceServer<T> { 1946 + pub fn new(inner: T) -> Self { 1947 + Self::from_arc(Arc::new(inner)) 1948 + } 1949 + pub fn from_arc(inner: Arc<T>) -> Self { 1950 + Self { 1951 + inner, 1952 + accept_compression_encodings: Default::default(), 1953 + send_compression_encodings: Default::default(), 1954 + max_decoding_message_size: None, 1955 + max_encoding_message_size: None, 1956 + } 1957 + } 1958 + pub fn with_interceptor<F>( 1959 + inner: T, 1960 + interceptor: F, 1961 + ) -> InterceptedService<Self, F> 1962 + where 1963 + F: tonic::service::Interceptor, 1964 + { 1965 + InterceptedService::new(Self::new(inner), interceptor) 1966 + } 1967 + /// Enable decompressing requests with the given encoding. 1968 + #[must_use] 1969 + pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { 1970 + self.accept_compression_encodings.enable(encoding); 1971 + self 1972 + } 1973 + /// Compress responses with the given encoding, if the client supports it. 1974 + #[must_use] 1975 + pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { 1976 + self.send_compression_encodings.enable(encoding); 1977 + self 1978 + } 1979 + /// Limits the maximum size of a decoded message. 1980 + /// 1981 + /// Default: `4MB` 1982 + #[must_use] 1983 + pub fn max_decoding_message_size(mut self, limit: usize) -> Self { 1984 + self.max_decoding_message_size = Some(limit); 1985 + self 1986 + } 1987 + /// Limits the maximum size of an encoded message. 1988 + /// 1989 + /// Default: `usize::MAX` 1990 + #[must_use] 1991 + pub fn max_encoding_message_size(mut self, limit: usize) -> Self { 1992 + self.max_encoding_message_size = Some(limit); 1993 + self 1994 + } 1995 + } 1996 + impl<T, B> tonic::codegen::Service<http::Request<B>> for MetadataServiceServer<T> 1997 + where 1998 + T: MetadataService, 1999 + B: Body + std::marker::Send + 'static, 2000 + B::Error: Into<StdError> + std::marker::Send + 'static, 2001 + { 2002 + type Response = http::Response<tonic::body::BoxBody>; 2003 + type Error = std::convert::Infallible; 2004 + type Future = BoxFuture<Self::Response, Self::Error>; 2005 + fn poll_ready( 2006 + &mut self, 2007 + _cx: &mut Context<'_>, 2008 + ) -> Poll<std::result::Result<(), Self::Error>> { 2009 + Poll::Ready(Ok(())) 2010 + } 2011 + fn call(&mut self, req: http::Request<B>) -> Self::Future { 2012 + match req.uri().path() { 2013 + _ => { 2014 + Box::pin(async move { 2015 + let mut response = http::Response::new(empty_body()); 2016 + let headers = response.headers_mut(); 2017 + headers 2018 + .insert( 2019 + tonic::Status::GRPC_STATUS, 2020 + (tonic::Code::Unimplemented as i32).into(), 2021 + ); 2022 + headers 2023 + .insert( 2024 + http::header::CONTENT_TYPE, 2025 + tonic::metadata::GRPC_CONTENT_TYPE, 2026 + ); 2027 + Ok(response) 2028 + }) 2029 + } 2030 + } 2031 + } 2032 + } 2033 + impl<T> Clone for MetadataServiceServer<T> { 2034 + fn clone(&self) -> Self { 2035 + let inner = self.inner.clone(); 2036 + Self { 2037 + inner, 2038 + accept_compression_encodings: self.accept_compression_encodings, 2039 + send_compression_encodings: self.send_compression_encodings, 2040 + max_decoding_message_size: self.max_decoding_message_size, 2041 + max_encoding_message_size: self.max_encoding_message_size, 2042 + } 2043 + } 2044 + } 2045 + /// Generated gRPC service name 2046 + pub const SERVICE_NAME: &str = "rockbox.v1alpha1.MetadataService"; 2047 + impl<T> tonic::server::NamedService for MetadataServiceServer<T> { 2048 + const NAME: &'static str = SERVICE_NAME; 2049 + } 2050 + } 2051 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 2052 + pub struct PlayRequest { 2053 + #[prost(int64, tag = "1")] 2054 + pub elapsed: i64, 2055 + #[prost(int64, tag = "2")] 2056 + pub offset: i64, 2057 + } 2058 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 2059 + pub struct PlayResponse {} 2060 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 2061 + pub struct PauseRequest {} 2062 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 2063 + pub struct PlayOrPauseRequest {} 2064 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 2065 + pub struct PlayOrPauseResponse {} 2066 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 2067 + pub struct PauseResponse {} 2068 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 2069 + pub struct ResumeRequest {} 2070 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 2071 + pub struct ResumeResponse {} 2072 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 2073 + pub struct NextRequest {} 2074 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 2075 + pub struct NextResponse {} 2076 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 2077 + pub struct PreviousRequest {} 2078 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 2079 + pub struct PreviousResponse {} 2080 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 2081 + pub struct FastForwardRewindRequest { 2082 + #[prost(int32, tag = "1")] 2083 + pub new_time: i32, 2084 + } 2085 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 2086 + pub struct FastForwardRewindResponse {} 2087 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 2088 + pub struct StatusRequest {} 2089 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 2090 + pub struct StreamStatusRequest {} 2091 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 2092 + pub struct StatusResponse { 2093 + #[prost(int32, tag = "1")] 2094 + pub status: i32, 2095 + } 2096 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 2097 + pub struct CurrentTrackRequest {} 2098 + #[derive(Clone, PartialEq, ::prost::Message)] 2099 + pub struct CurrentTrackResponse { 2100 + #[prost(string, tag = "1")] 2101 + pub title: ::prost::alloc::string::String, 2102 + #[prost(string, tag = "2")] 2103 + pub artist: ::prost::alloc::string::String, 2104 + #[prost(string, tag = "3")] 2105 + pub album: ::prost::alloc::string::String, 2106 + #[prost(string, tag = "4")] 2107 + pub genre: ::prost::alloc::string::String, 2108 + #[prost(string, tag = "5")] 2109 + pub disc: ::prost::alloc::string::String, 2110 + #[prost(string, tag = "6")] 2111 + pub track_string: ::prost::alloc::string::String, 2112 + #[prost(string, tag = "7")] 2113 + pub year_string: ::prost::alloc::string::String, 2114 + #[prost(string, tag = "8")] 2115 + pub composer: ::prost::alloc::string::String, 2116 + #[prost(string, tag = "9")] 2117 + pub comment: ::prost::alloc::string::String, 2118 + #[prost(string, tag = "10")] 2119 + pub album_artist: ::prost::alloc::string::String, 2120 + #[prost(string, tag = "11")] 2121 + pub grouping: ::prost::alloc::string::String, 2122 + #[prost(int32, tag = "12")] 2123 + pub discnum: i32, 2124 + #[prost(int32, tag = "13")] 2125 + pub tracknum: i32, 2126 + #[prost(int32, tag = "14")] 2127 + pub layer: i32, 2128 + #[prost(int32, tag = "15")] 2129 + pub year: i32, 2130 + #[prost(uint32, tag = "16")] 2131 + pub bitrate: u32, 2132 + #[prost(uint64, tag = "17")] 2133 + pub frequency: u64, 2134 + #[prost(uint64, tag = "18")] 2135 + pub filesize: u64, 2136 + #[prost(uint64, tag = "19")] 2137 + pub length: u64, 2138 + #[prost(uint64, tag = "20")] 2139 + pub elapsed: u64, 2140 + #[prost(string, tag = "21")] 2141 + pub path: ::prost::alloc::string::String, 2142 + #[prost(string, optional, tag = "22")] 2143 + pub album_art: ::core::option::Option<::prost::alloc::string::String>, 2144 + #[prost(string, tag = "23")] 2145 + pub album_id: ::prost::alloc::string::String, 2146 + #[prost(string, tag = "24")] 2147 + pub artist_id: ::prost::alloc::string::String, 2148 + #[prost(string, tag = "25")] 2149 + pub id: ::prost::alloc::string::String, 2150 + } 2151 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 2152 + pub struct StreamCurrentTrackRequest {} 2153 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 2154 + pub struct NextTrackRequest {} 2155 + #[derive(Clone, PartialEq, ::prost::Message)] 2156 + pub struct NextTrackResponse { 2157 + #[prost(string, tag = "1")] 2158 + pub title: ::prost::alloc::string::String, 2159 + #[prost(string, tag = "2")] 2160 + pub artist: ::prost::alloc::string::String, 2161 + #[prost(string, tag = "3")] 2162 + pub album: ::prost::alloc::string::String, 2163 + #[prost(string, tag = "4")] 2164 + pub genre: ::prost::alloc::string::String, 2165 + #[prost(string, tag = "5")] 2166 + pub disc: ::prost::alloc::string::String, 2167 + #[prost(string, tag = "6")] 2168 + pub track_string: ::prost::alloc::string::String, 2169 + #[prost(string, tag = "7")] 2170 + pub year_string: ::prost::alloc::string::String, 2171 + #[prost(string, tag = "8")] 2172 + pub composer: ::prost::alloc::string::String, 2173 + #[prost(string, tag = "9")] 2174 + pub comment: ::prost::alloc::string::String, 2175 + #[prost(string, tag = "10")] 2176 + pub album_artist: ::prost::alloc::string::String, 2177 + #[prost(string, tag = "11")] 2178 + pub grouping: ::prost::alloc::string::String, 2179 + #[prost(int32, tag = "12")] 2180 + pub discnum: i32, 2181 + #[prost(int32, tag = "13")] 2182 + pub tracknum: i32, 2183 + #[prost(int32, tag = "14")] 2184 + pub layer: i32, 2185 + #[prost(int32, tag = "15")] 2186 + pub year: i32, 2187 + #[prost(uint32, tag = "16")] 2188 + pub bitrate: u32, 2189 + #[prost(uint64, tag = "17")] 2190 + pub frequency: u64, 2191 + #[prost(uint64, tag = "18")] 2192 + pub filesize: u64, 2193 + #[prost(uint64, tag = "19")] 2194 + pub length: u64, 2195 + #[prost(uint64, tag = "20")] 2196 + pub elapsed: u64, 2197 + #[prost(string, tag = "21")] 2198 + pub path: ::prost::alloc::string::String, 2199 + } 2200 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 2201 + pub struct FlushAndReloadTracksRequest {} 2202 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 2203 + pub struct FlushAndReloadTracksResponse {} 2204 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 2205 + pub struct GetFilePositionRequest {} 2206 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 2207 + pub struct GetFilePositionResponse { 2208 + #[prost(int32, tag = "1")] 2209 + pub position: i32, 2210 + } 2211 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 2212 + pub struct HardStopRequest {} 2213 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 2214 + pub struct HardStopResponse {} 2215 + #[derive(Clone, PartialEq, ::prost::Message)] 2216 + pub struct PlayAlbumRequest { 2217 + #[prost(string, tag = "1")] 2218 + pub album_id: ::prost::alloc::string::String, 2219 + #[prost(bool, optional, tag = "2")] 2220 + pub shuffle: ::core::option::Option<bool>, 2221 + #[prost(int32, optional, tag = "3")] 2222 + pub position: ::core::option::Option<i32>, 2223 + } 2224 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 2225 + pub struct PlayAlbumResponse {} 2226 + #[derive(Clone, PartialEq, ::prost::Message)] 2227 + pub struct PlayArtistTracksRequest { 2228 + #[prost(string, tag = "1")] 2229 + pub artist_id: ::prost::alloc::string::String, 2230 + #[prost(bool, optional, tag = "2")] 2231 + pub shuffle: ::core::option::Option<bool>, 2232 + #[prost(int32, optional, tag = "3")] 2233 + pub position: ::core::option::Option<i32>, 2234 + } 2235 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 2236 + pub struct PlayArtistTracksResponse {} 2237 + #[derive(Clone, PartialEq, ::prost::Message)] 2238 + pub struct PlayPlaylistRequest { 2239 + #[prost(string, tag = "1")] 2240 + pub playlist_id: ::prost::alloc::string::String, 2241 + #[prost(bool, optional, tag = "2")] 2242 + pub shuffle: ::core::option::Option<bool>, 2243 + } 2244 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 2245 + pub struct PlayPlaylistResponse {} 2246 + #[derive(Clone, PartialEq, ::prost::Message)] 2247 + pub struct PlayDirectoryRequest { 2248 + #[prost(string, tag = "1")] 2249 + pub path: ::prost::alloc::string::String, 2250 + #[prost(bool, optional, tag = "2")] 2251 + pub shuffle: ::core::option::Option<bool>, 2252 + #[prost(bool, optional, tag = "3")] 2253 + pub recurse: ::core::option::Option<bool>, 2254 + #[prost(int32, optional, tag = "4")] 2255 + pub position: ::core::option::Option<i32>, 2256 + } 2257 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 2258 + pub struct PlayDirectoryResponse {} 2259 + #[derive(Clone, PartialEq, ::prost::Message)] 2260 + pub struct PlayTrackRequest { 2261 + #[prost(string, tag = "1")] 2262 + pub path: ::prost::alloc::string::String, 2263 + } 2264 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 2265 + pub struct PlayTrackResponse {} 2266 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 2267 + pub struct PlayLikedTracksRequest { 2268 + #[prost(bool, optional, tag = "1")] 2269 + pub shuffle: ::core::option::Option<bool>, 2270 + #[prost(int32, optional, tag = "2")] 2271 + pub position: ::core::option::Option<i32>, 2272 + } 2273 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 2274 + pub struct PlayLikedTracksResponse {} 2275 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 2276 + pub struct PlayAllTracksRequest { 2277 + #[prost(bool, optional, tag = "1")] 2278 + pub shuffle: ::core::option::Option<bool>, 2279 + #[prost(int32, optional, tag = "2")] 2280 + pub position: ::core::option::Option<i32>, 2281 + } 2282 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 2283 + pub struct PlayAllTracksResponse {} 2284 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 2285 + pub struct StreamPlaylistRequest {} 2286 + #[derive(Clone, PartialEq, ::prost::Message)] 2287 + pub struct PlaylistResponse { 2288 + #[prost(int32, tag = "1")] 2289 + pub index: i32, 2290 + #[prost(int32, tag = "2")] 2291 + pub amount: i32, 2292 + #[prost(message, repeated, tag = "3")] 2293 + pub tracks: ::prost::alloc::vec::Vec<CurrentTrackResponse>, 2294 + } 2295 + /// Generated client implementations. 2296 + pub mod playback_service_client { 2297 + #![allow( 2298 + unused_variables, 2299 + dead_code, 2300 + missing_docs, 2301 + clippy::wildcard_imports, 2302 + clippy::let_unit_value, 2303 + )] 2304 + use tonic::codegen::*; 2305 + use tonic::codegen::http::Uri; 2306 + #[derive(Debug, Clone)] 2307 + pub struct PlaybackServiceClient<T> { 2308 + inner: tonic::client::Grpc<T>, 2309 + } 2310 + impl PlaybackServiceClient<tonic::transport::Channel> { 2311 + /// Attempt to create a new client by connecting to a given endpoint. 2312 + pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error> 2313 + where 2314 + D: TryInto<tonic::transport::Endpoint>, 2315 + D::Error: Into<StdError>, 2316 + { 2317 + let conn = tonic::transport::Endpoint::new(dst)?.connect().await?; 2318 + Ok(Self::new(conn)) 2319 + } 2320 + } 2321 + impl<T> PlaybackServiceClient<T> 2322 + where 2323 + T: tonic::client::GrpcService<tonic::body::BoxBody>, 2324 + T::Error: Into<StdError>, 2325 + T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static, 2326 + <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send, 2327 + { 2328 + pub fn new(inner: T) -> Self { 2329 + let inner = tonic::client::Grpc::new(inner); 2330 + Self { inner } 2331 + } 2332 + pub fn with_origin(inner: T, origin: Uri) -> Self { 2333 + let inner = tonic::client::Grpc::with_origin(inner, origin); 2334 + Self { inner } 2335 + } 2336 + pub fn with_interceptor<F>( 2337 + inner: T, 2338 + interceptor: F, 2339 + ) -> PlaybackServiceClient<InterceptedService<T, F>> 2340 + where 2341 + F: tonic::service::Interceptor, 2342 + T::ResponseBody: Default, 2343 + T: tonic::codegen::Service< 2344 + http::Request<tonic::body::BoxBody>, 2345 + Response = http::Response< 2346 + <T as tonic::client::GrpcService<tonic::body::BoxBody>>::ResponseBody, 2347 + >, 2348 + >, 2349 + <T as tonic::codegen::Service< 2350 + http::Request<tonic::body::BoxBody>, 2351 + >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync, 2352 + { 2353 + PlaybackServiceClient::new(InterceptedService::new(inner, interceptor)) 2354 + } 2355 + /// Compress requests with the given encoding. 2356 + /// 2357 + /// This requires the server to support it otherwise it might respond with an 2358 + /// error. 2359 + #[must_use] 2360 + pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { 2361 + self.inner = self.inner.send_compressed(encoding); 2362 + self 2363 + } 2364 + /// Enable decompressing responses. 2365 + #[must_use] 2366 + pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { 2367 + self.inner = self.inner.accept_compressed(encoding); 2368 + self 2369 + } 2370 + /// Limits the maximum size of a decoded message. 2371 + /// 2372 + /// Default: `4MB` 2373 + #[must_use] 2374 + pub fn max_decoding_message_size(mut self, limit: usize) -> Self { 2375 + self.inner = self.inner.max_decoding_message_size(limit); 2376 + self 2377 + } 2378 + /// Limits the maximum size of an encoded message. 2379 + /// 2380 + /// Default: `usize::MAX` 2381 + #[must_use] 2382 + pub fn max_encoding_message_size(mut self, limit: usize) -> Self { 2383 + self.inner = self.inner.max_encoding_message_size(limit); 2384 + self 2385 + } 2386 + pub async fn play( 2387 + &mut self, 2388 + request: impl tonic::IntoRequest<super::PlayRequest>, 2389 + ) -> std::result::Result<tonic::Response<super::PlayResponse>, tonic::Status> { 2390 + self.inner 2391 + .ready() 2392 + .await 2393 + .map_err(|e| { 2394 + tonic::Status::unknown( 2395 + format!("Service was not ready: {}", e.into()), 2396 + ) 2397 + })?; 2398 + let codec = tonic::codec::ProstCodec::default(); 2399 + let path = http::uri::PathAndQuery::from_static( 2400 + "/rockbox.v1alpha1.PlaybackService/Play", 2401 + ); 2402 + let mut req = request.into_request(); 2403 + req.extensions_mut() 2404 + .insert(GrpcMethod::new("rockbox.v1alpha1.PlaybackService", "Play")); 2405 + self.inner.unary(req, path, codec).await 2406 + } 2407 + pub async fn pause( 2408 + &mut self, 2409 + request: impl tonic::IntoRequest<super::PauseRequest>, 2410 + ) -> std::result::Result<tonic::Response<super::PauseResponse>, tonic::Status> { 2411 + self.inner 2412 + .ready() 2413 + .await 2414 + .map_err(|e| { 2415 + tonic::Status::unknown( 2416 + format!("Service was not ready: {}", e.into()), 2417 + ) 2418 + })?; 2419 + let codec = tonic::codec::ProstCodec::default(); 2420 + let path = http::uri::PathAndQuery::from_static( 2421 + "/rockbox.v1alpha1.PlaybackService/Pause", 2422 + ); 2423 + let mut req = request.into_request(); 2424 + req.extensions_mut() 2425 + .insert(GrpcMethod::new("rockbox.v1alpha1.PlaybackService", "Pause")); 2426 + self.inner.unary(req, path, codec).await 2427 + } 2428 + pub async fn play_or_pause( 2429 + &mut self, 2430 + request: impl tonic::IntoRequest<super::PlayOrPauseRequest>, 2431 + ) -> std::result::Result< 2432 + tonic::Response<super::PlayOrPauseResponse>, 2433 + tonic::Status, 2434 + > { 2435 + self.inner 2436 + .ready() 2437 + .await 2438 + .map_err(|e| { 2439 + tonic::Status::unknown( 2440 + format!("Service was not ready: {}", e.into()), 2441 + ) 2442 + })?; 2443 + let codec = tonic::codec::ProstCodec::default(); 2444 + let path = http::uri::PathAndQuery::from_static( 2445 + "/rockbox.v1alpha1.PlaybackService/PlayOrPause", 2446 + ); 2447 + let mut req = request.into_request(); 2448 + req.extensions_mut() 2449 + .insert( 2450 + GrpcMethod::new("rockbox.v1alpha1.PlaybackService", "PlayOrPause"), 2451 + ); 2452 + self.inner.unary(req, path, codec).await 2453 + } 2454 + pub async fn resume( 2455 + &mut self, 2456 + request: impl tonic::IntoRequest<super::ResumeRequest>, 2457 + ) -> std::result::Result<tonic::Response<super::ResumeResponse>, tonic::Status> { 2458 + self.inner 2459 + .ready() 2460 + .await 2461 + .map_err(|e| { 2462 + tonic::Status::unknown( 2463 + format!("Service was not ready: {}", e.into()), 2464 + ) 2465 + })?; 2466 + let codec = tonic::codec::ProstCodec::default(); 2467 + let path = http::uri::PathAndQuery::from_static( 2468 + "/rockbox.v1alpha1.PlaybackService/Resume", 2469 + ); 2470 + let mut req = request.into_request(); 2471 + req.extensions_mut() 2472 + .insert(GrpcMethod::new("rockbox.v1alpha1.PlaybackService", "Resume")); 2473 + self.inner.unary(req, path, codec).await 2474 + } 2475 + pub async fn next( 2476 + &mut self, 2477 + request: impl tonic::IntoRequest<super::NextRequest>, 2478 + ) -> std::result::Result<tonic::Response<super::NextResponse>, tonic::Status> { 2479 + self.inner 2480 + .ready() 2481 + .await 2482 + .map_err(|e| { 2483 + tonic::Status::unknown( 2484 + format!("Service was not ready: {}", e.into()), 2485 + ) 2486 + })?; 2487 + let codec = tonic::codec::ProstCodec::default(); 2488 + let path = http::uri::PathAndQuery::from_static( 2489 + "/rockbox.v1alpha1.PlaybackService/Next", 2490 + ); 2491 + let mut req = request.into_request(); 2492 + req.extensions_mut() 2493 + .insert(GrpcMethod::new("rockbox.v1alpha1.PlaybackService", "Next")); 2494 + self.inner.unary(req, path, codec).await 2495 + } 2496 + pub async fn previous( 2497 + &mut self, 2498 + request: impl tonic::IntoRequest<super::PreviousRequest>, 2499 + ) -> std::result::Result< 2500 + tonic::Response<super::PreviousResponse>, 2501 + tonic::Status, 2502 + > { 2503 + self.inner 2504 + .ready() 2505 + .await 2506 + .map_err(|e| { 2507 + tonic::Status::unknown( 2508 + format!("Service was not ready: {}", e.into()), 2509 + ) 2510 + })?; 2511 + let codec = tonic::codec::ProstCodec::default(); 2512 + let path = http::uri::PathAndQuery::from_static( 2513 + "/rockbox.v1alpha1.PlaybackService/Previous", 2514 + ); 2515 + let mut req = request.into_request(); 2516 + req.extensions_mut() 2517 + .insert(GrpcMethod::new("rockbox.v1alpha1.PlaybackService", "Previous")); 2518 + self.inner.unary(req, path, codec).await 2519 + } 2520 + pub async fn fast_forward_rewind( 2521 + &mut self, 2522 + request: impl tonic::IntoRequest<super::FastForwardRewindRequest>, 2523 + ) -> std::result::Result< 2524 + tonic::Response<super::FastForwardRewindResponse>, 2525 + tonic::Status, 2526 + > { 2527 + self.inner 2528 + .ready() 2529 + .await 2530 + .map_err(|e| { 2531 + tonic::Status::unknown( 2532 + format!("Service was not ready: {}", e.into()), 2533 + ) 2534 + })?; 2535 + let codec = tonic::codec::ProstCodec::default(); 2536 + let path = http::uri::PathAndQuery::from_static( 2537 + "/rockbox.v1alpha1.PlaybackService/FastForwardRewind", 2538 + ); 2539 + let mut req = request.into_request(); 2540 + req.extensions_mut() 2541 + .insert( 2542 + GrpcMethod::new( 2543 + "rockbox.v1alpha1.PlaybackService", 2544 + "FastForwardRewind", 2545 + ), 2546 + ); 2547 + self.inner.unary(req, path, codec).await 2548 + } 2549 + pub async fn status( 2550 + &mut self, 2551 + request: impl tonic::IntoRequest<super::StatusRequest>, 2552 + ) -> std::result::Result<tonic::Response<super::StatusResponse>, tonic::Status> { 2553 + self.inner 2554 + .ready() 2555 + .await 2556 + .map_err(|e| { 2557 + tonic::Status::unknown( 2558 + format!("Service was not ready: {}", e.into()), 2559 + ) 2560 + })?; 2561 + let codec = tonic::codec::ProstCodec::default(); 2562 + let path = http::uri::PathAndQuery::from_static( 2563 + "/rockbox.v1alpha1.PlaybackService/Status", 2564 + ); 2565 + let mut req = request.into_request(); 2566 + req.extensions_mut() 2567 + .insert(GrpcMethod::new("rockbox.v1alpha1.PlaybackService", "Status")); 2568 + self.inner.unary(req, path, codec).await 2569 + } 2570 + pub async fn current_track( 2571 + &mut self, 2572 + request: impl tonic::IntoRequest<super::CurrentTrackRequest>, 2573 + ) -> std::result::Result< 2574 + tonic::Response<super::CurrentTrackResponse>, 2575 + tonic::Status, 2576 + > { 2577 + self.inner 2578 + .ready() 2579 + .await 2580 + .map_err(|e| { 2581 + tonic::Status::unknown( 2582 + format!("Service was not ready: {}", e.into()), 2583 + ) 2584 + })?; 2585 + let codec = tonic::codec::ProstCodec::default(); 2586 + let path = http::uri::PathAndQuery::from_static( 2587 + "/rockbox.v1alpha1.PlaybackService/CurrentTrack", 2588 + ); 2589 + let mut req = request.into_request(); 2590 + req.extensions_mut() 2591 + .insert( 2592 + GrpcMethod::new("rockbox.v1alpha1.PlaybackService", "CurrentTrack"), 2593 + ); 2594 + self.inner.unary(req, path, codec).await 2595 + } 2596 + pub async fn next_track( 2597 + &mut self, 2598 + request: impl tonic::IntoRequest<super::NextTrackRequest>, 2599 + ) -> std::result::Result< 2600 + tonic::Response<super::NextTrackResponse>, 2601 + tonic::Status, 2602 + > { 2603 + self.inner 2604 + .ready() 2605 + .await 2606 + .map_err(|e| { 2607 + tonic::Status::unknown( 2608 + format!("Service was not ready: {}", e.into()), 2609 + ) 2610 + })?; 2611 + let codec = tonic::codec::ProstCodec::default(); 2612 + let path = http::uri::PathAndQuery::from_static( 2613 + "/rockbox.v1alpha1.PlaybackService/NextTrack", 2614 + ); 2615 + let mut req = request.into_request(); 2616 + req.extensions_mut() 2617 + .insert( 2618 + GrpcMethod::new("rockbox.v1alpha1.PlaybackService", "NextTrack"), 2619 + ); 2620 + self.inner.unary(req, path, codec).await 2621 + } 2622 + pub async fn flush_and_reload_tracks( 2623 + &mut self, 2624 + request: impl tonic::IntoRequest<super::FlushAndReloadTracksRequest>, 2625 + ) -> std::result::Result< 2626 + tonic::Response<super::FlushAndReloadTracksResponse>, 2627 + tonic::Status, 2628 + > { 2629 + self.inner 2630 + .ready() 2631 + .await 2632 + .map_err(|e| { 2633 + tonic::Status::unknown( 2634 + format!("Service was not ready: {}", e.into()), 2635 + ) 2636 + })?; 2637 + let codec = tonic::codec::ProstCodec::default(); 2638 + let path = http::uri::PathAndQuery::from_static( 2639 + "/rockbox.v1alpha1.PlaybackService/FlushAndReloadTracks", 2640 + ); 2641 + let mut req = request.into_request(); 2642 + req.extensions_mut() 2643 + .insert( 2644 + GrpcMethod::new( 2645 + "rockbox.v1alpha1.PlaybackService", 2646 + "FlushAndReloadTracks", 2647 + ), 2648 + ); 2649 + self.inner.unary(req, path, codec).await 2650 + } 2651 + pub async fn get_file_position( 2652 + &mut self, 2653 + request: impl tonic::IntoRequest<super::GetFilePositionRequest>, 2654 + ) -> std::result::Result< 2655 + tonic::Response<super::GetFilePositionResponse>, 2656 + tonic::Status, 2657 + > { 2658 + self.inner 2659 + .ready() 2660 + .await 2661 + .map_err(|e| { 2662 + tonic::Status::unknown( 2663 + format!("Service was not ready: {}", e.into()), 2664 + ) 2665 + })?; 2666 + let codec = tonic::codec::ProstCodec::default(); 2667 + let path = http::uri::PathAndQuery::from_static( 2668 + "/rockbox.v1alpha1.PlaybackService/GetFilePosition", 2669 + ); 2670 + let mut req = request.into_request(); 2671 + req.extensions_mut() 2672 + .insert( 2673 + GrpcMethod::new( 2674 + "rockbox.v1alpha1.PlaybackService", 2675 + "GetFilePosition", 2676 + ), 2677 + ); 2678 + self.inner.unary(req, path, codec).await 2679 + } 2680 + pub async fn hard_stop( 2681 + &mut self, 2682 + request: impl tonic::IntoRequest<super::HardStopRequest>, 2683 + ) -> std::result::Result< 2684 + tonic::Response<super::HardStopResponse>, 2685 + tonic::Status, 2686 + > { 2687 + self.inner 2688 + .ready() 2689 + .await 2690 + .map_err(|e| { 2691 + tonic::Status::unknown( 2692 + format!("Service was not ready: {}", e.into()), 2693 + ) 2694 + })?; 2695 + let codec = tonic::codec::ProstCodec::default(); 2696 + let path = http::uri::PathAndQuery::from_static( 2697 + "/rockbox.v1alpha1.PlaybackService/HardStop", 2698 + ); 2699 + let mut req = request.into_request(); 2700 + req.extensions_mut() 2701 + .insert(GrpcMethod::new("rockbox.v1alpha1.PlaybackService", "HardStop")); 2702 + self.inner.unary(req, path, codec).await 2703 + } 2704 + pub async fn play_album( 2705 + &mut self, 2706 + request: impl tonic::IntoRequest<super::PlayAlbumRequest>, 2707 + ) -> std::result::Result< 2708 + tonic::Response<super::PlayAlbumResponse>, 2709 + tonic::Status, 2710 + > { 2711 + self.inner 2712 + .ready() 2713 + .await 2714 + .map_err(|e| { 2715 + tonic::Status::unknown( 2716 + format!("Service was not ready: {}", e.into()), 2717 + ) 2718 + })?; 2719 + let codec = tonic::codec::ProstCodec::default(); 2720 + let path = http::uri::PathAndQuery::from_static( 2721 + "/rockbox.v1alpha1.PlaybackService/PlayAlbum", 2722 + ); 2723 + let mut req = request.into_request(); 2724 + req.extensions_mut() 2725 + .insert( 2726 + GrpcMethod::new("rockbox.v1alpha1.PlaybackService", "PlayAlbum"), 2727 + ); 2728 + self.inner.unary(req, path, codec).await 2729 + } 2730 + pub async fn play_artist_tracks( 2731 + &mut self, 2732 + request: impl tonic::IntoRequest<super::PlayArtistTracksRequest>, 2733 + ) -> std::result::Result< 2734 + tonic::Response<super::PlayArtistTracksResponse>, 2735 + tonic::Status, 2736 + > { 2737 + self.inner 2738 + .ready() 2739 + .await 2740 + .map_err(|e| { 2741 + tonic::Status::unknown( 2742 + format!("Service was not ready: {}", e.into()), 2743 + ) 2744 + })?; 2745 + let codec = tonic::codec::ProstCodec::default(); 2746 + let path = http::uri::PathAndQuery::from_static( 2747 + "/rockbox.v1alpha1.PlaybackService/PlayArtistTracks", 2748 + ); 2749 + let mut req = request.into_request(); 2750 + req.extensions_mut() 2751 + .insert( 2752 + GrpcMethod::new( 2753 + "rockbox.v1alpha1.PlaybackService", 2754 + "PlayArtistTracks", 2755 + ), 2756 + ); 2757 + self.inner.unary(req, path, codec).await 2758 + } 2759 + pub async fn play_playlist( 2760 + &mut self, 2761 + request: impl tonic::IntoRequest<super::PlayPlaylistRequest>, 2762 + ) -> std::result::Result< 2763 + tonic::Response<super::PlayPlaylistResponse>, 2764 + tonic::Status, 2765 + > { 2766 + self.inner 2767 + .ready() 2768 + .await 2769 + .map_err(|e| { 2770 + tonic::Status::unknown( 2771 + format!("Service was not ready: {}", e.into()), 2772 + ) 2773 + })?; 2774 + let codec = tonic::codec::ProstCodec::default(); 2775 + let path = http::uri::PathAndQuery::from_static( 2776 + "/rockbox.v1alpha1.PlaybackService/PlayPlaylist", 2777 + ); 2778 + let mut req = request.into_request(); 2779 + req.extensions_mut() 2780 + .insert( 2781 + GrpcMethod::new("rockbox.v1alpha1.PlaybackService", "PlayPlaylist"), 2782 + ); 2783 + self.inner.unary(req, path, codec).await 2784 + } 2785 + pub async fn play_directory( 2786 + &mut self, 2787 + request: impl tonic::IntoRequest<super::PlayDirectoryRequest>, 2788 + ) -> std::result::Result< 2789 + tonic::Response<super::PlayDirectoryResponse>, 2790 + tonic::Status, 2791 + > { 2792 + self.inner 2793 + .ready() 2794 + .await 2795 + .map_err(|e| { 2796 + tonic::Status::unknown( 2797 + format!("Service was not ready: {}", e.into()), 2798 + ) 2799 + })?; 2800 + let codec = tonic::codec::ProstCodec::default(); 2801 + let path = http::uri::PathAndQuery::from_static( 2802 + "/rockbox.v1alpha1.PlaybackService/PlayDirectory", 2803 + ); 2804 + let mut req = request.into_request(); 2805 + req.extensions_mut() 2806 + .insert( 2807 + GrpcMethod::new("rockbox.v1alpha1.PlaybackService", "PlayDirectory"), 2808 + ); 2809 + self.inner.unary(req, path, codec).await 2810 + } 2811 + pub async fn play_track( 2812 + &mut self, 2813 + request: impl tonic::IntoRequest<super::PlayTrackRequest>, 2814 + ) -> std::result::Result< 2815 + tonic::Response<super::PlayTrackResponse>, 2816 + tonic::Status, 2817 + > { 2818 + self.inner 2819 + .ready() 2820 + .await 2821 + .map_err(|e| { 2822 + tonic::Status::unknown( 2823 + format!("Service was not ready: {}", e.into()), 2824 + ) 2825 + })?; 2826 + let codec = tonic::codec::ProstCodec::default(); 2827 + let path = http::uri::PathAndQuery::from_static( 2828 + "/rockbox.v1alpha1.PlaybackService/PlayTrack", 2829 + ); 2830 + let mut req = request.into_request(); 2831 + req.extensions_mut() 2832 + .insert( 2833 + GrpcMethod::new("rockbox.v1alpha1.PlaybackService", "PlayTrack"), 2834 + ); 2835 + self.inner.unary(req, path, codec).await 2836 + } 2837 + pub async fn play_liked_tracks( 2838 + &mut self, 2839 + request: impl tonic::IntoRequest<super::PlayLikedTracksRequest>, 2840 + ) -> std::result::Result< 2841 + tonic::Response<super::PlayLikedTracksResponse>, 2842 + tonic::Status, 2843 + > { 2844 + self.inner 2845 + .ready() 2846 + .await 2847 + .map_err(|e| { 2848 + tonic::Status::unknown( 2849 + format!("Service was not ready: {}", e.into()), 2850 + ) 2851 + })?; 2852 + let codec = tonic::codec::ProstCodec::default(); 2853 + let path = http::uri::PathAndQuery::from_static( 2854 + "/rockbox.v1alpha1.PlaybackService/PlayLikedTracks", 2855 + ); 2856 + let mut req = request.into_request(); 2857 + req.extensions_mut() 2858 + .insert( 2859 + GrpcMethod::new( 2860 + "rockbox.v1alpha1.PlaybackService", 2861 + "PlayLikedTracks", 2862 + ), 2863 + ); 2864 + self.inner.unary(req, path, codec).await 2865 + } 2866 + pub async fn play_all_tracks( 2867 + &mut self, 2868 + request: impl tonic::IntoRequest<super::PlayAllTracksRequest>, 2869 + ) -> std::result::Result< 2870 + tonic::Response<super::PlayAllTracksResponse>, 2871 + tonic::Status, 2872 + > { 2873 + self.inner 2874 + .ready() 2875 + .await 2876 + .map_err(|e| { 2877 + tonic::Status::unknown( 2878 + format!("Service was not ready: {}", e.into()), 2879 + ) 2880 + })?; 2881 + let codec = tonic::codec::ProstCodec::default(); 2882 + let path = http::uri::PathAndQuery::from_static( 2883 + "/rockbox.v1alpha1.PlaybackService/PlayAllTracks", 2884 + ); 2885 + let mut req = request.into_request(); 2886 + req.extensions_mut() 2887 + .insert( 2888 + GrpcMethod::new("rockbox.v1alpha1.PlaybackService", "PlayAllTracks"), 2889 + ); 2890 + self.inner.unary(req, path, codec).await 2891 + } 2892 + pub async fn stream_current_track( 2893 + &mut self, 2894 + request: impl tonic::IntoRequest<super::StreamCurrentTrackRequest>, 2895 + ) -> std::result::Result< 2896 + tonic::Response<tonic::codec::Streaming<super::CurrentTrackResponse>>, 2897 + tonic::Status, 2898 + > { 2899 + self.inner 2900 + .ready() 2901 + .await 2902 + .map_err(|e| { 2903 + tonic::Status::unknown( 2904 + format!("Service was not ready: {}", e.into()), 2905 + ) 2906 + })?; 2907 + let codec = tonic::codec::ProstCodec::default(); 2908 + let path = http::uri::PathAndQuery::from_static( 2909 + "/rockbox.v1alpha1.PlaybackService/StreamCurrentTrack", 2910 + ); 2911 + let mut req = request.into_request(); 2912 + req.extensions_mut() 2913 + .insert( 2914 + GrpcMethod::new( 2915 + "rockbox.v1alpha1.PlaybackService", 2916 + "StreamCurrentTrack", 2917 + ), 2918 + ); 2919 + self.inner.server_streaming(req, path, codec).await 2920 + } 2921 + pub async fn stream_status( 2922 + &mut self, 2923 + request: impl tonic::IntoRequest<super::StreamStatusRequest>, 2924 + ) -> std::result::Result< 2925 + tonic::Response<tonic::codec::Streaming<super::StatusResponse>>, 2926 + tonic::Status, 2927 + > { 2928 + self.inner 2929 + .ready() 2930 + .await 2931 + .map_err(|e| { 2932 + tonic::Status::unknown( 2933 + format!("Service was not ready: {}", e.into()), 2934 + ) 2935 + })?; 2936 + let codec = tonic::codec::ProstCodec::default(); 2937 + let path = http::uri::PathAndQuery::from_static( 2938 + "/rockbox.v1alpha1.PlaybackService/StreamStatus", 2939 + ); 2940 + let mut req = request.into_request(); 2941 + req.extensions_mut() 2942 + .insert( 2943 + GrpcMethod::new("rockbox.v1alpha1.PlaybackService", "StreamStatus"), 2944 + ); 2945 + self.inner.server_streaming(req, path, codec).await 2946 + } 2947 + pub async fn stream_playlist( 2948 + &mut self, 2949 + request: impl tonic::IntoRequest<super::StreamPlaylistRequest>, 2950 + ) -> std::result::Result< 2951 + tonic::Response<tonic::codec::Streaming<super::PlaylistResponse>>, 2952 + tonic::Status, 2953 + > { 2954 + self.inner 2955 + .ready() 2956 + .await 2957 + .map_err(|e| { 2958 + tonic::Status::unknown( 2959 + format!("Service was not ready: {}", e.into()), 2960 + ) 2961 + })?; 2962 + let codec = tonic::codec::ProstCodec::default(); 2963 + let path = http::uri::PathAndQuery::from_static( 2964 + "/rockbox.v1alpha1.PlaybackService/StreamPlaylist", 2965 + ); 2966 + let mut req = request.into_request(); 2967 + req.extensions_mut() 2968 + .insert( 2969 + GrpcMethod::new("rockbox.v1alpha1.PlaybackService", "StreamPlaylist"), 2970 + ); 2971 + self.inner.server_streaming(req, path, codec).await 2972 + } 2973 + } 2974 + } 2975 + /// Generated server implementations. 2976 + pub mod playback_service_server { 2977 + #![allow( 2978 + unused_variables, 2979 + dead_code, 2980 + missing_docs, 2981 + clippy::wildcard_imports, 2982 + clippy::let_unit_value, 2983 + )] 2984 + use tonic::codegen::*; 2985 + /// Generated trait containing gRPC methods that should be implemented for use with PlaybackServiceServer. 2986 + #[async_trait] 2987 + pub trait PlaybackService: std::marker::Send + std::marker::Sync + 'static { 2988 + async fn play( 2989 + &self, 2990 + request: tonic::Request<super::PlayRequest>, 2991 + ) -> std::result::Result<tonic::Response<super::PlayResponse>, tonic::Status>; 2992 + async fn pause( 2993 + &self, 2994 + request: tonic::Request<super::PauseRequest>, 2995 + ) -> std::result::Result<tonic::Response<super::PauseResponse>, tonic::Status>; 2996 + async fn play_or_pause( 2997 + &self, 2998 + request: tonic::Request<super::PlayOrPauseRequest>, 2999 + ) -> std::result::Result< 3000 + tonic::Response<super::PlayOrPauseResponse>, 3001 + tonic::Status, 3002 + >; 3003 + async fn resume( 3004 + &self, 3005 + request: tonic::Request<super::ResumeRequest>, 3006 + ) -> std::result::Result<tonic::Response<super::ResumeResponse>, tonic::Status>; 3007 + async fn next( 3008 + &self, 3009 + request: tonic::Request<super::NextRequest>, 3010 + ) -> std::result::Result<tonic::Response<super::NextResponse>, tonic::Status>; 3011 + async fn previous( 3012 + &self, 3013 + request: tonic::Request<super::PreviousRequest>, 3014 + ) -> std::result::Result< 3015 + tonic::Response<super::PreviousResponse>, 3016 + tonic::Status, 3017 + >; 3018 + async fn fast_forward_rewind( 3019 + &self, 3020 + request: tonic::Request<super::FastForwardRewindRequest>, 3021 + ) -> std::result::Result< 3022 + tonic::Response<super::FastForwardRewindResponse>, 3023 + tonic::Status, 3024 + >; 3025 + async fn status( 3026 + &self, 3027 + request: tonic::Request<super::StatusRequest>, 3028 + ) -> std::result::Result<tonic::Response<super::StatusResponse>, tonic::Status>; 3029 + async fn current_track( 3030 + &self, 3031 + request: tonic::Request<super::CurrentTrackRequest>, 3032 + ) -> std::result::Result< 3033 + tonic::Response<super::CurrentTrackResponse>, 3034 + tonic::Status, 3035 + >; 3036 + async fn next_track( 3037 + &self, 3038 + request: tonic::Request<super::NextTrackRequest>, 3039 + ) -> std::result::Result< 3040 + tonic::Response<super::NextTrackResponse>, 3041 + tonic::Status, 3042 + >; 3043 + async fn flush_and_reload_tracks( 3044 + &self, 3045 + request: tonic::Request<super::FlushAndReloadTracksRequest>, 3046 + ) -> std::result::Result< 3047 + tonic::Response<super::FlushAndReloadTracksResponse>, 3048 + tonic::Status, 3049 + >; 3050 + async fn get_file_position( 3051 + &self, 3052 + request: tonic::Request<super::GetFilePositionRequest>, 3053 + ) -> std::result::Result< 3054 + tonic::Response<super::GetFilePositionResponse>, 3055 + tonic::Status, 3056 + >; 3057 + async fn hard_stop( 3058 + &self, 3059 + request: tonic::Request<super::HardStopRequest>, 3060 + ) -> std::result::Result< 3061 + tonic::Response<super::HardStopResponse>, 3062 + tonic::Status, 3063 + >; 3064 + async fn play_album( 3065 + &self, 3066 + request: tonic::Request<super::PlayAlbumRequest>, 3067 + ) -> std::result::Result< 3068 + tonic::Response<super::PlayAlbumResponse>, 3069 + tonic::Status, 3070 + >; 3071 + async fn play_artist_tracks( 3072 + &self, 3073 + request: tonic::Request<super::PlayArtistTracksRequest>, 3074 + ) -> std::result::Result< 3075 + tonic::Response<super::PlayArtistTracksResponse>, 3076 + tonic::Status, 3077 + >; 3078 + async fn play_playlist( 3079 + &self, 3080 + request: tonic::Request<super::PlayPlaylistRequest>, 3081 + ) -> std::result::Result< 3082 + tonic::Response<super::PlayPlaylistResponse>, 3083 + tonic::Status, 3084 + >; 3085 + async fn play_directory( 3086 + &self, 3087 + request: tonic::Request<super::PlayDirectoryRequest>, 3088 + ) -> std::result::Result< 3089 + tonic::Response<super::PlayDirectoryResponse>, 3090 + tonic::Status, 3091 + >; 3092 + async fn play_track( 3093 + &self, 3094 + request: tonic::Request<super::PlayTrackRequest>, 3095 + ) -> std::result::Result< 3096 + tonic::Response<super::PlayTrackResponse>, 3097 + tonic::Status, 3098 + >; 3099 + async fn play_liked_tracks( 3100 + &self, 3101 + request: tonic::Request<super::PlayLikedTracksRequest>, 3102 + ) -> std::result::Result< 3103 + tonic::Response<super::PlayLikedTracksResponse>, 3104 + tonic::Status, 3105 + >; 3106 + async fn play_all_tracks( 3107 + &self, 3108 + request: tonic::Request<super::PlayAllTracksRequest>, 3109 + ) -> std::result::Result< 3110 + tonic::Response<super::PlayAllTracksResponse>, 3111 + tonic::Status, 3112 + >; 3113 + /// Server streaming response type for the StreamCurrentTrack method. 3114 + type StreamCurrentTrackStream: tonic::codegen::tokio_stream::Stream< 3115 + Item = std::result::Result<super::CurrentTrackResponse, tonic::Status>, 3116 + > 3117 + + std::marker::Send 3118 + + 'static; 3119 + async fn stream_current_track( 3120 + &self, 3121 + request: tonic::Request<super::StreamCurrentTrackRequest>, 3122 + ) -> std::result::Result< 3123 + tonic::Response<Self::StreamCurrentTrackStream>, 3124 + tonic::Status, 3125 + >; 3126 + /// Server streaming response type for the StreamStatus method. 3127 + type StreamStatusStream: tonic::codegen::tokio_stream::Stream< 3128 + Item = std::result::Result<super::StatusResponse, tonic::Status>, 3129 + > 3130 + + std::marker::Send 3131 + + 'static; 3132 + async fn stream_status( 3133 + &self, 3134 + request: tonic::Request<super::StreamStatusRequest>, 3135 + ) -> std::result::Result< 3136 + tonic::Response<Self::StreamStatusStream>, 3137 + tonic::Status, 3138 + >; 3139 + /// Server streaming response type for the StreamPlaylist method. 3140 + type StreamPlaylistStream: tonic::codegen::tokio_stream::Stream< 3141 + Item = std::result::Result<super::PlaylistResponse, tonic::Status>, 3142 + > 3143 + + std::marker::Send 3144 + + 'static; 3145 + async fn stream_playlist( 3146 + &self, 3147 + request: tonic::Request<super::StreamPlaylistRequest>, 3148 + ) -> std::result::Result< 3149 + tonic::Response<Self::StreamPlaylistStream>, 3150 + tonic::Status, 3151 + >; 3152 + } 3153 + #[derive(Debug)] 3154 + pub struct PlaybackServiceServer<T> { 3155 + inner: Arc<T>, 3156 + accept_compression_encodings: EnabledCompressionEncodings, 3157 + send_compression_encodings: EnabledCompressionEncodings, 3158 + max_decoding_message_size: Option<usize>, 3159 + max_encoding_message_size: Option<usize>, 3160 + } 3161 + impl<T> PlaybackServiceServer<T> { 3162 + pub fn new(inner: T) -> Self { 3163 + Self::from_arc(Arc::new(inner)) 3164 + } 3165 + pub fn from_arc(inner: Arc<T>) -> Self { 3166 + Self { 3167 + inner, 3168 + accept_compression_encodings: Default::default(), 3169 + send_compression_encodings: Default::default(), 3170 + max_decoding_message_size: None, 3171 + max_encoding_message_size: None, 3172 + } 3173 + } 3174 + pub fn with_interceptor<F>( 3175 + inner: T, 3176 + interceptor: F, 3177 + ) -> InterceptedService<Self, F> 3178 + where 3179 + F: tonic::service::Interceptor, 3180 + { 3181 + InterceptedService::new(Self::new(inner), interceptor) 3182 + } 3183 + /// Enable decompressing requests with the given encoding. 3184 + #[must_use] 3185 + pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { 3186 + self.accept_compression_encodings.enable(encoding); 3187 + self 3188 + } 3189 + /// Compress responses with the given encoding, if the client supports it. 3190 + #[must_use] 3191 + pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { 3192 + self.send_compression_encodings.enable(encoding); 3193 + self 3194 + } 3195 + /// Limits the maximum size of a decoded message. 3196 + /// 3197 + /// Default: `4MB` 3198 + #[must_use] 3199 + pub fn max_decoding_message_size(mut self, limit: usize) -> Self { 3200 + self.max_decoding_message_size = Some(limit); 3201 + self 3202 + } 3203 + /// Limits the maximum size of an encoded message. 3204 + /// 3205 + /// Default: `usize::MAX` 3206 + #[must_use] 3207 + pub fn max_encoding_message_size(mut self, limit: usize) -> Self { 3208 + self.max_encoding_message_size = Some(limit); 3209 + self 3210 + } 3211 + } 3212 + impl<T, B> tonic::codegen::Service<http::Request<B>> for PlaybackServiceServer<T> 3213 + where 3214 + T: PlaybackService, 3215 + B: Body + std::marker::Send + 'static, 3216 + B::Error: Into<StdError> + std::marker::Send + 'static, 3217 + { 3218 + type Response = http::Response<tonic::body::BoxBody>; 3219 + type Error = std::convert::Infallible; 3220 + type Future = BoxFuture<Self::Response, Self::Error>; 3221 + fn poll_ready( 3222 + &mut self, 3223 + _cx: &mut Context<'_>, 3224 + ) -> Poll<std::result::Result<(), Self::Error>> { 3225 + Poll::Ready(Ok(())) 3226 + } 3227 + fn call(&mut self, req: http::Request<B>) -> Self::Future { 3228 + match req.uri().path() { 3229 + "/rockbox.v1alpha1.PlaybackService/Play" => { 3230 + #[allow(non_camel_case_types)] 3231 + struct PlaySvc<T: PlaybackService>(pub Arc<T>); 3232 + impl< 3233 + T: PlaybackService, 3234 + > tonic::server::UnaryService<super::PlayRequest> for PlaySvc<T> { 3235 + type Response = super::PlayResponse; 3236 + type Future = BoxFuture< 3237 + tonic::Response<Self::Response>, 3238 + tonic::Status, 3239 + >; 3240 + fn call( 3241 + &mut self, 3242 + request: tonic::Request<super::PlayRequest>, 3243 + ) -> Self::Future { 3244 + let inner = Arc::clone(&self.0); 3245 + let fut = async move { 3246 + <T as PlaybackService>::play(&inner, request).await 3247 + }; 3248 + Box::pin(fut) 3249 + } 3250 + } 3251 + let accept_compression_encodings = self.accept_compression_encodings; 3252 + let send_compression_encodings = self.send_compression_encodings; 3253 + let max_decoding_message_size = self.max_decoding_message_size; 3254 + let max_encoding_message_size = self.max_encoding_message_size; 3255 + let inner = self.inner.clone(); 3256 + let fut = async move { 3257 + let method = PlaySvc(inner); 3258 + let codec = tonic::codec::ProstCodec::default(); 3259 + let mut grpc = tonic::server::Grpc::new(codec) 3260 + .apply_compression_config( 3261 + accept_compression_encodings, 3262 + send_compression_encodings, 3263 + ) 3264 + .apply_max_message_size_config( 3265 + max_decoding_message_size, 3266 + max_encoding_message_size, 3267 + ); 3268 + let res = grpc.unary(method, req).await; 3269 + Ok(res) 3270 + }; 3271 + Box::pin(fut) 3272 + } 3273 + "/rockbox.v1alpha1.PlaybackService/Pause" => { 3274 + #[allow(non_camel_case_types)] 3275 + struct PauseSvc<T: PlaybackService>(pub Arc<T>); 3276 + impl< 3277 + T: PlaybackService, 3278 + > tonic::server::UnaryService<super::PauseRequest> for PauseSvc<T> { 3279 + type Response = super::PauseResponse; 3280 + type Future = BoxFuture< 3281 + tonic::Response<Self::Response>, 3282 + tonic::Status, 3283 + >; 3284 + fn call( 3285 + &mut self, 3286 + request: tonic::Request<super::PauseRequest>, 3287 + ) -> Self::Future { 3288 + let inner = Arc::clone(&self.0); 3289 + let fut = async move { 3290 + <T as PlaybackService>::pause(&inner, request).await 3291 + }; 3292 + Box::pin(fut) 3293 + } 3294 + } 3295 + let accept_compression_encodings = self.accept_compression_encodings; 3296 + let send_compression_encodings = self.send_compression_encodings; 3297 + let max_decoding_message_size = self.max_decoding_message_size; 3298 + let max_encoding_message_size = self.max_encoding_message_size; 3299 + let inner = self.inner.clone(); 3300 + let fut = async move { 3301 + let method = PauseSvc(inner); 3302 + let codec = tonic::codec::ProstCodec::default(); 3303 + let mut grpc = tonic::server::Grpc::new(codec) 3304 + .apply_compression_config( 3305 + accept_compression_encodings, 3306 + send_compression_encodings, 3307 + ) 3308 + .apply_max_message_size_config( 3309 + max_decoding_message_size, 3310 + max_encoding_message_size, 3311 + ); 3312 + let res = grpc.unary(method, req).await; 3313 + Ok(res) 3314 + }; 3315 + Box::pin(fut) 3316 + } 3317 + "/rockbox.v1alpha1.PlaybackService/PlayOrPause" => { 3318 + #[allow(non_camel_case_types)] 3319 + struct PlayOrPauseSvc<T: PlaybackService>(pub Arc<T>); 3320 + impl< 3321 + T: PlaybackService, 3322 + > tonic::server::UnaryService<super::PlayOrPauseRequest> 3323 + for PlayOrPauseSvc<T> { 3324 + type Response = super::PlayOrPauseResponse; 3325 + type Future = BoxFuture< 3326 + tonic::Response<Self::Response>, 3327 + tonic::Status, 3328 + >; 3329 + fn call( 3330 + &mut self, 3331 + request: tonic::Request<super::PlayOrPauseRequest>, 3332 + ) -> Self::Future { 3333 + let inner = Arc::clone(&self.0); 3334 + let fut = async move { 3335 + <T as PlaybackService>::play_or_pause(&inner, request).await 3336 + }; 3337 + Box::pin(fut) 3338 + } 3339 + } 3340 + let accept_compression_encodings = self.accept_compression_encodings; 3341 + let send_compression_encodings = self.send_compression_encodings; 3342 + let max_decoding_message_size = self.max_decoding_message_size; 3343 + let max_encoding_message_size = self.max_encoding_message_size; 3344 + let inner = self.inner.clone(); 3345 + let fut = async move { 3346 + let method = PlayOrPauseSvc(inner); 3347 + let codec = tonic::codec::ProstCodec::default(); 3348 + let mut grpc = tonic::server::Grpc::new(codec) 3349 + .apply_compression_config( 3350 + accept_compression_encodings, 3351 + send_compression_encodings, 3352 + ) 3353 + .apply_max_message_size_config( 3354 + max_decoding_message_size, 3355 + max_encoding_message_size, 3356 + ); 3357 + let res = grpc.unary(method, req).await; 3358 + Ok(res) 3359 + }; 3360 + Box::pin(fut) 3361 + } 3362 + "/rockbox.v1alpha1.PlaybackService/Resume" => { 3363 + #[allow(non_camel_case_types)] 3364 + struct ResumeSvc<T: PlaybackService>(pub Arc<T>); 3365 + impl< 3366 + T: PlaybackService, 3367 + > tonic::server::UnaryService<super::ResumeRequest> 3368 + for ResumeSvc<T> { 3369 + type Response = super::ResumeResponse; 3370 + type Future = BoxFuture< 3371 + tonic::Response<Self::Response>, 3372 + tonic::Status, 3373 + >; 3374 + fn call( 3375 + &mut self, 3376 + request: tonic::Request<super::ResumeRequest>, 3377 + ) -> Self::Future { 3378 + let inner = Arc::clone(&self.0); 3379 + let fut = async move { 3380 + <T as PlaybackService>::resume(&inner, request).await 3381 + }; 3382 + Box::pin(fut) 3383 + } 3384 + } 3385 + let accept_compression_encodings = self.accept_compression_encodings; 3386 + let send_compression_encodings = self.send_compression_encodings; 3387 + let max_decoding_message_size = self.max_decoding_message_size; 3388 + let max_encoding_message_size = self.max_encoding_message_size; 3389 + let inner = self.inner.clone(); 3390 + let fut = async move { 3391 + let method = ResumeSvc(inner); 3392 + let codec = tonic::codec::ProstCodec::default(); 3393 + let mut grpc = tonic::server::Grpc::new(codec) 3394 + .apply_compression_config( 3395 + accept_compression_encodings, 3396 + send_compression_encodings, 3397 + ) 3398 + .apply_max_message_size_config( 3399 + max_decoding_message_size, 3400 + max_encoding_message_size, 3401 + ); 3402 + let res = grpc.unary(method, req).await; 3403 + Ok(res) 3404 + }; 3405 + Box::pin(fut) 3406 + } 3407 + "/rockbox.v1alpha1.PlaybackService/Next" => { 3408 + #[allow(non_camel_case_types)] 3409 + struct NextSvc<T: PlaybackService>(pub Arc<T>); 3410 + impl< 3411 + T: PlaybackService, 3412 + > tonic::server::UnaryService<super::NextRequest> for NextSvc<T> { 3413 + type Response = super::NextResponse; 3414 + type Future = BoxFuture< 3415 + tonic::Response<Self::Response>, 3416 + tonic::Status, 3417 + >; 3418 + fn call( 3419 + &mut self, 3420 + request: tonic::Request<super::NextRequest>, 3421 + ) -> Self::Future { 3422 + let inner = Arc::clone(&self.0); 3423 + let fut = async move { 3424 + <T as PlaybackService>::next(&inner, request).await 3425 + }; 3426 + Box::pin(fut) 3427 + } 3428 + } 3429 + let accept_compression_encodings = self.accept_compression_encodings; 3430 + let send_compression_encodings = self.send_compression_encodings; 3431 + let max_decoding_message_size = self.max_decoding_message_size; 3432 + let max_encoding_message_size = self.max_encoding_message_size; 3433 + let inner = self.inner.clone(); 3434 + let fut = async move { 3435 + let method = NextSvc(inner); 3436 + let codec = tonic::codec::ProstCodec::default(); 3437 + let mut grpc = tonic::server::Grpc::new(codec) 3438 + .apply_compression_config( 3439 + accept_compression_encodings, 3440 + send_compression_encodings, 3441 + ) 3442 + .apply_max_message_size_config( 3443 + max_decoding_message_size, 3444 + max_encoding_message_size, 3445 + ); 3446 + let res = grpc.unary(method, req).await; 3447 + Ok(res) 3448 + }; 3449 + Box::pin(fut) 3450 + } 3451 + "/rockbox.v1alpha1.PlaybackService/Previous" => { 3452 + #[allow(non_camel_case_types)] 3453 + struct PreviousSvc<T: PlaybackService>(pub Arc<T>); 3454 + impl< 3455 + T: PlaybackService, 3456 + > tonic::server::UnaryService<super::PreviousRequest> 3457 + for PreviousSvc<T> { 3458 + type Response = super::PreviousResponse; 3459 + type Future = BoxFuture< 3460 + tonic::Response<Self::Response>, 3461 + tonic::Status, 3462 + >; 3463 + fn call( 3464 + &mut self, 3465 + request: tonic::Request<super::PreviousRequest>, 3466 + ) -> Self::Future { 3467 + let inner = Arc::clone(&self.0); 3468 + let fut = async move { 3469 + <T as PlaybackService>::previous(&inner, request).await 3470 + }; 3471 + Box::pin(fut) 3472 + } 3473 + } 3474 + let accept_compression_encodings = self.accept_compression_encodings; 3475 + let send_compression_encodings = self.send_compression_encodings; 3476 + let max_decoding_message_size = self.max_decoding_message_size; 3477 + let max_encoding_message_size = self.max_encoding_message_size; 3478 + let inner = self.inner.clone(); 3479 + let fut = async move { 3480 + let method = PreviousSvc(inner); 3481 + let codec = tonic::codec::ProstCodec::default(); 3482 + let mut grpc = tonic::server::Grpc::new(codec) 3483 + .apply_compression_config( 3484 + accept_compression_encodings, 3485 + send_compression_encodings, 3486 + ) 3487 + .apply_max_message_size_config( 3488 + max_decoding_message_size, 3489 + max_encoding_message_size, 3490 + ); 3491 + let res = grpc.unary(method, req).await; 3492 + Ok(res) 3493 + }; 3494 + Box::pin(fut) 3495 + } 3496 + "/rockbox.v1alpha1.PlaybackService/FastForwardRewind" => { 3497 + #[allow(non_camel_case_types)] 3498 + struct FastForwardRewindSvc<T: PlaybackService>(pub Arc<T>); 3499 + impl< 3500 + T: PlaybackService, 3501 + > tonic::server::UnaryService<super::FastForwardRewindRequest> 3502 + for FastForwardRewindSvc<T> { 3503 + type Response = super::FastForwardRewindResponse; 3504 + type Future = BoxFuture< 3505 + tonic::Response<Self::Response>, 3506 + tonic::Status, 3507 + >; 3508 + fn call( 3509 + &mut self, 3510 + request: tonic::Request<super::FastForwardRewindRequest>, 3511 + ) -> Self::Future { 3512 + let inner = Arc::clone(&self.0); 3513 + let fut = async move { 3514 + <T as PlaybackService>::fast_forward_rewind(&inner, request) 3515 + .await 3516 + }; 3517 + Box::pin(fut) 3518 + } 3519 + } 3520 + let accept_compression_encodings = self.accept_compression_encodings; 3521 + let send_compression_encodings = self.send_compression_encodings; 3522 + let max_decoding_message_size = self.max_decoding_message_size; 3523 + let max_encoding_message_size = self.max_encoding_message_size; 3524 + let inner = self.inner.clone(); 3525 + let fut = async move { 3526 + let method = FastForwardRewindSvc(inner); 3527 + let codec = tonic::codec::ProstCodec::default(); 3528 + let mut grpc = tonic::server::Grpc::new(codec) 3529 + .apply_compression_config( 3530 + accept_compression_encodings, 3531 + send_compression_encodings, 3532 + ) 3533 + .apply_max_message_size_config( 3534 + max_decoding_message_size, 3535 + max_encoding_message_size, 3536 + ); 3537 + let res = grpc.unary(method, req).await; 3538 + Ok(res) 3539 + }; 3540 + Box::pin(fut) 3541 + } 3542 + "/rockbox.v1alpha1.PlaybackService/Status" => { 3543 + #[allow(non_camel_case_types)] 3544 + struct StatusSvc<T: PlaybackService>(pub Arc<T>); 3545 + impl< 3546 + T: PlaybackService, 3547 + > tonic::server::UnaryService<super::StatusRequest> 3548 + for StatusSvc<T> { 3549 + type Response = super::StatusResponse; 3550 + type Future = BoxFuture< 3551 + tonic::Response<Self::Response>, 3552 + tonic::Status, 3553 + >; 3554 + fn call( 3555 + &mut self, 3556 + request: tonic::Request<super::StatusRequest>, 3557 + ) -> Self::Future { 3558 + let inner = Arc::clone(&self.0); 3559 + let fut = async move { 3560 + <T as PlaybackService>::status(&inner, request).await 3561 + }; 3562 + Box::pin(fut) 3563 + } 3564 + } 3565 + let accept_compression_encodings = self.accept_compression_encodings; 3566 + let send_compression_encodings = self.send_compression_encodings; 3567 + let max_decoding_message_size = self.max_decoding_message_size; 3568 + let max_encoding_message_size = self.max_encoding_message_size; 3569 + let inner = self.inner.clone(); 3570 + let fut = async move { 3571 + let method = StatusSvc(inner); 3572 + let codec = tonic::codec::ProstCodec::default(); 3573 + let mut grpc = tonic::server::Grpc::new(codec) 3574 + .apply_compression_config( 3575 + accept_compression_encodings, 3576 + send_compression_encodings, 3577 + ) 3578 + .apply_max_message_size_config( 3579 + max_decoding_message_size, 3580 + max_encoding_message_size, 3581 + ); 3582 + let res = grpc.unary(method, req).await; 3583 + Ok(res) 3584 + }; 3585 + Box::pin(fut) 3586 + } 3587 + "/rockbox.v1alpha1.PlaybackService/CurrentTrack" => { 3588 + #[allow(non_camel_case_types)] 3589 + struct CurrentTrackSvc<T: PlaybackService>(pub Arc<T>); 3590 + impl< 3591 + T: PlaybackService, 3592 + > tonic::server::UnaryService<super::CurrentTrackRequest> 3593 + for CurrentTrackSvc<T> { 3594 + type Response = super::CurrentTrackResponse; 3595 + type Future = BoxFuture< 3596 + tonic::Response<Self::Response>, 3597 + tonic::Status, 3598 + >; 3599 + fn call( 3600 + &mut self, 3601 + request: tonic::Request<super::CurrentTrackRequest>, 3602 + ) -> Self::Future { 3603 + let inner = Arc::clone(&self.0); 3604 + let fut = async move { 3605 + <T as PlaybackService>::current_track(&inner, request).await 3606 + }; 3607 + Box::pin(fut) 3608 + } 3609 + } 3610 + let accept_compression_encodings = self.accept_compression_encodings; 3611 + let send_compression_encodings = self.send_compression_encodings; 3612 + let max_decoding_message_size = self.max_decoding_message_size; 3613 + let max_encoding_message_size = self.max_encoding_message_size; 3614 + let inner = self.inner.clone(); 3615 + let fut = async move { 3616 + let method = CurrentTrackSvc(inner); 3617 + let codec = tonic::codec::ProstCodec::default(); 3618 + let mut grpc = tonic::server::Grpc::new(codec) 3619 + .apply_compression_config( 3620 + accept_compression_encodings, 3621 + send_compression_encodings, 3622 + ) 3623 + .apply_max_message_size_config( 3624 + max_decoding_message_size, 3625 + max_encoding_message_size, 3626 + ); 3627 + let res = grpc.unary(method, req).await; 3628 + Ok(res) 3629 + }; 3630 + Box::pin(fut) 3631 + } 3632 + "/rockbox.v1alpha1.PlaybackService/NextTrack" => { 3633 + #[allow(non_camel_case_types)] 3634 + struct NextTrackSvc<T: PlaybackService>(pub Arc<T>); 3635 + impl< 3636 + T: PlaybackService, 3637 + > tonic::server::UnaryService<super::NextTrackRequest> 3638 + for NextTrackSvc<T> { 3639 + type Response = super::NextTrackResponse; 3640 + type Future = BoxFuture< 3641 + tonic::Response<Self::Response>, 3642 + tonic::Status, 3643 + >; 3644 + fn call( 3645 + &mut self, 3646 + request: tonic::Request<super::NextTrackRequest>, 3647 + ) -> Self::Future { 3648 + let inner = Arc::clone(&self.0); 3649 + let fut = async move { 3650 + <T as PlaybackService>::next_track(&inner, request).await 3651 + }; 3652 + Box::pin(fut) 3653 + } 3654 + } 3655 + let accept_compression_encodings = self.accept_compression_encodings; 3656 + let send_compression_encodings = self.send_compression_encodings; 3657 + let max_decoding_message_size = self.max_decoding_message_size; 3658 + let max_encoding_message_size = self.max_encoding_message_size; 3659 + let inner = self.inner.clone(); 3660 + let fut = async move { 3661 + let method = NextTrackSvc(inner); 3662 + let codec = tonic::codec::ProstCodec::default(); 3663 + let mut grpc = tonic::server::Grpc::new(codec) 3664 + .apply_compression_config( 3665 + accept_compression_encodings, 3666 + send_compression_encodings, 3667 + ) 3668 + .apply_max_message_size_config( 3669 + max_decoding_message_size, 3670 + max_encoding_message_size, 3671 + ); 3672 + let res = grpc.unary(method, req).await; 3673 + Ok(res) 3674 + }; 3675 + Box::pin(fut) 3676 + } 3677 + "/rockbox.v1alpha1.PlaybackService/FlushAndReloadTracks" => { 3678 + #[allow(non_camel_case_types)] 3679 + struct FlushAndReloadTracksSvc<T: PlaybackService>(pub Arc<T>); 3680 + impl< 3681 + T: PlaybackService, 3682 + > tonic::server::UnaryService<super::FlushAndReloadTracksRequest> 3683 + for FlushAndReloadTracksSvc<T> { 3684 + type Response = super::FlushAndReloadTracksResponse; 3685 + type Future = BoxFuture< 3686 + tonic::Response<Self::Response>, 3687 + tonic::Status, 3688 + >; 3689 + fn call( 3690 + &mut self, 3691 + request: tonic::Request<super::FlushAndReloadTracksRequest>, 3692 + ) -> Self::Future { 3693 + let inner = Arc::clone(&self.0); 3694 + let fut = async move { 3695 + <T as PlaybackService>::flush_and_reload_tracks( 3696 + &inner, 3697 + request, 3698 + ) 3699 + .await 3700 + }; 3701 + Box::pin(fut) 3702 + } 3703 + } 3704 + let accept_compression_encodings = self.accept_compression_encodings; 3705 + let send_compression_encodings = self.send_compression_encodings; 3706 + let max_decoding_message_size = self.max_decoding_message_size; 3707 + let max_encoding_message_size = self.max_encoding_message_size; 3708 + let inner = self.inner.clone(); 3709 + let fut = async move { 3710 + let method = FlushAndReloadTracksSvc(inner); 3711 + let codec = tonic::codec::ProstCodec::default(); 3712 + let mut grpc = tonic::server::Grpc::new(codec) 3713 + .apply_compression_config( 3714 + accept_compression_encodings, 3715 + send_compression_encodings, 3716 + ) 3717 + .apply_max_message_size_config( 3718 + max_decoding_message_size, 3719 + max_encoding_message_size, 3720 + ); 3721 + let res = grpc.unary(method, req).await; 3722 + Ok(res) 3723 + }; 3724 + Box::pin(fut) 3725 + } 3726 + "/rockbox.v1alpha1.PlaybackService/GetFilePosition" => { 3727 + #[allow(non_camel_case_types)] 3728 + struct GetFilePositionSvc<T: PlaybackService>(pub Arc<T>); 3729 + impl< 3730 + T: PlaybackService, 3731 + > tonic::server::UnaryService<super::GetFilePositionRequest> 3732 + for GetFilePositionSvc<T> { 3733 + type Response = super::GetFilePositionResponse; 3734 + type Future = BoxFuture< 3735 + tonic::Response<Self::Response>, 3736 + tonic::Status, 3737 + >; 3738 + fn call( 3739 + &mut self, 3740 + request: tonic::Request<super::GetFilePositionRequest>, 3741 + ) -> Self::Future { 3742 + let inner = Arc::clone(&self.0); 3743 + let fut = async move { 3744 + <T as PlaybackService>::get_file_position(&inner, request) 3745 + .await 3746 + }; 3747 + Box::pin(fut) 3748 + } 3749 + } 3750 + let accept_compression_encodings = self.accept_compression_encodings; 3751 + let send_compression_encodings = self.send_compression_encodings; 3752 + let max_decoding_message_size = self.max_decoding_message_size; 3753 + let max_encoding_message_size = self.max_encoding_message_size; 3754 + let inner = self.inner.clone(); 3755 + let fut = async move { 3756 + let method = GetFilePositionSvc(inner); 3757 + let codec = tonic::codec::ProstCodec::default(); 3758 + let mut grpc = tonic::server::Grpc::new(codec) 3759 + .apply_compression_config( 3760 + accept_compression_encodings, 3761 + send_compression_encodings, 3762 + ) 3763 + .apply_max_message_size_config( 3764 + max_decoding_message_size, 3765 + max_encoding_message_size, 3766 + ); 3767 + let res = grpc.unary(method, req).await; 3768 + Ok(res) 3769 + }; 3770 + Box::pin(fut) 3771 + } 3772 + "/rockbox.v1alpha1.PlaybackService/HardStop" => { 3773 + #[allow(non_camel_case_types)] 3774 + struct HardStopSvc<T: PlaybackService>(pub Arc<T>); 3775 + impl< 3776 + T: PlaybackService, 3777 + > tonic::server::UnaryService<super::HardStopRequest> 3778 + for HardStopSvc<T> { 3779 + type Response = super::HardStopResponse; 3780 + type Future = BoxFuture< 3781 + tonic::Response<Self::Response>, 3782 + tonic::Status, 3783 + >; 3784 + fn call( 3785 + &mut self, 3786 + request: tonic::Request<super::HardStopRequest>, 3787 + ) -> Self::Future { 3788 + let inner = Arc::clone(&self.0); 3789 + let fut = async move { 3790 + <T as PlaybackService>::hard_stop(&inner, request).await 3791 + }; 3792 + Box::pin(fut) 3793 + } 3794 + } 3795 + let accept_compression_encodings = self.accept_compression_encodings; 3796 + let send_compression_encodings = self.send_compression_encodings; 3797 + let max_decoding_message_size = self.max_decoding_message_size; 3798 + let max_encoding_message_size = self.max_encoding_message_size; 3799 + let inner = self.inner.clone(); 3800 + let fut = async move { 3801 + let method = HardStopSvc(inner); 3802 + let codec = tonic::codec::ProstCodec::default(); 3803 + let mut grpc = tonic::server::Grpc::new(codec) 3804 + .apply_compression_config( 3805 + accept_compression_encodings, 3806 + send_compression_encodings, 3807 + ) 3808 + .apply_max_message_size_config( 3809 + max_decoding_message_size, 3810 + max_encoding_message_size, 3811 + ); 3812 + let res = grpc.unary(method, req).await; 3813 + Ok(res) 3814 + }; 3815 + Box::pin(fut) 3816 + } 3817 + "/rockbox.v1alpha1.PlaybackService/PlayAlbum" => { 3818 + #[allow(non_camel_case_types)] 3819 + struct PlayAlbumSvc<T: PlaybackService>(pub Arc<T>); 3820 + impl< 3821 + T: PlaybackService, 3822 + > tonic::server::UnaryService<super::PlayAlbumRequest> 3823 + for PlayAlbumSvc<T> { 3824 + type Response = super::PlayAlbumResponse; 3825 + type Future = BoxFuture< 3826 + tonic::Response<Self::Response>, 3827 + tonic::Status, 3828 + >; 3829 + fn call( 3830 + &mut self, 3831 + request: tonic::Request<super::PlayAlbumRequest>, 3832 + ) -> Self::Future { 3833 + let inner = Arc::clone(&self.0); 3834 + let fut = async move { 3835 + <T as PlaybackService>::play_album(&inner, request).await 3836 + }; 3837 + Box::pin(fut) 3838 + } 3839 + } 3840 + let accept_compression_encodings = self.accept_compression_encodings; 3841 + let send_compression_encodings = self.send_compression_encodings; 3842 + let max_decoding_message_size = self.max_decoding_message_size; 3843 + let max_encoding_message_size = self.max_encoding_message_size; 3844 + let inner = self.inner.clone(); 3845 + let fut = async move { 3846 + let method = PlayAlbumSvc(inner); 3847 + let codec = tonic::codec::ProstCodec::default(); 3848 + let mut grpc = tonic::server::Grpc::new(codec) 3849 + .apply_compression_config( 3850 + accept_compression_encodings, 3851 + send_compression_encodings, 3852 + ) 3853 + .apply_max_message_size_config( 3854 + max_decoding_message_size, 3855 + max_encoding_message_size, 3856 + ); 3857 + let res = grpc.unary(method, req).await; 3858 + Ok(res) 3859 + }; 3860 + Box::pin(fut) 3861 + } 3862 + "/rockbox.v1alpha1.PlaybackService/PlayArtistTracks" => { 3863 + #[allow(non_camel_case_types)] 3864 + struct PlayArtistTracksSvc<T: PlaybackService>(pub Arc<T>); 3865 + impl< 3866 + T: PlaybackService, 3867 + > tonic::server::UnaryService<super::PlayArtistTracksRequest> 3868 + for PlayArtistTracksSvc<T> { 3869 + type Response = super::PlayArtistTracksResponse; 3870 + type Future = BoxFuture< 3871 + tonic::Response<Self::Response>, 3872 + tonic::Status, 3873 + >; 3874 + fn call( 3875 + &mut self, 3876 + request: tonic::Request<super::PlayArtistTracksRequest>, 3877 + ) -> Self::Future { 3878 + let inner = Arc::clone(&self.0); 3879 + let fut = async move { 3880 + <T as PlaybackService>::play_artist_tracks(&inner, request) 3881 + .await 3882 + }; 3883 + Box::pin(fut) 3884 + } 3885 + } 3886 + let accept_compression_encodings = self.accept_compression_encodings; 3887 + let send_compression_encodings = self.send_compression_encodings; 3888 + let max_decoding_message_size = self.max_decoding_message_size; 3889 + let max_encoding_message_size = self.max_encoding_message_size; 3890 + let inner = self.inner.clone(); 3891 + let fut = async move { 3892 + let method = PlayArtistTracksSvc(inner); 3893 + let codec = tonic::codec::ProstCodec::default(); 3894 + let mut grpc = tonic::server::Grpc::new(codec) 3895 + .apply_compression_config( 3896 + accept_compression_encodings, 3897 + send_compression_encodings, 3898 + ) 3899 + .apply_max_message_size_config( 3900 + max_decoding_message_size, 3901 + max_encoding_message_size, 3902 + ); 3903 + let res = grpc.unary(method, req).await; 3904 + Ok(res) 3905 + }; 3906 + Box::pin(fut) 3907 + } 3908 + "/rockbox.v1alpha1.PlaybackService/PlayPlaylist" => { 3909 + #[allow(non_camel_case_types)] 3910 + struct PlayPlaylistSvc<T: PlaybackService>(pub Arc<T>); 3911 + impl< 3912 + T: PlaybackService, 3913 + > tonic::server::UnaryService<super::PlayPlaylistRequest> 3914 + for PlayPlaylistSvc<T> { 3915 + type Response = super::PlayPlaylistResponse; 3916 + type Future = BoxFuture< 3917 + tonic::Response<Self::Response>, 3918 + tonic::Status, 3919 + >; 3920 + fn call( 3921 + &mut self, 3922 + request: tonic::Request<super::PlayPlaylistRequest>, 3923 + ) -> Self::Future { 3924 + let inner = Arc::clone(&self.0); 3925 + let fut = async move { 3926 + <T as PlaybackService>::play_playlist(&inner, request).await 3927 + }; 3928 + Box::pin(fut) 3929 + } 3930 + } 3931 + let accept_compression_encodings = self.accept_compression_encodings; 3932 + let send_compression_encodings = self.send_compression_encodings; 3933 + let max_decoding_message_size = self.max_decoding_message_size; 3934 + let max_encoding_message_size = self.max_encoding_message_size; 3935 + let inner = self.inner.clone(); 3936 + let fut = async move { 3937 + let method = PlayPlaylistSvc(inner); 3938 + let codec = tonic::codec::ProstCodec::default(); 3939 + let mut grpc = tonic::server::Grpc::new(codec) 3940 + .apply_compression_config( 3941 + accept_compression_encodings, 3942 + send_compression_encodings, 3943 + ) 3944 + .apply_max_message_size_config( 3945 + max_decoding_message_size, 3946 + max_encoding_message_size, 3947 + ); 3948 + let res = grpc.unary(method, req).await; 3949 + Ok(res) 3950 + }; 3951 + Box::pin(fut) 3952 + } 3953 + "/rockbox.v1alpha1.PlaybackService/PlayDirectory" => { 3954 + #[allow(non_camel_case_types)] 3955 + struct PlayDirectorySvc<T: PlaybackService>(pub Arc<T>); 3956 + impl< 3957 + T: PlaybackService, 3958 + > tonic::server::UnaryService<super::PlayDirectoryRequest> 3959 + for PlayDirectorySvc<T> { 3960 + type Response = super::PlayDirectoryResponse; 3961 + type Future = BoxFuture< 3962 + tonic::Response<Self::Response>, 3963 + tonic::Status, 3964 + >; 3965 + fn call( 3966 + &mut self, 3967 + request: tonic::Request<super::PlayDirectoryRequest>, 3968 + ) -> Self::Future { 3969 + let inner = Arc::clone(&self.0); 3970 + let fut = async move { 3971 + <T as PlaybackService>::play_directory(&inner, request) 3972 + .await 3973 + }; 3974 + Box::pin(fut) 3975 + } 3976 + } 3977 + let accept_compression_encodings = self.accept_compression_encodings; 3978 + let send_compression_encodings = self.send_compression_encodings; 3979 + let max_decoding_message_size = self.max_decoding_message_size; 3980 + let max_encoding_message_size = self.max_encoding_message_size; 3981 + let inner = self.inner.clone(); 3982 + let fut = async move { 3983 + let method = PlayDirectorySvc(inner); 3984 + let codec = tonic::codec::ProstCodec::default(); 3985 + let mut grpc = tonic::server::Grpc::new(codec) 3986 + .apply_compression_config( 3987 + accept_compression_encodings, 3988 + send_compression_encodings, 3989 + ) 3990 + .apply_max_message_size_config( 3991 + max_decoding_message_size, 3992 + max_encoding_message_size, 3993 + ); 3994 + let res = grpc.unary(method, req).await; 3995 + Ok(res) 3996 + }; 3997 + Box::pin(fut) 3998 + } 3999 + "/rockbox.v1alpha1.PlaybackService/PlayTrack" => { 4000 + #[allow(non_camel_case_types)] 4001 + struct PlayTrackSvc<T: PlaybackService>(pub Arc<T>); 4002 + impl< 4003 + T: PlaybackService, 4004 + > tonic::server::UnaryService<super::PlayTrackRequest> 4005 + for PlayTrackSvc<T> { 4006 + type Response = super::PlayTrackResponse; 4007 + type Future = BoxFuture< 4008 + tonic::Response<Self::Response>, 4009 + tonic::Status, 4010 + >; 4011 + fn call( 4012 + &mut self, 4013 + request: tonic::Request<super::PlayTrackRequest>, 4014 + ) -> Self::Future { 4015 + let inner = Arc::clone(&self.0); 4016 + let fut = async move { 4017 + <T as PlaybackService>::play_track(&inner, request).await 4018 + }; 4019 + Box::pin(fut) 4020 + } 4021 + } 4022 + let accept_compression_encodings = self.accept_compression_encodings; 4023 + let send_compression_encodings = self.send_compression_encodings; 4024 + let max_decoding_message_size = self.max_decoding_message_size; 4025 + let max_encoding_message_size = self.max_encoding_message_size; 4026 + let inner = self.inner.clone(); 4027 + let fut = async move { 4028 + let method = PlayTrackSvc(inner); 4029 + let codec = tonic::codec::ProstCodec::default(); 4030 + let mut grpc = tonic::server::Grpc::new(codec) 4031 + .apply_compression_config( 4032 + accept_compression_encodings, 4033 + send_compression_encodings, 4034 + ) 4035 + .apply_max_message_size_config( 4036 + max_decoding_message_size, 4037 + max_encoding_message_size, 4038 + ); 4039 + let res = grpc.unary(method, req).await; 4040 + Ok(res) 4041 + }; 4042 + Box::pin(fut) 4043 + } 4044 + "/rockbox.v1alpha1.PlaybackService/PlayLikedTracks" => { 4045 + #[allow(non_camel_case_types)] 4046 + struct PlayLikedTracksSvc<T: PlaybackService>(pub Arc<T>); 4047 + impl< 4048 + T: PlaybackService, 4049 + > tonic::server::UnaryService<super::PlayLikedTracksRequest> 4050 + for PlayLikedTracksSvc<T> { 4051 + type Response = super::PlayLikedTracksResponse; 4052 + type Future = BoxFuture< 4053 + tonic::Response<Self::Response>, 4054 + tonic::Status, 4055 + >; 4056 + fn call( 4057 + &mut self, 4058 + request: tonic::Request<super::PlayLikedTracksRequest>, 4059 + ) -> Self::Future { 4060 + let inner = Arc::clone(&self.0); 4061 + let fut = async move { 4062 + <T as PlaybackService>::play_liked_tracks(&inner, request) 4063 + .await 4064 + }; 4065 + Box::pin(fut) 4066 + } 4067 + } 4068 + let accept_compression_encodings = self.accept_compression_encodings; 4069 + let send_compression_encodings = self.send_compression_encodings; 4070 + let max_decoding_message_size = self.max_decoding_message_size; 4071 + let max_encoding_message_size = self.max_encoding_message_size; 4072 + let inner = self.inner.clone(); 4073 + let fut = async move { 4074 + let method = PlayLikedTracksSvc(inner); 4075 + let codec = tonic::codec::ProstCodec::default(); 4076 + let mut grpc = tonic::server::Grpc::new(codec) 4077 + .apply_compression_config( 4078 + accept_compression_encodings, 4079 + send_compression_encodings, 4080 + ) 4081 + .apply_max_message_size_config( 4082 + max_decoding_message_size, 4083 + max_encoding_message_size, 4084 + ); 4085 + let res = grpc.unary(method, req).await; 4086 + Ok(res) 4087 + }; 4088 + Box::pin(fut) 4089 + } 4090 + "/rockbox.v1alpha1.PlaybackService/PlayAllTracks" => { 4091 + #[allow(non_camel_case_types)] 4092 + struct PlayAllTracksSvc<T: PlaybackService>(pub Arc<T>); 4093 + impl< 4094 + T: PlaybackService, 4095 + > tonic::server::UnaryService<super::PlayAllTracksRequest> 4096 + for PlayAllTracksSvc<T> { 4097 + type Response = super::PlayAllTracksResponse; 4098 + type Future = BoxFuture< 4099 + tonic::Response<Self::Response>, 4100 + tonic::Status, 4101 + >; 4102 + fn call( 4103 + &mut self, 4104 + request: tonic::Request<super::PlayAllTracksRequest>, 4105 + ) -> Self::Future { 4106 + let inner = Arc::clone(&self.0); 4107 + let fut = async move { 4108 + <T as PlaybackService>::play_all_tracks(&inner, request) 4109 + .await 4110 + }; 4111 + Box::pin(fut) 4112 + } 4113 + } 4114 + let accept_compression_encodings = self.accept_compression_encodings; 4115 + let send_compression_encodings = self.send_compression_encodings; 4116 + let max_decoding_message_size = self.max_decoding_message_size; 4117 + let max_encoding_message_size = self.max_encoding_message_size; 4118 + let inner = self.inner.clone(); 4119 + let fut = async move { 4120 + let method = PlayAllTracksSvc(inner); 4121 + let codec = tonic::codec::ProstCodec::default(); 4122 + let mut grpc = tonic::server::Grpc::new(codec) 4123 + .apply_compression_config( 4124 + accept_compression_encodings, 4125 + send_compression_encodings, 4126 + ) 4127 + .apply_max_message_size_config( 4128 + max_decoding_message_size, 4129 + max_encoding_message_size, 4130 + ); 4131 + let res = grpc.unary(method, req).await; 4132 + Ok(res) 4133 + }; 4134 + Box::pin(fut) 4135 + } 4136 + "/rockbox.v1alpha1.PlaybackService/StreamCurrentTrack" => { 4137 + #[allow(non_camel_case_types)] 4138 + struct StreamCurrentTrackSvc<T: PlaybackService>(pub Arc<T>); 4139 + impl< 4140 + T: PlaybackService, 4141 + > tonic::server::ServerStreamingService< 4142 + super::StreamCurrentTrackRequest, 4143 + > for StreamCurrentTrackSvc<T> { 4144 + type Response = super::CurrentTrackResponse; 4145 + type ResponseStream = T::StreamCurrentTrackStream; 4146 + type Future = BoxFuture< 4147 + tonic::Response<Self::ResponseStream>, 4148 + tonic::Status, 4149 + >; 4150 + fn call( 4151 + &mut self, 4152 + request: tonic::Request<super::StreamCurrentTrackRequest>, 4153 + ) -> Self::Future { 4154 + let inner = Arc::clone(&self.0); 4155 + let fut = async move { 4156 + <T as PlaybackService>::stream_current_track( 4157 + &inner, 4158 + request, 4159 + ) 4160 + .await 4161 + }; 4162 + Box::pin(fut) 4163 + } 4164 + } 4165 + let accept_compression_encodings = self.accept_compression_encodings; 4166 + let send_compression_encodings = self.send_compression_encodings; 4167 + let max_decoding_message_size = self.max_decoding_message_size; 4168 + let max_encoding_message_size = self.max_encoding_message_size; 4169 + let inner = self.inner.clone(); 4170 + let fut = async move { 4171 + let method = StreamCurrentTrackSvc(inner); 4172 + let codec = tonic::codec::ProstCodec::default(); 4173 + let mut grpc = tonic::server::Grpc::new(codec) 4174 + .apply_compression_config( 4175 + accept_compression_encodings, 4176 + send_compression_encodings, 4177 + ) 4178 + .apply_max_message_size_config( 4179 + max_decoding_message_size, 4180 + max_encoding_message_size, 4181 + ); 4182 + let res = grpc.server_streaming(method, req).await; 4183 + Ok(res) 4184 + }; 4185 + Box::pin(fut) 4186 + } 4187 + "/rockbox.v1alpha1.PlaybackService/StreamStatus" => { 4188 + #[allow(non_camel_case_types)] 4189 + struct StreamStatusSvc<T: PlaybackService>(pub Arc<T>); 4190 + impl< 4191 + T: PlaybackService, 4192 + > tonic::server::ServerStreamingService<super::StreamStatusRequest> 4193 + for StreamStatusSvc<T> { 4194 + type Response = super::StatusResponse; 4195 + type ResponseStream = T::StreamStatusStream; 4196 + type Future = BoxFuture< 4197 + tonic::Response<Self::ResponseStream>, 4198 + tonic::Status, 4199 + >; 4200 + fn call( 4201 + &mut self, 4202 + request: tonic::Request<super::StreamStatusRequest>, 4203 + ) -> Self::Future { 4204 + let inner = Arc::clone(&self.0); 4205 + let fut = async move { 4206 + <T as PlaybackService>::stream_status(&inner, request).await 4207 + }; 4208 + Box::pin(fut) 4209 + } 4210 + } 4211 + let accept_compression_encodings = self.accept_compression_encodings; 4212 + let send_compression_encodings = self.send_compression_encodings; 4213 + let max_decoding_message_size = self.max_decoding_message_size; 4214 + let max_encoding_message_size = self.max_encoding_message_size; 4215 + let inner = self.inner.clone(); 4216 + let fut = async move { 4217 + let method = StreamStatusSvc(inner); 4218 + let codec = tonic::codec::ProstCodec::default(); 4219 + let mut grpc = tonic::server::Grpc::new(codec) 4220 + .apply_compression_config( 4221 + accept_compression_encodings, 4222 + send_compression_encodings, 4223 + ) 4224 + .apply_max_message_size_config( 4225 + max_decoding_message_size, 4226 + max_encoding_message_size, 4227 + ); 4228 + let res = grpc.server_streaming(method, req).await; 4229 + Ok(res) 4230 + }; 4231 + Box::pin(fut) 4232 + } 4233 + "/rockbox.v1alpha1.PlaybackService/StreamPlaylist" => { 4234 + #[allow(non_camel_case_types)] 4235 + struct StreamPlaylistSvc<T: PlaybackService>(pub Arc<T>); 4236 + impl< 4237 + T: PlaybackService, 4238 + > tonic::server::ServerStreamingService<super::StreamPlaylistRequest> 4239 + for StreamPlaylistSvc<T> { 4240 + type Response = super::PlaylistResponse; 4241 + type ResponseStream = T::StreamPlaylistStream; 4242 + type Future = BoxFuture< 4243 + tonic::Response<Self::ResponseStream>, 4244 + tonic::Status, 4245 + >; 4246 + fn call( 4247 + &mut self, 4248 + request: tonic::Request<super::StreamPlaylistRequest>, 4249 + ) -> Self::Future { 4250 + let inner = Arc::clone(&self.0); 4251 + let fut = async move { 4252 + <T as PlaybackService>::stream_playlist(&inner, request) 4253 + .await 4254 + }; 4255 + Box::pin(fut) 4256 + } 4257 + } 4258 + let accept_compression_encodings = self.accept_compression_encodings; 4259 + let send_compression_encodings = self.send_compression_encodings; 4260 + let max_decoding_message_size = self.max_decoding_message_size; 4261 + let max_encoding_message_size = self.max_encoding_message_size; 4262 + let inner = self.inner.clone(); 4263 + let fut = async move { 4264 + let method = StreamPlaylistSvc(inner); 4265 + let codec = tonic::codec::ProstCodec::default(); 4266 + let mut grpc = tonic::server::Grpc::new(codec) 4267 + .apply_compression_config( 4268 + accept_compression_encodings, 4269 + send_compression_encodings, 4270 + ) 4271 + .apply_max_message_size_config( 4272 + max_decoding_message_size, 4273 + max_encoding_message_size, 4274 + ); 4275 + let res = grpc.server_streaming(method, req).await; 4276 + Ok(res) 4277 + }; 4278 + Box::pin(fut) 4279 + } 4280 + _ => { 4281 + Box::pin(async move { 4282 + let mut response = http::Response::new(empty_body()); 4283 + let headers = response.headers_mut(); 4284 + headers 4285 + .insert( 4286 + tonic::Status::GRPC_STATUS, 4287 + (tonic::Code::Unimplemented as i32).into(), 4288 + ); 4289 + headers 4290 + .insert( 4291 + http::header::CONTENT_TYPE, 4292 + tonic::metadata::GRPC_CONTENT_TYPE, 4293 + ); 4294 + Ok(response) 4295 + }) 4296 + } 4297 + } 4298 + } 4299 + } 4300 + impl<T> Clone for PlaybackServiceServer<T> { 4301 + fn clone(&self) -> Self { 4302 + let inner = self.inner.clone(); 4303 + Self { 4304 + inner, 4305 + accept_compression_encodings: self.accept_compression_encodings, 4306 + send_compression_encodings: self.send_compression_encodings, 4307 + max_decoding_message_size: self.max_decoding_message_size, 4308 + max_encoding_message_size: self.max_encoding_message_size, 4309 + } 4310 + } 4311 + } 4312 + /// Generated gRPC service name 4313 + pub const SERVICE_NAME: &str = "rockbox.v1alpha1.PlaybackService"; 4314 + impl<T> tonic::server::NamedService for PlaybackServiceServer<T> { 4315 + const NAME: &'static str = SERVICE_NAME; 4316 + } 4317 + } 4318 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 4319 + pub struct GetCurrentRequest {} 4320 + #[derive(Clone, PartialEq, ::prost::Message)] 4321 + pub struct GetCurrentResponse { 4322 + #[prost(int32, tag = "1")] 4323 + pub index: i32, 4324 + #[prost(int32, tag = "2")] 4325 + pub amount: i32, 4326 + #[prost(int32, tag = "3")] 4327 + pub max_playlist_size: i32, 4328 + #[prost(int32, tag = "4")] 4329 + pub first_index: i32, 4330 + #[prost(int32, tag = "5")] 4331 + pub last_insert_pos: i32, 4332 + #[prost(int32, tag = "6")] 4333 + pub seed: i32, 4334 + #[prost(int32, tag = "7")] 4335 + pub last_shuffled_start: i32, 4336 + #[prost(message, repeated, tag = "8")] 4337 + pub tracks: ::prost::alloc::vec::Vec<CurrentTrackResponse>, 4338 + } 4339 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 4340 + pub struct GetResumeInfoRequest {} 4341 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 4342 + pub struct GetResumeInfoResponse {} 4343 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 4344 + pub struct GetTrackInfoRequest {} 4345 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 4346 + pub struct GetTrackInfoResponse {} 4347 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 4348 + pub struct GetFirstIndexRequest {} 4349 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 4350 + pub struct GetFirstIndexResponse {} 4351 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 4352 + pub struct GetDisplayIndexRequest {} 4353 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 4354 + pub struct GetDisplayIndexResponse {} 4355 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 4356 + pub struct AmountRequest {} 4357 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 4358 + pub struct AmountResponse { 4359 + #[prost(int32, tag = "1")] 4360 + pub amount: i32, 4361 + } 4362 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 4363 + pub struct PlaylistResumeRequest {} 4364 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 4365 + pub struct PlaylistResumeResponse { 4366 + #[prost(int32, tag = "1")] 4367 + pub code: i32, 4368 + } 4369 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 4370 + pub struct ResumeTrackRequest { 4371 + #[prost(int32, tag = "1")] 4372 + pub start_index: i32, 4373 + #[prost(uint32, tag = "2")] 4374 + pub crc: u32, 4375 + #[prost(uint64, tag = "3")] 4376 + pub elapsed: u64, 4377 + #[prost(uint64, tag = "4")] 4378 + pub offset: u64, 4379 + } 4380 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 4381 + pub struct ResumeTrackResponse {} 4382 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 4383 + pub struct SetModifiedRequest {} 4384 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 4385 + pub struct SetModifiedResponse {} 4386 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 4387 + pub struct StartRequest { 4388 + #[prost(int32, optional, tag = "1")] 4389 + pub start_index: ::core::option::Option<i32>, 4390 + #[prost(int32, optional, tag = "2")] 4391 + pub elapsed: ::core::option::Option<i32>, 4392 + #[prost(int32, optional, tag = "3")] 4393 + pub offset: ::core::option::Option<i32>, 4394 + } 4395 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 4396 + pub struct StartResponse {} 4397 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 4398 + pub struct SyncRequest {} 4399 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 4400 + pub struct SyncResponse {} 4401 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 4402 + pub struct RemoveAllTracksRequest {} 4403 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 4404 + pub struct RemoveAllTracksResponse {} 4405 + #[derive(Clone, PartialEq, ::prost::Message)] 4406 + pub struct RemoveTracksRequest { 4407 + #[prost(int32, repeated, tag = "1")] 4408 + pub positions: ::prost::alloc::vec::Vec<i32>, 4409 + } 4410 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 4411 + pub struct RemoveTracksResponse {} 4412 + #[derive(Clone, PartialEq, ::prost::Message)] 4413 + pub struct CreatePlaylistRequest { 4414 + #[prost(string, tag = "1")] 4415 + pub name: ::prost::alloc::string::String, 4416 + #[prost(string, repeated, tag = "2")] 4417 + pub tracks: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, 4418 + #[prost(string, optional, tag = "3")] 4419 + pub folder_id: ::core::option::Option<::prost::alloc::string::String>, 4420 + } 4421 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 4422 + pub struct CreatePlaylistResponse { 4423 + #[prost(int32, tag = "1")] 4424 + pub start_index: i32, 4425 + } 4426 + #[derive(Clone, PartialEq, ::prost::Message)] 4427 + pub struct InsertTracksRequest { 4428 + #[prost(string, optional, tag = "1")] 4429 + pub playlist_id: ::core::option::Option<::prost::alloc::string::String>, 4430 + #[prost(int32, tag = "2")] 4431 + pub position: i32, 4432 + #[prost(string, repeated, tag = "3")] 4433 + pub tracks: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, 4434 + #[prost(bool, optional, tag = "4")] 4435 + pub shuffle: ::core::option::Option<bool>, 4436 + } 4437 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 4438 + pub struct InsertTracksResponse {} 4439 + #[derive(Clone, PartialEq, ::prost::Message)] 4440 + pub struct InsertDirectoryRequest { 4441 + #[prost(string, optional, tag = "1")] 4442 + pub playlist_id: ::core::option::Option<::prost::alloc::string::String>, 4443 + #[prost(int32, tag = "2")] 4444 + pub position: i32, 4445 + #[prost(string, tag = "3")] 4446 + pub directory: ::prost::alloc::string::String, 4447 + #[prost(bool, optional, tag = "4")] 4448 + pub recurse: ::core::option::Option<bool>, 4449 + #[prost(bool, optional, tag = "5")] 4450 + pub shuffle: ::core::option::Option<bool>, 4451 + } 4452 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 4453 + pub struct InsertDirectoryResponse {} 4454 + #[derive(Clone, PartialEq, ::prost::Message)] 4455 + pub struct InsertPlaylistRequest { 4456 + #[prost(int32, tag = "1")] 4457 + pub position: i32, 4458 + #[prost(string, tag = "2")] 4459 + pub target_playlist_id: ::prost::alloc::string::String, 4460 + #[prost(string, tag = "3")] 4461 + pub playlist_id: ::prost::alloc::string::String, 4462 + #[prost(bool, optional, tag = "4")] 4463 + pub shuffle: ::core::option::Option<bool>, 4464 + } 4465 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 4466 + pub struct InsertPlaylistResponse {} 4467 + #[derive(Clone, PartialEq, ::prost::Message)] 4468 + pub struct InsertAlbumRequest { 4469 + #[prost(int32, tag = "1")] 4470 + pub position: i32, 4471 + #[prost(string, tag = "2")] 4472 + pub album_id: ::prost::alloc::string::String, 4473 + #[prost(bool, optional, tag = "3")] 4474 + pub shuffle: ::core::option::Option<bool>, 4475 + } 4476 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 4477 + pub struct InsertAlbumResponse {} 4478 + #[derive(Clone, PartialEq, ::prost::Message)] 4479 + pub struct InsertArtistTracksRequest { 4480 + #[prost(int32, tag = "1")] 4481 + pub position: i32, 4482 + #[prost(string, tag = "2")] 4483 + pub artist_id: ::prost::alloc::string::String, 4484 + #[prost(bool, optional, tag = "3")] 4485 + pub shuffle: ::core::option::Option<bool>, 4486 + } 4487 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 4488 + pub struct InsertArtistTracksResponse {} 4489 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 4490 + pub struct ShufflePlaylistRequest { 4491 + #[prost(int32, tag = "1")] 4492 + pub start_index: i32, 4493 + } 4494 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 4495 + pub struct ShufflePlaylistResponse {} 4496 + /// Generated client implementations. 4497 + pub mod playlist_service_client { 4498 + #![allow( 4499 + unused_variables, 4500 + dead_code, 4501 + missing_docs, 4502 + clippy::wildcard_imports, 4503 + clippy::let_unit_value, 4504 + )] 4505 + use tonic::codegen::*; 4506 + use tonic::codegen::http::Uri; 4507 + #[derive(Debug, Clone)] 4508 + pub struct PlaylistServiceClient<T> { 4509 + inner: tonic::client::Grpc<T>, 4510 + } 4511 + impl PlaylistServiceClient<tonic::transport::Channel> { 4512 + /// Attempt to create a new client by connecting to a given endpoint. 4513 + pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error> 4514 + where 4515 + D: TryInto<tonic::transport::Endpoint>, 4516 + D::Error: Into<StdError>, 4517 + { 4518 + let conn = tonic::transport::Endpoint::new(dst)?.connect().await?; 4519 + Ok(Self::new(conn)) 4520 + } 4521 + } 4522 + impl<T> PlaylistServiceClient<T> 4523 + where 4524 + T: tonic::client::GrpcService<tonic::body::BoxBody>, 4525 + T::Error: Into<StdError>, 4526 + T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static, 4527 + <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send, 4528 + { 4529 + pub fn new(inner: T) -> Self { 4530 + let inner = tonic::client::Grpc::new(inner); 4531 + Self { inner } 4532 + } 4533 + pub fn with_origin(inner: T, origin: Uri) -> Self { 4534 + let inner = tonic::client::Grpc::with_origin(inner, origin); 4535 + Self { inner } 4536 + } 4537 + pub fn with_interceptor<F>( 4538 + inner: T, 4539 + interceptor: F, 4540 + ) -> PlaylistServiceClient<InterceptedService<T, F>> 4541 + where 4542 + F: tonic::service::Interceptor, 4543 + T::ResponseBody: Default, 4544 + T: tonic::codegen::Service< 4545 + http::Request<tonic::body::BoxBody>, 4546 + Response = http::Response< 4547 + <T as tonic::client::GrpcService<tonic::body::BoxBody>>::ResponseBody, 4548 + >, 4549 + >, 4550 + <T as tonic::codegen::Service< 4551 + http::Request<tonic::body::BoxBody>, 4552 + >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync, 4553 + { 4554 + PlaylistServiceClient::new(InterceptedService::new(inner, interceptor)) 4555 + } 4556 + /// Compress requests with the given encoding. 4557 + /// 4558 + /// This requires the server to support it otherwise it might respond with an 4559 + /// error. 4560 + #[must_use] 4561 + pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { 4562 + self.inner = self.inner.send_compressed(encoding); 4563 + self 4564 + } 4565 + /// Enable decompressing responses. 4566 + #[must_use] 4567 + pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { 4568 + self.inner = self.inner.accept_compressed(encoding); 4569 + self 4570 + } 4571 + /// Limits the maximum size of a decoded message. 4572 + /// 4573 + /// Default: `4MB` 4574 + #[must_use] 4575 + pub fn max_decoding_message_size(mut self, limit: usize) -> Self { 4576 + self.inner = self.inner.max_decoding_message_size(limit); 4577 + self 4578 + } 4579 + /// Limits the maximum size of an encoded message. 4580 + /// 4581 + /// Default: `usize::MAX` 4582 + #[must_use] 4583 + pub fn max_encoding_message_size(mut self, limit: usize) -> Self { 4584 + self.inner = self.inner.max_encoding_message_size(limit); 4585 + self 4586 + } 4587 + pub async fn get_current( 4588 + &mut self, 4589 + request: impl tonic::IntoRequest<super::GetCurrentRequest>, 4590 + ) -> std::result::Result< 4591 + tonic::Response<super::GetCurrentResponse>, 4592 + tonic::Status, 4593 + > { 4594 + self.inner 4595 + .ready() 4596 + .await 4597 + .map_err(|e| { 4598 + tonic::Status::unknown( 4599 + format!("Service was not ready: {}", e.into()), 4600 + ) 4601 + })?; 4602 + let codec = tonic::codec::ProstCodec::default(); 4603 + let path = http::uri::PathAndQuery::from_static( 4604 + "/rockbox.v1alpha1.PlaylistService/GetCurrent", 4605 + ); 4606 + let mut req = request.into_request(); 4607 + req.extensions_mut() 4608 + .insert( 4609 + GrpcMethod::new("rockbox.v1alpha1.PlaylistService", "GetCurrent"), 4610 + ); 4611 + self.inner.unary(req, path, codec).await 4612 + } 4613 + pub async fn get_resume_info( 4614 + &mut self, 4615 + request: impl tonic::IntoRequest<super::GetResumeInfoRequest>, 4616 + ) -> std::result::Result< 4617 + tonic::Response<super::GetResumeInfoResponse>, 4618 + tonic::Status, 4619 + > { 4620 + self.inner 4621 + .ready() 4622 + .await 4623 + .map_err(|e| { 4624 + tonic::Status::unknown( 4625 + format!("Service was not ready: {}", e.into()), 4626 + ) 4627 + })?; 4628 + let codec = tonic::codec::ProstCodec::default(); 4629 + let path = http::uri::PathAndQuery::from_static( 4630 + "/rockbox.v1alpha1.PlaylistService/GetResumeInfo", 4631 + ); 4632 + let mut req = request.into_request(); 4633 + req.extensions_mut() 4634 + .insert( 4635 + GrpcMethod::new("rockbox.v1alpha1.PlaylistService", "GetResumeInfo"), 4636 + ); 4637 + self.inner.unary(req, path, codec).await 4638 + } 4639 + pub async fn get_track_info( 4640 + &mut self, 4641 + request: impl tonic::IntoRequest<super::GetTrackInfoRequest>, 4642 + ) -> std::result::Result< 4643 + tonic::Response<super::GetTrackInfoResponse>, 4644 + tonic::Status, 4645 + > { 4646 + self.inner 4647 + .ready() 4648 + .await 4649 + .map_err(|e| { 4650 + tonic::Status::unknown( 4651 + format!("Service was not ready: {}", e.into()), 4652 + ) 4653 + })?; 4654 + let codec = tonic::codec::ProstCodec::default(); 4655 + let path = http::uri::PathAndQuery::from_static( 4656 + "/rockbox.v1alpha1.PlaylistService/GetTrackInfo", 4657 + ); 4658 + let mut req = request.into_request(); 4659 + req.extensions_mut() 4660 + .insert( 4661 + GrpcMethod::new("rockbox.v1alpha1.PlaylistService", "GetTrackInfo"), 4662 + ); 4663 + self.inner.unary(req, path, codec).await 4664 + } 4665 + pub async fn get_first_index( 4666 + &mut self, 4667 + request: impl tonic::IntoRequest<super::GetFirstIndexRequest>, 4668 + ) -> std::result::Result< 4669 + tonic::Response<super::GetFirstIndexResponse>, 4670 + tonic::Status, 4671 + > { 4672 + self.inner 4673 + .ready() 4674 + .await 4675 + .map_err(|e| { 4676 + tonic::Status::unknown( 4677 + format!("Service was not ready: {}", e.into()), 4678 + ) 4679 + })?; 4680 + let codec = tonic::codec::ProstCodec::default(); 4681 + let path = http::uri::PathAndQuery::from_static( 4682 + "/rockbox.v1alpha1.PlaylistService/GetFirstIndex", 4683 + ); 4684 + let mut req = request.into_request(); 4685 + req.extensions_mut() 4686 + .insert( 4687 + GrpcMethod::new("rockbox.v1alpha1.PlaylistService", "GetFirstIndex"), 4688 + ); 4689 + self.inner.unary(req, path, codec).await 4690 + } 4691 + pub async fn get_display_index( 4692 + &mut self, 4693 + request: impl tonic::IntoRequest<super::GetDisplayIndexRequest>, 4694 + ) -> std::result::Result< 4695 + tonic::Response<super::GetDisplayIndexResponse>, 4696 + tonic::Status, 4697 + > { 4698 + self.inner 4699 + .ready() 4700 + .await 4701 + .map_err(|e| { 4702 + tonic::Status::unknown( 4703 + format!("Service was not ready: {}", e.into()), 4704 + ) 4705 + })?; 4706 + let codec = tonic::codec::ProstCodec::default(); 4707 + let path = http::uri::PathAndQuery::from_static( 4708 + "/rockbox.v1alpha1.PlaylistService/GetDisplayIndex", 4709 + ); 4710 + let mut req = request.into_request(); 4711 + req.extensions_mut() 4712 + .insert( 4713 + GrpcMethod::new( 4714 + "rockbox.v1alpha1.PlaylistService", 4715 + "GetDisplayIndex", 4716 + ), 4717 + ); 4718 + self.inner.unary(req, path, codec).await 4719 + } 4720 + pub async fn amount( 4721 + &mut self, 4722 + request: impl tonic::IntoRequest<super::AmountRequest>, 4723 + ) -> std::result::Result<tonic::Response<super::AmountResponse>, tonic::Status> { 4724 + self.inner 4725 + .ready() 4726 + .await 4727 + .map_err(|e| { 4728 + tonic::Status::unknown( 4729 + format!("Service was not ready: {}", e.into()), 4730 + ) 4731 + })?; 4732 + let codec = tonic::codec::ProstCodec::default(); 4733 + let path = http::uri::PathAndQuery::from_static( 4734 + "/rockbox.v1alpha1.PlaylistService/Amount", 4735 + ); 4736 + let mut req = request.into_request(); 4737 + req.extensions_mut() 4738 + .insert(GrpcMethod::new("rockbox.v1alpha1.PlaylistService", "Amount")); 4739 + self.inner.unary(req, path, codec).await 4740 + } 4741 + pub async fn playlist_resume( 4742 + &mut self, 4743 + request: impl tonic::IntoRequest<super::PlaylistResumeRequest>, 4744 + ) -> std::result::Result< 4745 + tonic::Response<super::PlaylistResumeResponse>, 4746 + tonic::Status, 4747 + > { 4748 + self.inner 4749 + .ready() 4750 + .await 4751 + .map_err(|e| { 4752 + tonic::Status::unknown( 4753 + format!("Service was not ready: {}", e.into()), 4754 + ) 4755 + })?; 4756 + let codec = tonic::codec::ProstCodec::default(); 4757 + let path = http::uri::PathAndQuery::from_static( 4758 + "/rockbox.v1alpha1.PlaylistService/PlaylistResume", 4759 + ); 4760 + let mut req = request.into_request(); 4761 + req.extensions_mut() 4762 + .insert( 4763 + GrpcMethod::new("rockbox.v1alpha1.PlaylistService", "PlaylistResume"), 4764 + ); 4765 + self.inner.unary(req, path, codec).await 4766 + } 4767 + pub async fn resume_track( 4768 + &mut self, 4769 + request: impl tonic::IntoRequest<super::ResumeTrackRequest>, 4770 + ) -> std::result::Result< 4771 + tonic::Response<super::ResumeTrackResponse>, 4772 + tonic::Status, 4773 + > { 4774 + self.inner 4775 + .ready() 4776 + .await 4777 + .map_err(|e| { 4778 + tonic::Status::unknown( 4779 + format!("Service was not ready: {}", e.into()), 4780 + ) 4781 + })?; 4782 + let codec = tonic::codec::ProstCodec::default(); 4783 + let path = http::uri::PathAndQuery::from_static( 4784 + "/rockbox.v1alpha1.PlaylistService/ResumeTrack", 4785 + ); 4786 + let mut req = request.into_request(); 4787 + req.extensions_mut() 4788 + .insert( 4789 + GrpcMethod::new("rockbox.v1alpha1.PlaylistService", "ResumeTrack"), 4790 + ); 4791 + self.inner.unary(req, path, codec).await 4792 + } 4793 + pub async fn set_modified( 4794 + &mut self, 4795 + request: impl tonic::IntoRequest<super::SetModifiedRequest>, 4796 + ) -> std::result::Result< 4797 + tonic::Response<super::SetModifiedResponse>, 4798 + tonic::Status, 4799 + > { 4800 + self.inner 4801 + .ready() 4802 + .await 4803 + .map_err(|e| { 4804 + tonic::Status::unknown( 4805 + format!("Service was not ready: {}", e.into()), 4806 + ) 4807 + })?; 4808 + let codec = tonic::codec::ProstCodec::default(); 4809 + let path = http::uri::PathAndQuery::from_static( 4810 + "/rockbox.v1alpha1.PlaylistService/SetModified", 4811 + ); 4812 + let mut req = request.into_request(); 4813 + req.extensions_mut() 4814 + .insert( 4815 + GrpcMethod::new("rockbox.v1alpha1.PlaylistService", "SetModified"), 4816 + ); 4817 + self.inner.unary(req, path, codec).await 4818 + } 4819 + pub async fn start( 4820 + &mut self, 4821 + request: impl tonic::IntoRequest<super::StartRequest>, 4822 + ) -> std::result::Result<tonic::Response<super::StartResponse>, tonic::Status> { 4823 + self.inner 4824 + .ready() 4825 + .await 4826 + .map_err(|e| { 4827 + tonic::Status::unknown( 4828 + format!("Service was not ready: {}", e.into()), 4829 + ) 4830 + })?; 4831 + let codec = tonic::codec::ProstCodec::default(); 4832 + let path = http::uri::PathAndQuery::from_static( 4833 + "/rockbox.v1alpha1.PlaylistService/Start", 4834 + ); 4835 + let mut req = request.into_request(); 4836 + req.extensions_mut() 4837 + .insert(GrpcMethod::new("rockbox.v1alpha1.PlaylistService", "Start")); 4838 + self.inner.unary(req, path, codec).await 4839 + } 4840 + pub async fn sync( 4841 + &mut self, 4842 + request: impl tonic::IntoRequest<super::SyncRequest>, 4843 + ) -> std::result::Result<tonic::Response<super::SyncResponse>, tonic::Status> { 4844 + self.inner 4845 + .ready() 4846 + .await 4847 + .map_err(|e| { 4848 + tonic::Status::unknown( 4849 + format!("Service was not ready: {}", e.into()), 4850 + ) 4851 + })?; 4852 + let codec = tonic::codec::ProstCodec::default(); 4853 + let path = http::uri::PathAndQuery::from_static( 4854 + "/rockbox.v1alpha1.PlaylistService/Sync", 4855 + ); 4856 + let mut req = request.into_request(); 4857 + req.extensions_mut() 4858 + .insert(GrpcMethod::new("rockbox.v1alpha1.PlaylistService", "Sync")); 4859 + self.inner.unary(req, path, codec).await 4860 + } 4861 + pub async fn remove_all_tracks( 4862 + &mut self, 4863 + request: impl tonic::IntoRequest<super::RemoveAllTracksRequest>, 4864 + ) -> std::result::Result< 4865 + tonic::Response<super::RemoveAllTracksResponse>, 4866 + tonic::Status, 4867 + > { 4868 + self.inner 4869 + .ready() 4870 + .await 4871 + .map_err(|e| { 4872 + tonic::Status::unknown( 4873 + format!("Service was not ready: {}", e.into()), 4874 + ) 4875 + })?; 4876 + let codec = tonic::codec::ProstCodec::default(); 4877 + let path = http::uri::PathAndQuery::from_static( 4878 + "/rockbox.v1alpha1.PlaylistService/RemoveAllTracks", 4879 + ); 4880 + let mut req = request.into_request(); 4881 + req.extensions_mut() 4882 + .insert( 4883 + GrpcMethod::new( 4884 + "rockbox.v1alpha1.PlaylistService", 4885 + "RemoveAllTracks", 4886 + ), 4887 + ); 4888 + self.inner.unary(req, path, codec).await 4889 + } 4890 + pub async fn remove_tracks( 4891 + &mut self, 4892 + request: impl tonic::IntoRequest<super::RemoveTracksRequest>, 4893 + ) -> std::result::Result< 4894 + tonic::Response<super::RemoveTracksResponse>, 4895 + tonic::Status, 4896 + > { 4897 + self.inner 4898 + .ready() 4899 + .await 4900 + .map_err(|e| { 4901 + tonic::Status::unknown( 4902 + format!("Service was not ready: {}", e.into()), 4903 + ) 4904 + })?; 4905 + let codec = tonic::codec::ProstCodec::default(); 4906 + let path = http::uri::PathAndQuery::from_static( 4907 + "/rockbox.v1alpha1.PlaylistService/RemoveTracks", 4908 + ); 4909 + let mut req = request.into_request(); 4910 + req.extensions_mut() 4911 + .insert( 4912 + GrpcMethod::new("rockbox.v1alpha1.PlaylistService", "RemoveTracks"), 4913 + ); 4914 + self.inner.unary(req, path, codec).await 4915 + } 4916 + pub async fn create_playlist( 4917 + &mut self, 4918 + request: impl tonic::IntoRequest<super::CreatePlaylistRequest>, 4919 + ) -> std::result::Result< 4920 + tonic::Response<super::CreatePlaylistResponse>, 4921 + tonic::Status, 4922 + > { 4923 + self.inner 4924 + .ready() 4925 + .await 4926 + .map_err(|e| { 4927 + tonic::Status::unknown( 4928 + format!("Service was not ready: {}", e.into()), 4929 + ) 4930 + })?; 4931 + let codec = tonic::codec::ProstCodec::default(); 4932 + let path = http::uri::PathAndQuery::from_static( 4933 + "/rockbox.v1alpha1.PlaylistService/CreatePlaylist", 4934 + ); 4935 + let mut req = request.into_request(); 4936 + req.extensions_mut() 4937 + .insert( 4938 + GrpcMethod::new("rockbox.v1alpha1.PlaylistService", "CreatePlaylist"), 4939 + ); 4940 + self.inner.unary(req, path, codec).await 4941 + } 4942 + pub async fn insert_tracks( 4943 + &mut self, 4944 + request: impl tonic::IntoRequest<super::InsertTracksRequest>, 4945 + ) -> std::result::Result< 4946 + tonic::Response<super::InsertTracksResponse>, 4947 + tonic::Status, 4948 + > { 4949 + self.inner 4950 + .ready() 4951 + .await 4952 + .map_err(|e| { 4953 + tonic::Status::unknown( 4954 + format!("Service was not ready: {}", e.into()), 4955 + ) 4956 + })?; 4957 + let codec = tonic::codec::ProstCodec::default(); 4958 + let path = http::uri::PathAndQuery::from_static( 4959 + "/rockbox.v1alpha1.PlaylistService/InsertTracks", 4960 + ); 4961 + let mut req = request.into_request(); 4962 + req.extensions_mut() 4963 + .insert( 4964 + GrpcMethod::new("rockbox.v1alpha1.PlaylistService", "InsertTracks"), 4965 + ); 4966 + self.inner.unary(req, path, codec).await 4967 + } 4968 + pub async fn insert_directory( 4969 + &mut self, 4970 + request: impl tonic::IntoRequest<super::InsertDirectoryRequest>, 4971 + ) -> std::result::Result< 4972 + tonic::Response<super::InsertDirectoryResponse>, 4973 + tonic::Status, 4974 + > { 4975 + self.inner 4976 + .ready() 4977 + .await 4978 + .map_err(|e| { 4979 + tonic::Status::unknown( 4980 + format!("Service was not ready: {}", e.into()), 4981 + ) 4982 + })?; 4983 + let codec = tonic::codec::ProstCodec::default(); 4984 + let path = http::uri::PathAndQuery::from_static( 4985 + "/rockbox.v1alpha1.PlaylistService/InsertDirectory", 4986 + ); 4987 + let mut req = request.into_request(); 4988 + req.extensions_mut() 4989 + .insert( 4990 + GrpcMethod::new( 4991 + "rockbox.v1alpha1.PlaylistService", 4992 + "InsertDirectory", 4993 + ), 4994 + ); 4995 + self.inner.unary(req, path, codec).await 4996 + } 4997 + pub async fn insert_playlist( 4998 + &mut self, 4999 + request: impl tonic::IntoRequest<super::InsertPlaylistRequest>, 5000 + ) -> std::result::Result< 5001 + tonic::Response<super::InsertPlaylistResponse>, 5002 + tonic::Status, 5003 + > { 5004 + self.inner 5005 + .ready() 5006 + .await 5007 + .map_err(|e| { 5008 + tonic::Status::unknown( 5009 + format!("Service was not ready: {}", e.into()), 5010 + ) 5011 + })?; 5012 + let codec = tonic::codec::ProstCodec::default(); 5013 + let path = http::uri::PathAndQuery::from_static( 5014 + "/rockbox.v1alpha1.PlaylistService/InsertPlaylist", 5015 + ); 5016 + let mut req = request.into_request(); 5017 + req.extensions_mut() 5018 + .insert( 5019 + GrpcMethod::new("rockbox.v1alpha1.PlaylistService", "InsertPlaylist"), 5020 + ); 5021 + self.inner.unary(req, path, codec).await 5022 + } 5023 + pub async fn insert_album( 5024 + &mut self, 5025 + request: impl tonic::IntoRequest<super::InsertAlbumRequest>, 5026 + ) -> std::result::Result< 5027 + tonic::Response<super::InsertAlbumResponse>, 5028 + tonic::Status, 5029 + > { 5030 + self.inner 5031 + .ready() 5032 + .await 5033 + .map_err(|e| { 5034 + tonic::Status::unknown( 5035 + format!("Service was not ready: {}", e.into()), 5036 + ) 5037 + })?; 5038 + let codec = tonic::codec::ProstCodec::default(); 5039 + let path = http::uri::PathAndQuery::from_static( 5040 + "/rockbox.v1alpha1.PlaylistService/InsertAlbum", 5041 + ); 5042 + let mut req = request.into_request(); 5043 + req.extensions_mut() 5044 + .insert( 5045 + GrpcMethod::new("rockbox.v1alpha1.PlaylistService", "InsertAlbum"), 5046 + ); 5047 + self.inner.unary(req, path, codec).await 5048 + } 5049 + pub async fn insert_artist_tracks( 5050 + &mut self, 5051 + request: impl tonic::IntoRequest<super::InsertArtistTracksRequest>, 5052 + ) -> std::result::Result< 5053 + tonic::Response<super::InsertArtistTracksResponse>, 5054 + tonic::Status, 5055 + > { 5056 + self.inner 5057 + .ready() 5058 + .await 5059 + .map_err(|e| { 5060 + tonic::Status::unknown( 5061 + format!("Service was not ready: {}", e.into()), 5062 + ) 5063 + })?; 5064 + let codec = tonic::codec::ProstCodec::default(); 5065 + let path = http::uri::PathAndQuery::from_static( 5066 + "/rockbox.v1alpha1.PlaylistService/InsertArtistTracks", 5067 + ); 5068 + let mut req = request.into_request(); 5069 + req.extensions_mut() 5070 + .insert( 5071 + GrpcMethod::new( 5072 + "rockbox.v1alpha1.PlaylistService", 5073 + "InsertArtistTracks", 5074 + ), 5075 + ); 5076 + self.inner.unary(req, path, codec).await 5077 + } 5078 + pub async fn shuffle_playlist( 5079 + &mut self, 5080 + request: impl tonic::IntoRequest<super::ShufflePlaylistRequest>, 5081 + ) -> std::result::Result< 5082 + tonic::Response<super::ShufflePlaylistResponse>, 5083 + tonic::Status, 5084 + > { 5085 + self.inner 5086 + .ready() 5087 + .await 5088 + .map_err(|e| { 5089 + tonic::Status::unknown( 5090 + format!("Service was not ready: {}", e.into()), 5091 + ) 5092 + })?; 5093 + let codec = tonic::codec::ProstCodec::default(); 5094 + let path = http::uri::PathAndQuery::from_static( 5095 + "/rockbox.v1alpha1.PlaylistService/ShufflePlaylist", 5096 + ); 5097 + let mut req = request.into_request(); 5098 + req.extensions_mut() 5099 + .insert( 5100 + GrpcMethod::new( 5101 + "rockbox.v1alpha1.PlaylistService", 5102 + "ShufflePlaylist", 5103 + ), 5104 + ); 5105 + self.inner.unary(req, path, codec).await 5106 + } 5107 + } 5108 + } 5109 + /// Generated server implementations. 5110 + pub mod playlist_service_server { 5111 + #![allow( 5112 + unused_variables, 5113 + dead_code, 5114 + missing_docs, 5115 + clippy::wildcard_imports, 5116 + clippy::let_unit_value, 5117 + )] 5118 + use tonic::codegen::*; 5119 + /// Generated trait containing gRPC methods that should be implemented for use with PlaylistServiceServer. 5120 + #[async_trait] 5121 + pub trait PlaylistService: std::marker::Send + std::marker::Sync + 'static { 5122 + async fn get_current( 5123 + &self, 5124 + request: tonic::Request<super::GetCurrentRequest>, 5125 + ) -> std::result::Result< 5126 + tonic::Response<super::GetCurrentResponse>, 5127 + tonic::Status, 5128 + >; 5129 + async fn get_resume_info( 5130 + &self, 5131 + request: tonic::Request<super::GetResumeInfoRequest>, 5132 + ) -> std::result::Result< 5133 + tonic::Response<super::GetResumeInfoResponse>, 5134 + tonic::Status, 5135 + >; 5136 + async fn get_track_info( 5137 + &self, 5138 + request: tonic::Request<super::GetTrackInfoRequest>, 5139 + ) -> std::result::Result< 5140 + tonic::Response<super::GetTrackInfoResponse>, 5141 + tonic::Status, 5142 + >; 5143 + async fn get_first_index( 5144 + &self, 5145 + request: tonic::Request<super::GetFirstIndexRequest>, 5146 + ) -> std::result::Result< 5147 + tonic::Response<super::GetFirstIndexResponse>, 5148 + tonic::Status, 5149 + >; 5150 + async fn get_display_index( 5151 + &self, 5152 + request: tonic::Request<super::GetDisplayIndexRequest>, 5153 + ) -> std::result::Result< 5154 + tonic::Response<super::GetDisplayIndexResponse>, 5155 + tonic::Status, 5156 + >; 5157 + async fn amount( 5158 + &self, 5159 + request: tonic::Request<super::AmountRequest>, 5160 + ) -> std::result::Result<tonic::Response<super::AmountResponse>, tonic::Status>; 5161 + async fn playlist_resume( 5162 + &self, 5163 + request: tonic::Request<super::PlaylistResumeRequest>, 5164 + ) -> std::result::Result< 5165 + tonic::Response<super::PlaylistResumeResponse>, 5166 + tonic::Status, 5167 + >; 5168 + async fn resume_track( 5169 + &self, 5170 + request: tonic::Request<super::ResumeTrackRequest>, 5171 + ) -> std::result::Result< 5172 + tonic::Response<super::ResumeTrackResponse>, 5173 + tonic::Status, 5174 + >; 5175 + async fn set_modified( 5176 + &self, 5177 + request: tonic::Request<super::SetModifiedRequest>, 5178 + ) -> std::result::Result< 5179 + tonic::Response<super::SetModifiedResponse>, 5180 + tonic::Status, 5181 + >; 5182 + async fn start( 5183 + &self, 5184 + request: tonic::Request<super::StartRequest>, 5185 + ) -> std::result::Result<tonic::Response<super::StartResponse>, tonic::Status>; 5186 + async fn sync( 5187 + &self, 5188 + request: tonic::Request<super::SyncRequest>, 5189 + ) -> std::result::Result<tonic::Response<super::SyncResponse>, tonic::Status>; 5190 + async fn remove_all_tracks( 5191 + &self, 5192 + request: tonic::Request<super::RemoveAllTracksRequest>, 5193 + ) -> std::result::Result< 5194 + tonic::Response<super::RemoveAllTracksResponse>, 5195 + tonic::Status, 5196 + >; 5197 + async fn remove_tracks( 5198 + &self, 5199 + request: tonic::Request<super::RemoveTracksRequest>, 5200 + ) -> std::result::Result< 5201 + tonic::Response<super::RemoveTracksResponse>, 5202 + tonic::Status, 5203 + >; 5204 + async fn create_playlist( 5205 + &self, 5206 + request: tonic::Request<super::CreatePlaylistRequest>, 5207 + ) -> std::result::Result< 5208 + tonic::Response<super::CreatePlaylistResponse>, 5209 + tonic::Status, 5210 + >; 5211 + async fn insert_tracks( 5212 + &self, 5213 + request: tonic::Request<super::InsertTracksRequest>, 5214 + ) -> std::result::Result< 5215 + tonic::Response<super::InsertTracksResponse>, 5216 + tonic::Status, 5217 + >; 5218 + async fn insert_directory( 5219 + &self, 5220 + request: tonic::Request<super::InsertDirectoryRequest>, 5221 + ) -> std::result::Result< 5222 + tonic::Response<super::InsertDirectoryResponse>, 5223 + tonic::Status, 5224 + >; 5225 + async fn insert_playlist( 5226 + &self, 5227 + request: tonic::Request<super::InsertPlaylistRequest>, 5228 + ) -> std::result::Result< 5229 + tonic::Response<super::InsertPlaylistResponse>, 5230 + tonic::Status, 5231 + >; 5232 + async fn insert_album( 5233 + &self, 5234 + request: tonic::Request<super::InsertAlbumRequest>, 5235 + ) -> std::result::Result< 5236 + tonic::Response<super::InsertAlbumResponse>, 5237 + tonic::Status, 5238 + >; 5239 + async fn insert_artist_tracks( 5240 + &self, 5241 + request: tonic::Request<super::InsertArtistTracksRequest>, 5242 + ) -> std::result::Result< 5243 + tonic::Response<super::InsertArtistTracksResponse>, 5244 + tonic::Status, 5245 + >; 5246 + async fn shuffle_playlist( 5247 + &self, 5248 + request: tonic::Request<super::ShufflePlaylistRequest>, 5249 + ) -> std::result::Result< 5250 + tonic::Response<super::ShufflePlaylistResponse>, 5251 + tonic::Status, 5252 + >; 5253 + } 5254 + #[derive(Debug)] 5255 + pub struct PlaylistServiceServer<T> { 5256 + inner: Arc<T>, 5257 + accept_compression_encodings: EnabledCompressionEncodings, 5258 + send_compression_encodings: EnabledCompressionEncodings, 5259 + max_decoding_message_size: Option<usize>, 5260 + max_encoding_message_size: Option<usize>, 5261 + } 5262 + impl<T> PlaylistServiceServer<T> { 5263 + pub fn new(inner: T) -> Self { 5264 + Self::from_arc(Arc::new(inner)) 5265 + } 5266 + pub fn from_arc(inner: Arc<T>) -> Self { 5267 + Self { 5268 + inner, 5269 + accept_compression_encodings: Default::default(), 5270 + send_compression_encodings: Default::default(), 5271 + max_decoding_message_size: None, 5272 + max_encoding_message_size: None, 5273 + } 5274 + } 5275 + pub fn with_interceptor<F>( 5276 + inner: T, 5277 + interceptor: F, 5278 + ) -> InterceptedService<Self, F> 5279 + where 5280 + F: tonic::service::Interceptor, 5281 + { 5282 + InterceptedService::new(Self::new(inner), interceptor) 5283 + } 5284 + /// Enable decompressing requests with the given encoding. 5285 + #[must_use] 5286 + pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { 5287 + self.accept_compression_encodings.enable(encoding); 5288 + self 5289 + } 5290 + /// Compress responses with the given encoding, if the client supports it. 5291 + #[must_use] 5292 + pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { 5293 + self.send_compression_encodings.enable(encoding); 5294 + self 5295 + } 5296 + /// Limits the maximum size of a decoded message. 5297 + /// 5298 + /// Default: `4MB` 5299 + #[must_use] 5300 + pub fn max_decoding_message_size(mut self, limit: usize) -> Self { 5301 + self.max_decoding_message_size = Some(limit); 5302 + self 5303 + } 5304 + /// Limits the maximum size of an encoded message. 5305 + /// 5306 + /// Default: `usize::MAX` 5307 + #[must_use] 5308 + pub fn max_encoding_message_size(mut self, limit: usize) -> Self { 5309 + self.max_encoding_message_size = Some(limit); 5310 + self 5311 + } 5312 + } 5313 + impl<T, B> tonic::codegen::Service<http::Request<B>> for PlaylistServiceServer<T> 5314 + where 5315 + T: PlaylistService, 5316 + B: Body + std::marker::Send + 'static, 5317 + B::Error: Into<StdError> + std::marker::Send + 'static, 5318 + { 5319 + type Response = http::Response<tonic::body::BoxBody>; 5320 + type Error = std::convert::Infallible; 5321 + type Future = BoxFuture<Self::Response, Self::Error>; 5322 + fn poll_ready( 5323 + &mut self, 5324 + _cx: &mut Context<'_>, 5325 + ) -> Poll<std::result::Result<(), Self::Error>> { 5326 + Poll::Ready(Ok(())) 5327 + } 5328 + fn call(&mut self, req: http::Request<B>) -> Self::Future { 5329 + match req.uri().path() { 5330 + "/rockbox.v1alpha1.PlaylistService/GetCurrent" => { 5331 + #[allow(non_camel_case_types)] 5332 + struct GetCurrentSvc<T: PlaylistService>(pub Arc<T>); 5333 + impl< 5334 + T: PlaylistService, 5335 + > tonic::server::UnaryService<super::GetCurrentRequest> 5336 + for GetCurrentSvc<T> { 5337 + type Response = super::GetCurrentResponse; 5338 + type Future = BoxFuture< 5339 + tonic::Response<Self::Response>, 5340 + tonic::Status, 5341 + >; 5342 + fn call( 5343 + &mut self, 5344 + request: tonic::Request<super::GetCurrentRequest>, 5345 + ) -> Self::Future { 5346 + let inner = Arc::clone(&self.0); 5347 + let fut = async move { 5348 + <T as PlaylistService>::get_current(&inner, request).await 5349 + }; 5350 + Box::pin(fut) 5351 + } 5352 + } 5353 + let accept_compression_encodings = self.accept_compression_encodings; 5354 + let send_compression_encodings = self.send_compression_encodings; 5355 + let max_decoding_message_size = self.max_decoding_message_size; 5356 + let max_encoding_message_size = self.max_encoding_message_size; 5357 + let inner = self.inner.clone(); 5358 + let fut = async move { 5359 + let method = GetCurrentSvc(inner); 5360 + let codec = tonic::codec::ProstCodec::default(); 5361 + let mut grpc = tonic::server::Grpc::new(codec) 5362 + .apply_compression_config( 5363 + accept_compression_encodings, 5364 + send_compression_encodings, 5365 + ) 5366 + .apply_max_message_size_config( 5367 + max_decoding_message_size, 5368 + max_encoding_message_size, 5369 + ); 5370 + let res = grpc.unary(method, req).await; 5371 + Ok(res) 5372 + }; 5373 + Box::pin(fut) 5374 + } 5375 + "/rockbox.v1alpha1.PlaylistService/GetResumeInfo" => { 5376 + #[allow(non_camel_case_types)] 5377 + struct GetResumeInfoSvc<T: PlaylistService>(pub Arc<T>); 5378 + impl< 5379 + T: PlaylistService, 5380 + > tonic::server::UnaryService<super::GetResumeInfoRequest> 5381 + for GetResumeInfoSvc<T> { 5382 + type Response = super::GetResumeInfoResponse; 5383 + type Future = BoxFuture< 5384 + tonic::Response<Self::Response>, 5385 + tonic::Status, 5386 + >; 5387 + fn call( 5388 + &mut self, 5389 + request: tonic::Request<super::GetResumeInfoRequest>, 5390 + ) -> Self::Future { 5391 + let inner = Arc::clone(&self.0); 5392 + let fut = async move { 5393 + <T as PlaylistService>::get_resume_info(&inner, request) 5394 + .await 5395 + }; 5396 + Box::pin(fut) 5397 + } 5398 + } 5399 + let accept_compression_encodings = self.accept_compression_encodings; 5400 + let send_compression_encodings = self.send_compression_encodings; 5401 + let max_decoding_message_size = self.max_decoding_message_size; 5402 + let max_encoding_message_size = self.max_encoding_message_size; 5403 + let inner = self.inner.clone(); 5404 + let fut = async move { 5405 + let method = GetResumeInfoSvc(inner); 5406 + let codec = tonic::codec::ProstCodec::default(); 5407 + let mut grpc = tonic::server::Grpc::new(codec) 5408 + .apply_compression_config( 5409 + accept_compression_encodings, 5410 + send_compression_encodings, 5411 + ) 5412 + .apply_max_message_size_config( 5413 + max_decoding_message_size, 5414 + max_encoding_message_size, 5415 + ); 5416 + let res = grpc.unary(method, req).await; 5417 + Ok(res) 5418 + }; 5419 + Box::pin(fut) 5420 + } 5421 + "/rockbox.v1alpha1.PlaylistService/GetTrackInfo" => { 5422 + #[allow(non_camel_case_types)] 5423 + struct GetTrackInfoSvc<T: PlaylistService>(pub Arc<T>); 5424 + impl< 5425 + T: PlaylistService, 5426 + > tonic::server::UnaryService<super::GetTrackInfoRequest> 5427 + for GetTrackInfoSvc<T> { 5428 + type Response = super::GetTrackInfoResponse; 5429 + type Future = BoxFuture< 5430 + tonic::Response<Self::Response>, 5431 + tonic::Status, 5432 + >; 5433 + fn call( 5434 + &mut self, 5435 + request: tonic::Request<super::GetTrackInfoRequest>, 5436 + ) -> Self::Future { 5437 + let inner = Arc::clone(&self.0); 5438 + let fut = async move { 5439 + <T as PlaylistService>::get_track_info(&inner, request) 5440 + .await 5441 + }; 5442 + Box::pin(fut) 5443 + } 5444 + } 5445 + let accept_compression_encodings = self.accept_compression_encodings; 5446 + let send_compression_encodings = self.send_compression_encodings; 5447 + let max_decoding_message_size = self.max_decoding_message_size; 5448 + let max_encoding_message_size = self.max_encoding_message_size; 5449 + let inner = self.inner.clone(); 5450 + let fut = async move { 5451 + let method = GetTrackInfoSvc(inner); 5452 + let codec = tonic::codec::ProstCodec::default(); 5453 + let mut grpc = tonic::server::Grpc::new(codec) 5454 + .apply_compression_config( 5455 + accept_compression_encodings, 5456 + send_compression_encodings, 5457 + ) 5458 + .apply_max_message_size_config( 5459 + max_decoding_message_size, 5460 + max_encoding_message_size, 5461 + ); 5462 + let res = grpc.unary(method, req).await; 5463 + Ok(res) 5464 + }; 5465 + Box::pin(fut) 5466 + } 5467 + "/rockbox.v1alpha1.PlaylistService/GetFirstIndex" => { 5468 + #[allow(non_camel_case_types)] 5469 + struct GetFirstIndexSvc<T: PlaylistService>(pub Arc<T>); 5470 + impl< 5471 + T: PlaylistService, 5472 + > tonic::server::UnaryService<super::GetFirstIndexRequest> 5473 + for GetFirstIndexSvc<T> { 5474 + type Response = super::GetFirstIndexResponse; 5475 + type Future = BoxFuture< 5476 + tonic::Response<Self::Response>, 5477 + tonic::Status, 5478 + >; 5479 + fn call( 5480 + &mut self, 5481 + request: tonic::Request<super::GetFirstIndexRequest>, 5482 + ) -> Self::Future { 5483 + let inner = Arc::clone(&self.0); 5484 + let fut = async move { 5485 + <T as PlaylistService>::get_first_index(&inner, request) 5486 + .await 5487 + }; 5488 + Box::pin(fut) 5489 + } 5490 + } 5491 + let accept_compression_encodings = self.accept_compression_encodings; 5492 + let send_compression_encodings = self.send_compression_encodings; 5493 + let max_decoding_message_size = self.max_decoding_message_size; 5494 + let max_encoding_message_size = self.max_encoding_message_size; 5495 + let inner = self.inner.clone(); 5496 + let fut = async move { 5497 + let method = GetFirstIndexSvc(inner); 5498 + let codec = tonic::codec::ProstCodec::default(); 5499 + let mut grpc = tonic::server::Grpc::new(codec) 5500 + .apply_compression_config( 5501 + accept_compression_encodings, 5502 + send_compression_encodings, 5503 + ) 5504 + .apply_max_message_size_config( 5505 + max_decoding_message_size, 5506 + max_encoding_message_size, 5507 + ); 5508 + let res = grpc.unary(method, req).await; 5509 + Ok(res) 5510 + }; 5511 + Box::pin(fut) 5512 + } 5513 + "/rockbox.v1alpha1.PlaylistService/GetDisplayIndex" => { 5514 + #[allow(non_camel_case_types)] 5515 + struct GetDisplayIndexSvc<T: PlaylistService>(pub Arc<T>); 5516 + impl< 5517 + T: PlaylistService, 5518 + > tonic::server::UnaryService<super::GetDisplayIndexRequest> 5519 + for GetDisplayIndexSvc<T> { 5520 + type Response = super::GetDisplayIndexResponse; 5521 + type Future = BoxFuture< 5522 + tonic::Response<Self::Response>, 5523 + tonic::Status, 5524 + >; 5525 + fn call( 5526 + &mut self, 5527 + request: tonic::Request<super::GetDisplayIndexRequest>, 5528 + ) -> Self::Future { 5529 + let inner = Arc::clone(&self.0); 5530 + let fut = async move { 5531 + <T as PlaylistService>::get_display_index(&inner, request) 5532 + .await 5533 + }; 5534 + Box::pin(fut) 5535 + } 5536 + } 5537 + let accept_compression_encodings = self.accept_compression_encodings; 5538 + let send_compression_encodings = self.send_compression_encodings; 5539 + let max_decoding_message_size = self.max_decoding_message_size; 5540 + let max_encoding_message_size = self.max_encoding_message_size; 5541 + let inner = self.inner.clone(); 5542 + let fut = async move { 5543 + let method = GetDisplayIndexSvc(inner); 5544 + let codec = tonic::codec::ProstCodec::default(); 5545 + let mut grpc = tonic::server::Grpc::new(codec) 5546 + .apply_compression_config( 5547 + accept_compression_encodings, 5548 + send_compression_encodings, 5549 + ) 5550 + .apply_max_message_size_config( 5551 + max_decoding_message_size, 5552 + max_encoding_message_size, 5553 + ); 5554 + let res = grpc.unary(method, req).await; 5555 + Ok(res) 5556 + }; 5557 + Box::pin(fut) 5558 + } 5559 + "/rockbox.v1alpha1.PlaylistService/Amount" => { 5560 + #[allow(non_camel_case_types)] 5561 + struct AmountSvc<T: PlaylistService>(pub Arc<T>); 5562 + impl< 5563 + T: PlaylistService, 5564 + > tonic::server::UnaryService<super::AmountRequest> 5565 + for AmountSvc<T> { 5566 + type Response = super::AmountResponse; 5567 + type Future = BoxFuture< 5568 + tonic::Response<Self::Response>, 5569 + tonic::Status, 5570 + >; 5571 + fn call( 5572 + &mut self, 5573 + request: tonic::Request<super::AmountRequest>, 5574 + ) -> Self::Future { 5575 + let inner = Arc::clone(&self.0); 5576 + let fut = async move { 5577 + <T as PlaylistService>::amount(&inner, request).await 5578 + }; 5579 + Box::pin(fut) 5580 + } 5581 + } 5582 + let accept_compression_encodings = self.accept_compression_encodings; 5583 + let send_compression_encodings = self.send_compression_encodings; 5584 + let max_decoding_message_size = self.max_decoding_message_size; 5585 + let max_encoding_message_size = self.max_encoding_message_size; 5586 + let inner = self.inner.clone(); 5587 + let fut = async move { 5588 + let method = AmountSvc(inner); 5589 + let codec = tonic::codec::ProstCodec::default(); 5590 + let mut grpc = tonic::server::Grpc::new(codec) 5591 + .apply_compression_config( 5592 + accept_compression_encodings, 5593 + send_compression_encodings, 5594 + ) 5595 + .apply_max_message_size_config( 5596 + max_decoding_message_size, 5597 + max_encoding_message_size, 5598 + ); 5599 + let res = grpc.unary(method, req).await; 5600 + Ok(res) 5601 + }; 5602 + Box::pin(fut) 5603 + } 5604 + "/rockbox.v1alpha1.PlaylistService/PlaylistResume" => { 5605 + #[allow(non_camel_case_types)] 5606 + struct PlaylistResumeSvc<T: PlaylistService>(pub Arc<T>); 5607 + impl< 5608 + T: PlaylistService, 5609 + > tonic::server::UnaryService<super::PlaylistResumeRequest> 5610 + for PlaylistResumeSvc<T> { 5611 + type Response = super::PlaylistResumeResponse; 5612 + type Future = BoxFuture< 5613 + tonic::Response<Self::Response>, 5614 + tonic::Status, 5615 + >; 5616 + fn call( 5617 + &mut self, 5618 + request: tonic::Request<super::PlaylistResumeRequest>, 5619 + ) -> Self::Future { 5620 + let inner = Arc::clone(&self.0); 5621 + let fut = async move { 5622 + <T as PlaylistService>::playlist_resume(&inner, request) 5623 + .await 5624 + }; 5625 + Box::pin(fut) 5626 + } 5627 + } 5628 + let accept_compression_encodings = self.accept_compression_encodings; 5629 + let send_compression_encodings = self.send_compression_encodings; 5630 + let max_decoding_message_size = self.max_decoding_message_size; 5631 + let max_encoding_message_size = self.max_encoding_message_size; 5632 + let inner = self.inner.clone(); 5633 + let fut = async move { 5634 + let method = PlaylistResumeSvc(inner); 5635 + let codec = tonic::codec::ProstCodec::default(); 5636 + let mut grpc = tonic::server::Grpc::new(codec) 5637 + .apply_compression_config( 5638 + accept_compression_encodings, 5639 + send_compression_encodings, 5640 + ) 5641 + .apply_max_message_size_config( 5642 + max_decoding_message_size, 5643 + max_encoding_message_size, 5644 + ); 5645 + let res = grpc.unary(method, req).await; 5646 + Ok(res) 5647 + }; 5648 + Box::pin(fut) 5649 + } 5650 + "/rockbox.v1alpha1.PlaylistService/ResumeTrack" => { 5651 + #[allow(non_camel_case_types)] 5652 + struct ResumeTrackSvc<T: PlaylistService>(pub Arc<T>); 5653 + impl< 5654 + T: PlaylistService, 5655 + > tonic::server::UnaryService<super::ResumeTrackRequest> 5656 + for ResumeTrackSvc<T> { 5657 + type Response = super::ResumeTrackResponse; 5658 + type Future = BoxFuture< 5659 + tonic::Response<Self::Response>, 5660 + tonic::Status, 5661 + >; 5662 + fn call( 5663 + &mut self, 5664 + request: tonic::Request<super::ResumeTrackRequest>, 5665 + ) -> Self::Future { 5666 + let inner = Arc::clone(&self.0); 5667 + let fut = async move { 5668 + <T as PlaylistService>::resume_track(&inner, request).await 5669 + }; 5670 + Box::pin(fut) 5671 + } 5672 + } 5673 + let accept_compression_encodings = self.accept_compression_encodings; 5674 + let send_compression_encodings = self.send_compression_encodings; 5675 + let max_decoding_message_size = self.max_decoding_message_size; 5676 + let max_encoding_message_size = self.max_encoding_message_size; 5677 + let inner = self.inner.clone(); 5678 + let fut = async move { 5679 + let method = ResumeTrackSvc(inner); 5680 + let codec = tonic::codec::ProstCodec::default(); 5681 + let mut grpc = tonic::server::Grpc::new(codec) 5682 + .apply_compression_config( 5683 + accept_compression_encodings, 5684 + send_compression_encodings, 5685 + ) 5686 + .apply_max_message_size_config( 5687 + max_decoding_message_size, 5688 + max_encoding_message_size, 5689 + ); 5690 + let res = grpc.unary(method, req).await; 5691 + Ok(res) 5692 + }; 5693 + Box::pin(fut) 5694 + } 5695 + "/rockbox.v1alpha1.PlaylistService/SetModified" => { 5696 + #[allow(non_camel_case_types)] 5697 + struct SetModifiedSvc<T: PlaylistService>(pub Arc<T>); 5698 + impl< 5699 + T: PlaylistService, 5700 + > tonic::server::UnaryService<super::SetModifiedRequest> 5701 + for SetModifiedSvc<T> { 5702 + type Response = super::SetModifiedResponse; 5703 + type Future = BoxFuture< 5704 + tonic::Response<Self::Response>, 5705 + tonic::Status, 5706 + >; 5707 + fn call( 5708 + &mut self, 5709 + request: tonic::Request<super::SetModifiedRequest>, 5710 + ) -> Self::Future { 5711 + let inner = Arc::clone(&self.0); 5712 + let fut = async move { 5713 + <T as PlaylistService>::set_modified(&inner, request).await 5714 + }; 5715 + Box::pin(fut) 5716 + } 5717 + } 5718 + let accept_compression_encodings = self.accept_compression_encodings; 5719 + let send_compression_encodings = self.send_compression_encodings; 5720 + let max_decoding_message_size = self.max_decoding_message_size; 5721 + let max_encoding_message_size = self.max_encoding_message_size; 5722 + let inner = self.inner.clone(); 5723 + let fut = async move { 5724 + let method = SetModifiedSvc(inner); 5725 + let codec = tonic::codec::ProstCodec::default(); 5726 + let mut grpc = tonic::server::Grpc::new(codec) 5727 + .apply_compression_config( 5728 + accept_compression_encodings, 5729 + send_compression_encodings, 5730 + ) 5731 + .apply_max_message_size_config( 5732 + max_decoding_message_size, 5733 + max_encoding_message_size, 5734 + ); 5735 + let res = grpc.unary(method, req).await; 5736 + Ok(res) 5737 + }; 5738 + Box::pin(fut) 5739 + } 5740 + "/rockbox.v1alpha1.PlaylistService/Start" => { 5741 + #[allow(non_camel_case_types)] 5742 + struct StartSvc<T: PlaylistService>(pub Arc<T>); 5743 + impl< 5744 + T: PlaylistService, 5745 + > tonic::server::UnaryService<super::StartRequest> for StartSvc<T> { 5746 + type Response = super::StartResponse; 5747 + type Future = BoxFuture< 5748 + tonic::Response<Self::Response>, 5749 + tonic::Status, 5750 + >; 5751 + fn call( 5752 + &mut self, 5753 + request: tonic::Request<super::StartRequest>, 5754 + ) -> Self::Future { 5755 + let inner = Arc::clone(&self.0); 5756 + let fut = async move { 5757 + <T as PlaylistService>::start(&inner, request).await 5758 + }; 5759 + Box::pin(fut) 5760 + } 5761 + } 5762 + let accept_compression_encodings = self.accept_compression_encodings; 5763 + let send_compression_encodings = self.send_compression_encodings; 5764 + let max_decoding_message_size = self.max_decoding_message_size; 5765 + let max_encoding_message_size = self.max_encoding_message_size; 5766 + let inner = self.inner.clone(); 5767 + let fut = async move { 5768 + let method = StartSvc(inner); 5769 + let codec = tonic::codec::ProstCodec::default(); 5770 + let mut grpc = tonic::server::Grpc::new(codec) 5771 + .apply_compression_config( 5772 + accept_compression_encodings, 5773 + send_compression_encodings, 5774 + ) 5775 + .apply_max_message_size_config( 5776 + max_decoding_message_size, 5777 + max_encoding_message_size, 5778 + ); 5779 + let res = grpc.unary(method, req).await; 5780 + Ok(res) 5781 + }; 5782 + Box::pin(fut) 5783 + } 5784 + "/rockbox.v1alpha1.PlaylistService/Sync" => { 5785 + #[allow(non_camel_case_types)] 5786 + struct SyncSvc<T: PlaylistService>(pub Arc<T>); 5787 + impl< 5788 + T: PlaylistService, 5789 + > tonic::server::UnaryService<super::SyncRequest> for SyncSvc<T> { 5790 + type Response = super::SyncResponse; 5791 + type Future = BoxFuture< 5792 + tonic::Response<Self::Response>, 5793 + tonic::Status, 5794 + >; 5795 + fn call( 5796 + &mut self, 5797 + request: tonic::Request<super::SyncRequest>, 5798 + ) -> Self::Future { 5799 + let inner = Arc::clone(&self.0); 5800 + let fut = async move { 5801 + <T as PlaylistService>::sync(&inner, request).await 5802 + }; 5803 + Box::pin(fut) 5804 + } 5805 + } 5806 + let accept_compression_encodings = self.accept_compression_encodings; 5807 + let send_compression_encodings = self.send_compression_encodings; 5808 + let max_decoding_message_size = self.max_decoding_message_size; 5809 + let max_encoding_message_size = self.max_encoding_message_size; 5810 + let inner = self.inner.clone(); 5811 + let fut = async move { 5812 + let method = SyncSvc(inner); 5813 + let codec = tonic::codec::ProstCodec::default(); 5814 + let mut grpc = tonic::server::Grpc::new(codec) 5815 + .apply_compression_config( 5816 + accept_compression_encodings, 5817 + send_compression_encodings, 5818 + ) 5819 + .apply_max_message_size_config( 5820 + max_decoding_message_size, 5821 + max_encoding_message_size, 5822 + ); 5823 + let res = grpc.unary(method, req).await; 5824 + Ok(res) 5825 + }; 5826 + Box::pin(fut) 5827 + } 5828 + "/rockbox.v1alpha1.PlaylistService/RemoveAllTracks" => { 5829 + #[allow(non_camel_case_types)] 5830 + struct RemoveAllTracksSvc<T: PlaylistService>(pub Arc<T>); 5831 + impl< 5832 + T: PlaylistService, 5833 + > tonic::server::UnaryService<super::RemoveAllTracksRequest> 5834 + for RemoveAllTracksSvc<T> { 5835 + type Response = super::RemoveAllTracksResponse; 5836 + type Future = BoxFuture< 5837 + tonic::Response<Self::Response>, 5838 + tonic::Status, 5839 + >; 5840 + fn call( 5841 + &mut self, 5842 + request: tonic::Request<super::RemoveAllTracksRequest>, 5843 + ) -> Self::Future { 5844 + let inner = Arc::clone(&self.0); 5845 + let fut = async move { 5846 + <T as PlaylistService>::remove_all_tracks(&inner, request) 5847 + .await 5848 + }; 5849 + Box::pin(fut) 5850 + } 5851 + } 5852 + let accept_compression_encodings = self.accept_compression_encodings; 5853 + let send_compression_encodings = self.send_compression_encodings; 5854 + let max_decoding_message_size = self.max_decoding_message_size; 5855 + let max_encoding_message_size = self.max_encoding_message_size; 5856 + let inner = self.inner.clone(); 5857 + let fut = async move { 5858 + let method = RemoveAllTracksSvc(inner); 5859 + let codec = tonic::codec::ProstCodec::default(); 5860 + let mut grpc = tonic::server::Grpc::new(codec) 5861 + .apply_compression_config( 5862 + accept_compression_encodings, 5863 + send_compression_encodings, 5864 + ) 5865 + .apply_max_message_size_config( 5866 + max_decoding_message_size, 5867 + max_encoding_message_size, 5868 + ); 5869 + let res = grpc.unary(method, req).await; 5870 + Ok(res) 5871 + }; 5872 + Box::pin(fut) 5873 + } 5874 + "/rockbox.v1alpha1.PlaylistService/RemoveTracks" => { 5875 + #[allow(non_camel_case_types)] 5876 + struct RemoveTracksSvc<T: PlaylistService>(pub Arc<T>); 5877 + impl< 5878 + T: PlaylistService, 5879 + > tonic::server::UnaryService<super::RemoveTracksRequest> 5880 + for RemoveTracksSvc<T> { 5881 + type Response = super::RemoveTracksResponse; 5882 + type Future = BoxFuture< 5883 + tonic::Response<Self::Response>, 5884 + tonic::Status, 5885 + >; 5886 + fn call( 5887 + &mut self, 5888 + request: tonic::Request<super::RemoveTracksRequest>, 5889 + ) -> Self::Future { 5890 + let inner = Arc::clone(&self.0); 5891 + let fut = async move { 5892 + <T as PlaylistService>::remove_tracks(&inner, request).await 5893 + }; 5894 + Box::pin(fut) 5895 + } 5896 + } 5897 + let accept_compression_encodings = self.accept_compression_encodings; 5898 + let send_compression_encodings = self.send_compression_encodings; 5899 + let max_decoding_message_size = self.max_decoding_message_size; 5900 + let max_encoding_message_size = self.max_encoding_message_size; 5901 + let inner = self.inner.clone(); 5902 + let fut = async move { 5903 + let method = RemoveTracksSvc(inner); 5904 + let codec = tonic::codec::ProstCodec::default(); 5905 + let mut grpc = tonic::server::Grpc::new(codec) 5906 + .apply_compression_config( 5907 + accept_compression_encodings, 5908 + send_compression_encodings, 5909 + ) 5910 + .apply_max_message_size_config( 5911 + max_decoding_message_size, 5912 + max_encoding_message_size, 5913 + ); 5914 + let res = grpc.unary(method, req).await; 5915 + Ok(res) 5916 + }; 5917 + Box::pin(fut) 5918 + } 5919 + "/rockbox.v1alpha1.PlaylistService/CreatePlaylist" => { 5920 + #[allow(non_camel_case_types)] 5921 + struct CreatePlaylistSvc<T: PlaylistService>(pub Arc<T>); 5922 + impl< 5923 + T: PlaylistService, 5924 + > tonic::server::UnaryService<super::CreatePlaylistRequest> 5925 + for CreatePlaylistSvc<T> { 5926 + type Response = super::CreatePlaylistResponse; 5927 + type Future = BoxFuture< 5928 + tonic::Response<Self::Response>, 5929 + tonic::Status, 5930 + >; 5931 + fn call( 5932 + &mut self, 5933 + request: tonic::Request<super::CreatePlaylistRequest>, 5934 + ) -> Self::Future { 5935 + let inner = Arc::clone(&self.0); 5936 + let fut = async move { 5937 + <T as PlaylistService>::create_playlist(&inner, request) 5938 + .await 5939 + }; 5940 + Box::pin(fut) 5941 + } 5942 + } 5943 + let accept_compression_encodings = self.accept_compression_encodings; 5944 + let send_compression_encodings = self.send_compression_encodings; 5945 + let max_decoding_message_size = self.max_decoding_message_size; 5946 + let max_encoding_message_size = self.max_encoding_message_size; 5947 + let inner = self.inner.clone(); 5948 + let fut = async move { 5949 + let method = CreatePlaylistSvc(inner); 5950 + let codec = tonic::codec::ProstCodec::default(); 5951 + let mut grpc = tonic::server::Grpc::new(codec) 5952 + .apply_compression_config( 5953 + accept_compression_encodings, 5954 + send_compression_encodings, 5955 + ) 5956 + .apply_max_message_size_config( 5957 + max_decoding_message_size, 5958 + max_encoding_message_size, 5959 + ); 5960 + let res = grpc.unary(method, req).await; 5961 + Ok(res) 5962 + }; 5963 + Box::pin(fut) 5964 + } 5965 + "/rockbox.v1alpha1.PlaylistService/InsertTracks" => { 5966 + #[allow(non_camel_case_types)] 5967 + struct InsertTracksSvc<T: PlaylistService>(pub Arc<T>); 5968 + impl< 5969 + T: PlaylistService, 5970 + > tonic::server::UnaryService<super::InsertTracksRequest> 5971 + for InsertTracksSvc<T> { 5972 + type Response = super::InsertTracksResponse; 5973 + type Future = BoxFuture< 5974 + tonic::Response<Self::Response>, 5975 + tonic::Status, 5976 + >; 5977 + fn call( 5978 + &mut self, 5979 + request: tonic::Request<super::InsertTracksRequest>, 5980 + ) -> Self::Future { 5981 + let inner = Arc::clone(&self.0); 5982 + let fut = async move { 5983 + <T as PlaylistService>::insert_tracks(&inner, request).await 5984 + }; 5985 + Box::pin(fut) 5986 + } 5987 + } 5988 + let accept_compression_encodings = self.accept_compression_encodings; 5989 + let send_compression_encodings = self.send_compression_encodings; 5990 + let max_decoding_message_size = self.max_decoding_message_size; 5991 + let max_encoding_message_size = self.max_encoding_message_size; 5992 + let inner = self.inner.clone(); 5993 + let fut = async move { 5994 + let method = InsertTracksSvc(inner); 5995 + let codec = tonic::codec::ProstCodec::default(); 5996 + let mut grpc = tonic::server::Grpc::new(codec) 5997 + .apply_compression_config( 5998 + accept_compression_encodings, 5999 + send_compression_encodings, 6000 + ) 6001 + .apply_max_message_size_config( 6002 + max_decoding_message_size, 6003 + max_encoding_message_size, 6004 + ); 6005 + let res = grpc.unary(method, req).await; 6006 + Ok(res) 6007 + }; 6008 + Box::pin(fut) 6009 + } 6010 + "/rockbox.v1alpha1.PlaylistService/InsertDirectory" => { 6011 + #[allow(non_camel_case_types)] 6012 + struct InsertDirectorySvc<T: PlaylistService>(pub Arc<T>); 6013 + impl< 6014 + T: PlaylistService, 6015 + > tonic::server::UnaryService<super::InsertDirectoryRequest> 6016 + for InsertDirectorySvc<T> { 6017 + type Response = super::InsertDirectoryResponse; 6018 + type Future = BoxFuture< 6019 + tonic::Response<Self::Response>, 6020 + tonic::Status, 6021 + >; 6022 + fn call( 6023 + &mut self, 6024 + request: tonic::Request<super::InsertDirectoryRequest>, 6025 + ) -> Self::Future { 6026 + let inner = Arc::clone(&self.0); 6027 + let fut = async move { 6028 + <T as PlaylistService>::insert_directory(&inner, request) 6029 + .await 6030 + }; 6031 + Box::pin(fut) 6032 + } 6033 + } 6034 + let accept_compression_encodings = self.accept_compression_encodings; 6035 + let send_compression_encodings = self.send_compression_encodings; 6036 + let max_decoding_message_size = self.max_decoding_message_size; 6037 + let max_encoding_message_size = self.max_encoding_message_size; 6038 + let inner = self.inner.clone(); 6039 + let fut = async move { 6040 + let method = InsertDirectorySvc(inner); 6041 + let codec = tonic::codec::ProstCodec::default(); 6042 + let mut grpc = tonic::server::Grpc::new(codec) 6043 + .apply_compression_config( 6044 + accept_compression_encodings, 6045 + send_compression_encodings, 6046 + ) 6047 + .apply_max_message_size_config( 6048 + max_decoding_message_size, 6049 + max_encoding_message_size, 6050 + ); 6051 + let res = grpc.unary(method, req).await; 6052 + Ok(res) 6053 + }; 6054 + Box::pin(fut) 6055 + } 6056 + "/rockbox.v1alpha1.PlaylistService/InsertPlaylist" => { 6057 + #[allow(non_camel_case_types)] 6058 + struct InsertPlaylistSvc<T: PlaylistService>(pub Arc<T>); 6059 + impl< 6060 + T: PlaylistService, 6061 + > tonic::server::UnaryService<super::InsertPlaylistRequest> 6062 + for InsertPlaylistSvc<T> { 6063 + type Response = super::InsertPlaylistResponse; 6064 + type Future = BoxFuture< 6065 + tonic::Response<Self::Response>, 6066 + tonic::Status, 6067 + >; 6068 + fn call( 6069 + &mut self, 6070 + request: tonic::Request<super::InsertPlaylistRequest>, 6071 + ) -> Self::Future { 6072 + let inner = Arc::clone(&self.0); 6073 + let fut = async move { 6074 + <T as PlaylistService>::insert_playlist(&inner, request) 6075 + .await 6076 + }; 6077 + Box::pin(fut) 6078 + } 6079 + } 6080 + let accept_compression_encodings = self.accept_compression_encodings; 6081 + let send_compression_encodings = self.send_compression_encodings; 6082 + let max_decoding_message_size = self.max_decoding_message_size; 6083 + let max_encoding_message_size = self.max_encoding_message_size; 6084 + let inner = self.inner.clone(); 6085 + let fut = async move { 6086 + let method = InsertPlaylistSvc(inner); 6087 + let codec = tonic::codec::ProstCodec::default(); 6088 + let mut grpc = tonic::server::Grpc::new(codec) 6089 + .apply_compression_config( 6090 + accept_compression_encodings, 6091 + send_compression_encodings, 6092 + ) 6093 + .apply_max_message_size_config( 6094 + max_decoding_message_size, 6095 + max_encoding_message_size, 6096 + ); 6097 + let res = grpc.unary(method, req).await; 6098 + Ok(res) 6099 + }; 6100 + Box::pin(fut) 6101 + } 6102 + "/rockbox.v1alpha1.PlaylistService/InsertAlbum" => { 6103 + #[allow(non_camel_case_types)] 6104 + struct InsertAlbumSvc<T: PlaylistService>(pub Arc<T>); 6105 + impl< 6106 + T: PlaylistService, 6107 + > tonic::server::UnaryService<super::InsertAlbumRequest> 6108 + for InsertAlbumSvc<T> { 6109 + type Response = super::InsertAlbumResponse; 6110 + type Future = BoxFuture< 6111 + tonic::Response<Self::Response>, 6112 + tonic::Status, 6113 + >; 6114 + fn call( 6115 + &mut self, 6116 + request: tonic::Request<super::InsertAlbumRequest>, 6117 + ) -> Self::Future { 6118 + let inner = Arc::clone(&self.0); 6119 + let fut = async move { 6120 + <T as PlaylistService>::insert_album(&inner, request).await 6121 + }; 6122 + Box::pin(fut) 6123 + } 6124 + } 6125 + let accept_compression_encodings = self.accept_compression_encodings; 6126 + let send_compression_encodings = self.send_compression_encodings; 6127 + let max_decoding_message_size = self.max_decoding_message_size; 6128 + let max_encoding_message_size = self.max_encoding_message_size; 6129 + let inner = self.inner.clone(); 6130 + let fut = async move { 6131 + let method = InsertAlbumSvc(inner); 6132 + let codec = tonic::codec::ProstCodec::default(); 6133 + let mut grpc = tonic::server::Grpc::new(codec) 6134 + .apply_compression_config( 6135 + accept_compression_encodings, 6136 + send_compression_encodings, 6137 + ) 6138 + .apply_max_message_size_config( 6139 + max_decoding_message_size, 6140 + max_encoding_message_size, 6141 + ); 6142 + let res = grpc.unary(method, req).await; 6143 + Ok(res) 6144 + }; 6145 + Box::pin(fut) 6146 + } 6147 + "/rockbox.v1alpha1.PlaylistService/InsertArtistTracks" => { 6148 + #[allow(non_camel_case_types)] 6149 + struct InsertArtistTracksSvc<T: PlaylistService>(pub Arc<T>); 6150 + impl< 6151 + T: PlaylistService, 6152 + > tonic::server::UnaryService<super::InsertArtistTracksRequest> 6153 + for InsertArtistTracksSvc<T> { 6154 + type Response = super::InsertArtistTracksResponse; 6155 + type Future = BoxFuture< 6156 + tonic::Response<Self::Response>, 6157 + tonic::Status, 6158 + >; 6159 + fn call( 6160 + &mut self, 6161 + request: tonic::Request<super::InsertArtistTracksRequest>, 6162 + ) -> Self::Future { 6163 + let inner = Arc::clone(&self.0); 6164 + let fut = async move { 6165 + <T as PlaylistService>::insert_artist_tracks( 6166 + &inner, 6167 + request, 6168 + ) 6169 + .await 6170 + }; 6171 + Box::pin(fut) 6172 + } 6173 + } 6174 + let accept_compression_encodings = self.accept_compression_encodings; 6175 + let send_compression_encodings = self.send_compression_encodings; 6176 + let max_decoding_message_size = self.max_decoding_message_size; 6177 + let max_encoding_message_size = self.max_encoding_message_size; 6178 + let inner = self.inner.clone(); 6179 + let fut = async move { 6180 + let method = InsertArtistTracksSvc(inner); 6181 + let codec = tonic::codec::ProstCodec::default(); 6182 + let mut grpc = tonic::server::Grpc::new(codec) 6183 + .apply_compression_config( 6184 + accept_compression_encodings, 6185 + send_compression_encodings, 6186 + ) 6187 + .apply_max_message_size_config( 6188 + max_decoding_message_size, 6189 + max_encoding_message_size, 6190 + ); 6191 + let res = grpc.unary(method, req).await; 6192 + Ok(res) 6193 + }; 6194 + Box::pin(fut) 6195 + } 6196 + "/rockbox.v1alpha1.PlaylistService/ShufflePlaylist" => { 6197 + #[allow(non_camel_case_types)] 6198 + struct ShufflePlaylistSvc<T: PlaylistService>(pub Arc<T>); 6199 + impl< 6200 + T: PlaylistService, 6201 + > tonic::server::UnaryService<super::ShufflePlaylistRequest> 6202 + for ShufflePlaylistSvc<T> { 6203 + type Response = super::ShufflePlaylistResponse; 6204 + type Future = BoxFuture< 6205 + tonic::Response<Self::Response>, 6206 + tonic::Status, 6207 + >; 6208 + fn call( 6209 + &mut self, 6210 + request: tonic::Request<super::ShufflePlaylistRequest>, 6211 + ) -> Self::Future { 6212 + let inner = Arc::clone(&self.0); 6213 + let fut = async move { 6214 + <T as PlaylistService>::shuffle_playlist(&inner, request) 6215 + .await 6216 + }; 6217 + Box::pin(fut) 6218 + } 6219 + } 6220 + let accept_compression_encodings = self.accept_compression_encodings; 6221 + let send_compression_encodings = self.send_compression_encodings; 6222 + let max_decoding_message_size = self.max_decoding_message_size; 6223 + let max_encoding_message_size = self.max_encoding_message_size; 6224 + let inner = self.inner.clone(); 6225 + let fut = async move { 6226 + let method = ShufflePlaylistSvc(inner); 6227 + let codec = tonic::codec::ProstCodec::default(); 6228 + let mut grpc = tonic::server::Grpc::new(codec) 6229 + .apply_compression_config( 6230 + accept_compression_encodings, 6231 + send_compression_encodings, 6232 + ) 6233 + .apply_max_message_size_config( 6234 + max_decoding_message_size, 6235 + max_encoding_message_size, 6236 + ); 6237 + let res = grpc.unary(method, req).await; 6238 + Ok(res) 6239 + }; 6240 + Box::pin(fut) 6241 + } 6242 + _ => { 6243 + Box::pin(async move { 6244 + let mut response = http::Response::new(empty_body()); 6245 + let headers = response.headers_mut(); 6246 + headers 6247 + .insert( 6248 + tonic::Status::GRPC_STATUS, 6249 + (tonic::Code::Unimplemented as i32).into(), 6250 + ); 6251 + headers 6252 + .insert( 6253 + http::header::CONTENT_TYPE, 6254 + tonic::metadata::GRPC_CONTENT_TYPE, 6255 + ); 6256 + Ok(response) 6257 + }) 6258 + } 6259 + } 6260 + } 6261 + } 6262 + impl<T> Clone for PlaylistServiceServer<T> { 6263 + fn clone(&self) -> Self { 6264 + let inner = self.inner.clone(); 6265 + Self { 6266 + inner, 6267 + accept_compression_encodings: self.accept_compression_encodings, 6268 + send_compression_encodings: self.send_compression_encodings, 6269 + max_decoding_message_size: self.max_decoding_message_size, 6270 + max_encoding_message_size: self.max_encoding_message_size, 6271 + } 6272 + } 6273 + } 6274 + /// Generated gRPC service name 6275 + pub const SERVICE_NAME: &str = "rockbox.v1alpha1.PlaylistService"; 6276 + impl<T> tonic::server::NamedService for PlaylistServiceServer<T> { 6277 + const NAME: &'static str = SERVICE_NAME; 6278 + } 6279 + } 6280 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 6281 + pub struct GetSettingsListRequest { 6282 + #[prost(int32, tag = "1")] 6283 + pub count: i32, 6284 + } 6285 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 6286 + pub struct GetSettingsListResponse {} 6287 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 6288 + pub struct GetGlobalSettingsRequest {} 6289 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 6290 + pub struct ReplaygainSettings { 6291 + #[prost(bool, tag = "1")] 6292 + pub noclip: bool, 6293 + #[prost(int32, tag = "2")] 6294 + pub r#type: i32, 6295 + #[prost(int32, tag = "3")] 6296 + pub preamp: i32, 6297 + } 6298 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 6299 + pub struct EqBandSetting { 6300 + #[prost(int32, tag = "1")] 6301 + pub cutoff: i32, 6302 + #[prost(int32, tag = "2")] 6303 + pub q: i32, 6304 + #[prost(int32, tag = "3")] 6305 + pub gain: i32, 6306 + } 6307 + #[derive(Clone, PartialEq, ::prost::Message)] 6308 + pub struct SettingsList { 6309 + #[prost(uint32, tag = "1")] 6310 + pub flags: u32, 6311 + #[prost(int32, tag = "2")] 6312 + pub lang_id: i32, 6313 + #[prost(string, tag = "3")] 6314 + pub cfg_name: ::prost::alloc::string::String, 6315 + #[prost(string, tag = "4")] 6316 + pub cfg_vals: ::prost::alloc::string::String, 6317 + } 6318 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 6319 + pub struct CompressorSettings { 6320 + #[prost(int32, tag = "1")] 6321 + pub threshold: i32, 6322 + #[prost(int32, tag = "2")] 6323 + pub makeup_gain: i32, 6324 + #[prost(int32, tag = "3")] 6325 + pub ratio: i32, 6326 + #[prost(int32, tag = "4")] 6327 + pub knee: i32, 6328 + #[prost(int32, tag = "5")] 6329 + pub release_time: i32, 6330 + #[prost(int32, tag = "6")] 6331 + pub attack_time: i32, 6332 + } 6333 + #[derive(Clone, PartialEq, ::prost::Message)] 6334 + pub struct GetGlobalSettingsResponse { 6335 + #[prost(int32, tag = "1")] 6336 + pub volume: i32, 6337 + #[prost(int32, tag = "2")] 6338 + pub balance: i32, 6339 + #[prost(int32, tag = "3")] 6340 + pub bass: i32, 6341 + #[prost(int32, tag = "4")] 6342 + pub treble: i32, 6343 + #[prost(int32, tag = "5")] 6344 + pub channel_config: i32, 6345 + #[prost(int32, tag = "6")] 6346 + pub stereo_width: i32, 6347 + #[prost(int32, tag = "7")] 6348 + pub bass_cutoff: i32, 6349 + #[prost(int32, tag = "8")] 6350 + pub treble_cutoff: i32, 6351 + #[prost(int32, tag = "9")] 6352 + pub crossfade: i32, 6353 + #[prost(int32, tag = "10")] 6354 + pub crossfade_fade_in_delay: i32, 6355 + #[prost(int32, tag = "11")] 6356 + pub crossfade_fade_out_delay: i32, 6357 + #[prost(int32, tag = "12")] 6358 + pub crossfade_fade_in_duration: i32, 6359 + #[prost(int32, tag = "13")] 6360 + pub crossfade_fade_out_duration: i32, 6361 + #[prost(int32, tag = "14")] 6362 + pub crossfade_fade_out_mixmode: i32, 6363 + #[prost(message, optional, tag = "15")] 6364 + pub replaygain_settings: ::core::option::Option<ReplaygainSettings>, 6365 + #[prost(int32, tag = "16")] 6366 + pub crossfeed: i32, 6367 + #[prost(uint32, tag = "17")] 6368 + pub crossfeed_direct_gain: u32, 6369 + #[prost(uint32, tag = "18")] 6370 + pub crossfeed_cross_gain: u32, 6371 + #[prost(uint32, tag = "19")] 6372 + pub crossfeed_hf_attenuation: u32, 6373 + #[prost(uint32, tag = "20")] 6374 + pub crossfeed_hf_cutoff: u32, 6375 + #[prost(bool, tag = "21")] 6376 + pub eq_enabled: bool, 6377 + #[prost(uint32, tag = "22")] 6378 + pub eq_precut: u32, 6379 + #[prost(message, repeated, tag = "23")] 6380 + pub eq_band_settings: ::prost::alloc::vec::Vec<EqBandSetting>, 6381 + #[prost(int32, tag = "24")] 6382 + pub beep: i32, 6383 + #[prost(int32, tag = "25")] 6384 + pub keyclick: i32, 6385 + #[prost(int32, tag = "26")] 6386 + pub keyclick_repeats: i32, 6387 + #[prost(bool, tag = "27")] 6388 + pub dithering_enabled: bool, 6389 + #[prost(bool, tag = "28")] 6390 + pub timestretch_enabled: bool, 6391 + #[prost(int32, tag = "29")] 6392 + pub list_accel_start_delay: i32, 6393 + #[prost(int32, tag = "30")] 6394 + pub list_accel_wait: i32, 6395 + #[prost(int32, tag = "31")] 6396 + pub touchpad_sensitivity: i32, 6397 + #[prost(int32, tag = "32")] 6398 + pub touchpad_deadzone: i32, 6399 + #[prost(int32, tag = "33")] 6400 + pub pause_rewind: i32, 6401 + #[prost(int32, tag = "34")] 6402 + pub unplug_mode: i32, 6403 + #[prost(bool, tag = "35")] 6404 + pub unplug_autoresume: bool, 6405 + #[prost(int32, tag = "37")] 6406 + pub timeformat: i32, 6407 + #[prost(int32, tag = "38")] 6408 + pub disk_spindown: i32, 6409 + #[prost(int32, tag = "39")] 6410 + pub buffer_margin: i32, 6411 + #[prost(int32, tag = "40")] 6412 + pub dirfilter: i32, 6413 + #[prost(int32, tag = "41")] 6414 + pub show_filename_ext: i32, 6415 + #[prost(int32, tag = "42")] 6416 + pub default_codepage: i32, 6417 + #[prost(bool, tag = "43")] 6418 + pub hold_lr_for_scroll_in_list: bool, 6419 + #[prost(bool, tag = "44")] 6420 + pub play_selected: bool, 6421 + #[prost(int32, tag = "45")] 6422 + pub single_mode: i32, 6423 + #[prost(bool, tag = "46")] 6424 + pub party_mode: bool, 6425 + #[prost(bool, tag = "48")] 6426 + pub car_adapter_mode: bool, 6427 + #[prost(int32, tag = "49")] 6428 + pub car_adapter_mode_delay: i32, 6429 + #[prost(int32, tag = "50")] 6430 + pub start_in_screen: i32, 6431 + #[prost(int32, tag = "51")] 6432 + pub ff_rewind_min_step: i32, 6433 + #[prost(int32, tag = "52")] 6434 + pub ff_rewind_accel: i32, 6435 + #[prost(int32, tag = "53")] 6436 + pub peak_meter_release: i32, 6437 + #[prost(int32, tag = "54")] 6438 + pub peak_meter_hold: i32, 6439 + #[prost(int32, tag = "55")] 6440 + pub peak_meter_clip_hold: i32, 6441 + #[prost(bool, tag = "56")] 6442 + pub peak_meter_dbfs: bool, 6443 + #[prost(int32, tag = "57")] 6444 + pub peak_meter_min: i32, 6445 + #[prost(int32, tag = "58")] 6446 + pub peak_meter_max: i32, 6447 + #[prost(string, tag = "59")] 6448 + pub wps_file: ::prost::alloc::string::String, 6449 + #[prost(string, tag = "60")] 6450 + pub sbs_file: ::prost::alloc::string::String, 6451 + #[prost(string, tag = "61")] 6452 + pub lang_file: ::prost::alloc::string::String, 6453 + #[prost(string, tag = "62")] 6454 + pub playlist_catalog_dir: ::prost::alloc::string::String, 6455 + #[prost(int32, tag = "63")] 6456 + pub skip_length: i32, 6457 + #[prost(int32, tag = "64")] 6458 + pub max_files_in_dir: i32, 6459 + #[prost(int32, tag = "65")] 6460 + pub max_files_in_playlist: i32, 6461 + #[prost(int32, tag = "66")] 6462 + pub volume_type: i32, 6463 + #[prost(int32, tag = "67")] 6464 + pub battery_display: i32, 6465 + #[prost(bool, tag = "68")] 6466 + pub show_icons: bool, 6467 + #[prost(int32, tag = "69")] 6468 + pub statusbar: i32, 6469 + #[prost(int32, tag = "70")] 6470 + pub scrollbar: i32, 6471 + #[prost(int32, tag = "71")] 6472 + pub scrollbar_width: i32, 6473 + #[prost(int32, tag = "72")] 6474 + pub list_line_padding: i32, 6475 + #[prost(int32, tag = "73")] 6476 + pub list_separator_color: i32, 6477 + #[prost(bool, tag = "74")] 6478 + pub browse_current: bool, 6479 + #[prost(bool, tag = "75")] 6480 + pub scroll_paginated: bool, 6481 + #[prost(bool, tag = "76")] 6482 + pub list_wraparound: bool, 6483 + #[prost(int32, tag = "77")] 6484 + pub list_order: i32, 6485 + #[prost(int32, tag = "78")] 6486 + pub scroll_speed: i32, 6487 + #[prost(int32, tag = "79")] 6488 + pub bidir_limit: i32, 6489 + #[prost(int32, tag = "80")] 6490 + pub scroll_delay: i32, 6491 + #[prost(int32, tag = "81")] 6492 + pub scroll_step: i32, 6493 + #[prost(int32, tag = "82")] 6494 + pub autoloadbookmark: i32, 6495 + #[prost(int32, tag = "83")] 6496 + pub autocreatebookmark: i32, 6497 + #[prost(bool, tag = "84")] 6498 + pub autoupdatebookmark: bool, 6499 + #[prost(int32, tag = "85")] 6500 + pub usemrb: i32, 6501 + #[prost(bool, tag = "86")] 6502 + pub dircache: bool, 6503 + #[prost(int32, tag = "87")] 6504 + pub tagcache_ram: i32, 6505 + #[prost(bool, tag = "88")] 6506 + pub tagcache_autoupdate: bool, 6507 + #[prost(bool, tag = "89")] 6508 + pub autoresume_enable: bool, 6509 + #[prost(int32, tag = "90")] 6510 + pub autoresume_automatic: i32, 6511 + #[prost(string, tag = "91")] 6512 + pub autoresume_paths: ::prost::alloc::string::String, 6513 + #[prost(bool, tag = "92")] 6514 + pub runtimedb: bool, 6515 + #[prost(string, tag = "93")] 6516 + pub tagcache_scan_paths: ::prost::alloc::string::String, 6517 + #[prost(string, tag = "94")] 6518 + pub tagcache_db_path: ::prost::alloc::string::String, 6519 + #[prost(string, tag = "95")] 6520 + pub backdrop_file: ::prost::alloc::string::String, 6521 + #[prost(int32, tag = "96")] 6522 + pub bg_color: i32, 6523 + #[prost(int32, tag = "97")] 6524 + pub fg_color: i32, 6525 + #[prost(int32, tag = "98")] 6526 + pub lss_color: i32, 6527 + #[prost(int32, tag = "99")] 6528 + pub lse_color: i32, 6529 + #[prost(int32, tag = "100")] 6530 + pub lst_color: i32, 6531 + #[prost(string, tag = "101")] 6532 + pub colors_file: ::prost::alloc::string::String, 6533 + #[prost(int32, tag = "102")] 6534 + pub browser_default: i32, 6535 + #[prost(int32, tag = "103")] 6536 + pub repeat_mode: i32, 6537 + #[prost(int32, tag = "104")] 6538 + pub next_folder: i32, 6539 + #[prost(bool, tag = "105")] 6540 + pub constrain_next_folder: bool, 6541 + #[prost(int32, tag = "106")] 6542 + pub recursive_dir_insert: i32, 6543 + #[prost(bool, tag = "107")] 6544 + pub fade_on_stop: bool, 6545 + #[prost(bool, tag = "108")] 6546 + pub playlist_shuffle: bool, 6547 + #[prost(bool, tag = "109")] 6548 + pub warnon_erase_dynplaylist: bool, 6549 + #[prost(bool, tag = "110")] 6550 + pub keep_current_track_on_replace_playlist: bool, 6551 + #[prost(bool, tag = "111")] 6552 + pub show_shuffled_adding_options: bool, 6553 + #[prost(int32, tag = "112")] 6554 + pub show_queue_options: i32, 6555 + #[prost(int32, tag = "113")] 6556 + pub album_art: i32, 6557 + #[prost(bool, tag = "114")] 6558 + pub rewind_across_tracks: bool, 6559 + #[prost(bool, tag = "115")] 6560 + pub playlist_viewer_icons: bool, 6561 + #[prost(bool, tag = "116")] 6562 + pub playlist_viewer_indices: bool, 6563 + #[prost(int32, tag = "117")] 6564 + pub playlist_viewer_track_display: i32, 6565 + #[prost(bool, tag = "118")] 6566 + pub sort_case: bool, 6567 + #[prost(int32, tag = "119")] 6568 + pub sort_dir: i32, 6569 + #[prost(int32, tag = "120")] 6570 + pub sort_file: i32, 6571 + #[prost(int32, tag = "121")] 6572 + pub interpret_numbers: i32, 6573 + #[prost(int32, tag = "122")] 6574 + pub poweroff: i32, 6575 + #[prost(bool, tag = "123")] 6576 + pub spdif_enable: bool, 6577 + #[prost(int32, tag = "124")] 6578 + pub contrast: i32, 6579 + #[prost(bool, tag = "125")] 6580 + pub invert: bool, 6581 + #[prost(bool, tag = "126")] 6582 + pub flip_display: bool, 6583 + #[prost(int32, tag = "127")] 6584 + pub cursor_style: i32, 6585 + #[prost(int32, tag = "128")] 6586 + pub screen_scroll_step: i32, 6587 + #[prost(int32, tag = "129")] 6588 + pub show_path_in_browser: i32, 6589 + #[prost(bool, tag = "130")] 6590 + pub offset_out_of_view: bool, 6591 + #[prost(bool, tag = "131")] 6592 + pub disable_mainmenu_scrolling: bool, 6593 + #[prost(string, tag = "132")] 6594 + pub icon_file: ::prost::alloc::string::String, 6595 + #[prost(string, tag = "133")] 6596 + pub viewers_icon_file: ::prost::alloc::string::String, 6597 + #[prost(string, tag = "134")] 6598 + pub font_file: ::prost::alloc::string::String, 6599 + #[prost(int32, tag = "135")] 6600 + pub glyphs_to_cache: i32, 6601 + #[prost(string, tag = "136")] 6602 + pub kbd_file: ::prost::alloc::string::String, 6603 + #[prost(int32, tag = "137")] 6604 + pub backlight_timeout: i32, 6605 + #[prost(bool, tag = "138")] 6606 + pub caption_backlight: bool, 6607 + #[prost(bool, tag = "139")] 6608 + pub bl_filter_first_keypress: bool, 6609 + #[prost(int32, tag = "140")] 6610 + pub backlight_timeout_plugged: i32, 6611 + #[prost(bool, tag = "141")] 6612 + pub bt_selective_softlock_actions: bool, 6613 + #[prost(int32, tag = "142")] 6614 + pub bt_selective_softlock_actions_mask: i32, 6615 + #[prost(bool, tag = "143")] 6616 + pub bl_selective_actions: bool, 6617 + #[prost(int32, tag = "144")] 6618 + pub bl_selective_actions_mask: i32, 6619 + #[prost(int32, tag = "145")] 6620 + pub backlight_on_button_hold: i32, 6621 + #[prost(int32, tag = "146")] 6622 + pub lcd_sleep_after_backlight_off: i32, 6623 + #[prost(int32, tag = "147")] 6624 + pub brightness: i32, 6625 + #[prost(int32, tag = "148")] 6626 + pub speaker_mode: i32, 6627 + #[prost(bool, tag = "149")] 6628 + pub prevent_skip: bool, 6629 + #[prost(int32, tag = "150")] 6630 + pub touch_mode: i32, 6631 + #[prost(bool, tag = "151")] 6632 + pub pitch_mode_semitone: bool, 6633 + #[prost(bool, tag = "152")] 6634 + pub pitch_mode_timestretch: bool, 6635 + #[prost(string, tag = "153")] 6636 + pub player_name: ::prost::alloc::string::String, 6637 + #[prost(message, optional, tag = "154")] 6638 + pub compressor_settings: ::core::option::Option<CompressorSettings>, 6639 + #[prost(int32, tag = "155")] 6640 + pub sleeptimer_duration: i32, 6641 + #[prost(bool, tag = "156")] 6642 + pub sleeptimer_on_startup: bool, 6643 + #[prost(bool, tag = "157")] 6644 + pub keypress_restarts_sleeptimer: bool, 6645 + #[prost(bool, tag = "158")] 6646 + pub show_shutdown_message: bool, 6647 + #[prost(int32, tag = "159")] 6648 + pub hotkey_wps: i32, 6649 + #[prost(int32, tag = "160")] 6650 + pub hotkey_tree: i32, 6651 + #[prost(int32, tag = "161")] 6652 + pub resume_rewind: i32, 6653 + #[prost(int32, tag = "162")] 6654 + pub depth_3d: i32, 6655 + #[prost(int32, tag = "163")] 6656 + pub roll_off: i32, 6657 + #[prost(int32, tag = "164")] 6658 + pub power_mode: i32, 6659 + #[prost(bool, tag = "165")] 6660 + pub keyclick_hardware: bool, 6661 + #[prost(string, tag = "166")] 6662 + pub start_directory: ::prost::alloc::string::String, 6663 + #[prost(bool, tag = "167")] 6664 + pub root_menu_customized: bool, 6665 + #[prost(bool, tag = "168")] 6666 + pub shortcuts_replaces_qs: bool, 6667 + #[prost(int32, tag = "169")] 6668 + pub play_frequency: i32, 6669 + #[prost(int32, tag = "170")] 6670 + pub volume_limit: i32, 6671 + #[prost(int32, tag = "171")] 6672 + pub volume_adjust_mode: i32, 6673 + #[prost(int32, tag = "172")] 6674 + pub volume_adjust_norm_steps: i32, 6675 + #[prost(int32, tag = "173")] 6676 + pub surround_enabled: i32, 6677 + #[prost(int32, tag = "174")] 6678 + pub surround_balance: i32, 6679 + #[prost(int32, tag = "175")] 6680 + pub surround_fx1: i32, 6681 + #[prost(int32, tag = "176")] 6682 + pub surround_fx2: i32, 6683 + #[prost(bool, tag = "177")] 6684 + pub surround_method2: bool, 6685 + #[prost(int32, tag = "178")] 6686 + pub surround_mix: i32, 6687 + #[prost(int32, tag = "179")] 6688 + pub pbe: i32, 6689 + #[prost(int32, tag = "180")] 6690 + pub pbe_precut: i32, 6691 + #[prost(int32, tag = "181")] 6692 + pub afr_enabled: i32, 6693 + #[prost(int32, tag = "182")] 6694 + pub governor: i32, 6695 + #[prost(int32, tag = "183")] 6696 + pub stereosw_mode: i32, 6697 + #[prost(string, tag = "184")] 6698 + pub music_dir: ::prost::alloc::string::String, 6699 + } 6700 + #[derive(Clone, PartialEq, ::prost::Message)] 6701 + pub struct SaveSettingsRequest { 6702 + #[prost(string, optional, tag = "1")] 6703 + pub music_dir: ::core::option::Option<::prost::alloc::string::String>, 6704 + #[prost(bool, optional, tag = "2")] 6705 + pub playlist_shuffle: ::core::option::Option<bool>, 6706 + #[prost(int32, optional, tag = "3")] 6707 + pub repeat_mode: ::core::option::Option<i32>, 6708 + #[prost(int32, optional, tag = "4")] 6709 + pub bass: ::core::option::Option<i32>, 6710 + #[prost(int32, optional, tag = "5")] 6711 + pub treble: ::core::option::Option<i32>, 6712 + #[prost(int32, optional, tag = "6")] 6713 + pub bass_cutoff: ::core::option::Option<i32>, 6714 + #[prost(int32, optional, tag = "7")] 6715 + pub treble_cutoff: ::core::option::Option<i32>, 6716 + #[prost(int32, optional, tag = "8")] 6717 + pub crossfade: ::core::option::Option<i32>, 6718 + #[prost(bool, optional, tag = "9")] 6719 + pub fade_on_stop: ::core::option::Option<bool>, 6720 + #[prost(int32, optional, tag = "10")] 6721 + pub fade_in_delay: ::core::option::Option<i32>, 6722 + #[prost(int32, optional, tag = "11")] 6723 + pub fade_in_duration: ::core::option::Option<i32>, 6724 + #[prost(int32, optional, tag = "12")] 6725 + pub fade_out_delay: ::core::option::Option<i32>, 6726 + #[prost(int32, optional, tag = "13")] 6727 + pub fade_out_duration: ::core::option::Option<i32>, 6728 + #[prost(int32, optional, tag = "14")] 6729 + pub fade_out_mixmode: ::core::option::Option<i32>, 6730 + #[prost(int32, optional, tag = "15")] 6731 + pub balance: ::core::option::Option<i32>, 6732 + #[prost(int32, optional, tag = "16")] 6733 + pub stereo_width: ::core::option::Option<i32>, 6734 + #[prost(int32, optional, tag = "17")] 6735 + pub stereosw_mode: ::core::option::Option<i32>, 6736 + #[prost(int32, optional, tag = "18")] 6737 + pub surround_enabled: ::core::option::Option<i32>, 6738 + #[prost(int32, optional, tag = "19")] 6739 + pub surround_balance: ::core::option::Option<i32>, 6740 + #[prost(int32, optional, tag = "20")] 6741 + pub surround_fx1: ::core::option::Option<i32>, 6742 + #[prost(int32, optional, tag = "21")] 6743 + pub surround_fx2: ::core::option::Option<i32>, 6744 + #[prost(bool, optional, tag = "22")] 6745 + pub party_mode: ::core::option::Option<bool>, 6746 + #[prost(int32, optional, tag = "23")] 6747 + pub channel_config: ::core::option::Option<i32>, 6748 + #[prost(string, optional, tag = "24")] 6749 + pub player_name: ::core::option::Option<::prost::alloc::string::String>, 6750 + #[prost(bool, optional, tag = "25")] 6751 + pub eq_enabled: ::core::option::Option<bool>, 6752 + #[prost(message, repeated, tag = "26")] 6753 + pub eq_band_settings: ::prost::alloc::vec::Vec<EqBandSetting>, 6754 + #[prost(message, optional, tag = "27")] 6755 + pub replaygain_settings: ::core::option::Option<ReplaygainSettings>, 6756 + } 6757 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 6758 + pub struct SaveSettingsResponse {} 6759 + /// Generated client implementations. 6760 + pub mod settings_service_client { 6761 + #![allow( 6762 + unused_variables, 6763 + dead_code, 6764 + missing_docs, 6765 + clippy::wildcard_imports, 6766 + clippy::let_unit_value, 6767 + )] 6768 + use tonic::codegen::*; 6769 + use tonic::codegen::http::Uri; 6770 + #[derive(Debug, Clone)] 6771 + pub struct SettingsServiceClient<T> { 6772 + inner: tonic::client::Grpc<T>, 6773 + } 6774 + impl SettingsServiceClient<tonic::transport::Channel> { 6775 + /// Attempt to create a new client by connecting to a given endpoint. 6776 + pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error> 6777 + where 6778 + D: TryInto<tonic::transport::Endpoint>, 6779 + D::Error: Into<StdError>, 6780 + { 6781 + let conn = tonic::transport::Endpoint::new(dst)?.connect().await?; 6782 + Ok(Self::new(conn)) 6783 + } 6784 + } 6785 + impl<T> SettingsServiceClient<T> 6786 + where 6787 + T: tonic::client::GrpcService<tonic::body::BoxBody>, 6788 + T::Error: Into<StdError>, 6789 + T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static, 6790 + <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send, 6791 + { 6792 + pub fn new(inner: T) -> Self { 6793 + let inner = tonic::client::Grpc::new(inner); 6794 + Self { inner } 6795 + } 6796 + pub fn with_origin(inner: T, origin: Uri) -> Self { 6797 + let inner = tonic::client::Grpc::with_origin(inner, origin); 6798 + Self { inner } 6799 + } 6800 + pub fn with_interceptor<F>( 6801 + inner: T, 6802 + interceptor: F, 6803 + ) -> SettingsServiceClient<InterceptedService<T, F>> 6804 + where 6805 + F: tonic::service::Interceptor, 6806 + T::ResponseBody: Default, 6807 + T: tonic::codegen::Service< 6808 + http::Request<tonic::body::BoxBody>, 6809 + Response = http::Response< 6810 + <T as tonic::client::GrpcService<tonic::body::BoxBody>>::ResponseBody, 6811 + >, 6812 + >, 6813 + <T as tonic::codegen::Service< 6814 + http::Request<tonic::body::BoxBody>, 6815 + >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync, 6816 + { 6817 + SettingsServiceClient::new(InterceptedService::new(inner, interceptor)) 6818 + } 6819 + /// Compress requests with the given encoding. 6820 + /// 6821 + /// This requires the server to support it otherwise it might respond with an 6822 + /// error. 6823 + #[must_use] 6824 + pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { 6825 + self.inner = self.inner.send_compressed(encoding); 6826 + self 6827 + } 6828 + /// Enable decompressing responses. 6829 + #[must_use] 6830 + pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { 6831 + self.inner = self.inner.accept_compressed(encoding); 6832 + self 6833 + } 6834 + /// Limits the maximum size of a decoded message. 6835 + /// 6836 + /// Default: `4MB` 6837 + #[must_use] 6838 + pub fn max_decoding_message_size(mut self, limit: usize) -> Self { 6839 + self.inner = self.inner.max_decoding_message_size(limit); 6840 + self 6841 + } 6842 + /// Limits the maximum size of an encoded message. 6843 + /// 6844 + /// Default: `usize::MAX` 6845 + #[must_use] 6846 + pub fn max_encoding_message_size(mut self, limit: usize) -> Self { 6847 + self.inner = self.inner.max_encoding_message_size(limit); 6848 + self 6849 + } 6850 + pub async fn get_settings_list( 6851 + &mut self, 6852 + request: impl tonic::IntoRequest<super::GetSettingsListRequest>, 6853 + ) -> std::result::Result< 6854 + tonic::Response<super::GetSettingsListResponse>, 6855 + tonic::Status, 6856 + > { 6857 + self.inner 6858 + .ready() 6859 + .await 6860 + .map_err(|e| { 6861 + tonic::Status::unknown( 6862 + format!("Service was not ready: {}", e.into()), 6863 + ) 6864 + })?; 6865 + let codec = tonic::codec::ProstCodec::default(); 6866 + let path = http::uri::PathAndQuery::from_static( 6867 + "/rockbox.v1alpha1.SettingsService/GetSettingsList", 6868 + ); 6869 + let mut req = request.into_request(); 6870 + req.extensions_mut() 6871 + .insert( 6872 + GrpcMethod::new( 6873 + "rockbox.v1alpha1.SettingsService", 6874 + "GetSettingsList", 6875 + ), 6876 + ); 6877 + self.inner.unary(req, path, codec).await 6878 + } 6879 + pub async fn get_global_settings( 6880 + &mut self, 6881 + request: impl tonic::IntoRequest<super::GetGlobalSettingsRequest>, 6882 + ) -> std::result::Result< 6883 + tonic::Response<super::GetGlobalSettingsResponse>, 6884 + tonic::Status, 6885 + > { 6886 + self.inner 6887 + .ready() 6888 + .await 6889 + .map_err(|e| { 6890 + tonic::Status::unknown( 6891 + format!("Service was not ready: {}", e.into()), 6892 + ) 6893 + })?; 6894 + let codec = tonic::codec::ProstCodec::default(); 6895 + let path = http::uri::PathAndQuery::from_static( 6896 + "/rockbox.v1alpha1.SettingsService/GetGlobalSettings", 6897 + ); 6898 + let mut req = request.into_request(); 6899 + req.extensions_mut() 6900 + .insert( 6901 + GrpcMethod::new( 6902 + "rockbox.v1alpha1.SettingsService", 6903 + "GetGlobalSettings", 6904 + ), 6905 + ); 6906 + self.inner.unary(req, path, codec).await 6907 + } 6908 + pub async fn save_settings( 6909 + &mut self, 6910 + request: impl tonic::IntoRequest<super::SaveSettingsRequest>, 6911 + ) -> std::result::Result< 6912 + tonic::Response<super::SaveSettingsResponse>, 6913 + tonic::Status, 6914 + > { 6915 + self.inner 6916 + .ready() 6917 + .await 6918 + .map_err(|e| { 6919 + tonic::Status::unknown( 6920 + format!("Service was not ready: {}", e.into()), 6921 + ) 6922 + })?; 6923 + let codec = tonic::codec::ProstCodec::default(); 6924 + let path = http::uri::PathAndQuery::from_static( 6925 + "/rockbox.v1alpha1.SettingsService/SaveSettings", 6926 + ); 6927 + let mut req = request.into_request(); 6928 + req.extensions_mut() 6929 + .insert( 6930 + GrpcMethod::new("rockbox.v1alpha1.SettingsService", "SaveSettings"), 6931 + ); 6932 + self.inner.unary(req, path, codec).await 6933 + } 6934 + } 6935 + } 6936 + /// Generated server implementations. 6937 + pub mod settings_service_server { 6938 + #![allow( 6939 + unused_variables, 6940 + dead_code, 6941 + missing_docs, 6942 + clippy::wildcard_imports, 6943 + clippy::let_unit_value, 6944 + )] 6945 + use tonic::codegen::*; 6946 + /// Generated trait containing gRPC methods that should be implemented for use with SettingsServiceServer. 6947 + #[async_trait] 6948 + pub trait SettingsService: std::marker::Send + std::marker::Sync + 'static { 6949 + async fn get_settings_list( 6950 + &self, 6951 + request: tonic::Request<super::GetSettingsListRequest>, 6952 + ) -> std::result::Result< 6953 + tonic::Response<super::GetSettingsListResponse>, 6954 + tonic::Status, 6955 + >; 6956 + async fn get_global_settings( 6957 + &self, 6958 + request: tonic::Request<super::GetGlobalSettingsRequest>, 6959 + ) -> std::result::Result< 6960 + tonic::Response<super::GetGlobalSettingsResponse>, 6961 + tonic::Status, 6962 + >; 6963 + async fn save_settings( 6964 + &self, 6965 + request: tonic::Request<super::SaveSettingsRequest>, 6966 + ) -> std::result::Result< 6967 + tonic::Response<super::SaveSettingsResponse>, 6968 + tonic::Status, 6969 + >; 6970 + } 6971 + #[derive(Debug)] 6972 + pub struct SettingsServiceServer<T> { 6973 + inner: Arc<T>, 6974 + accept_compression_encodings: EnabledCompressionEncodings, 6975 + send_compression_encodings: EnabledCompressionEncodings, 6976 + max_decoding_message_size: Option<usize>, 6977 + max_encoding_message_size: Option<usize>, 6978 + } 6979 + impl<T> SettingsServiceServer<T> { 6980 + pub fn new(inner: T) -> Self { 6981 + Self::from_arc(Arc::new(inner)) 6982 + } 6983 + pub fn from_arc(inner: Arc<T>) -> Self { 6984 + Self { 6985 + inner, 6986 + accept_compression_encodings: Default::default(), 6987 + send_compression_encodings: Default::default(), 6988 + max_decoding_message_size: None, 6989 + max_encoding_message_size: None, 6990 + } 6991 + } 6992 + pub fn with_interceptor<F>( 6993 + inner: T, 6994 + interceptor: F, 6995 + ) -> InterceptedService<Self, F> 6996 + where 6997 + F: tonic::service::Interceptor, 6998 + { 6999 + InterceptedService::new(Self::new(inner), interceptor) 7000 + } 7001 + /// Enable decompressing requests with the given encoding. 7002 + #[must_use] 7003 + pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { 7004 + self.accept_compression_encodings.enable(encoding); 7005 + self 7006 + } 7007 + /// Compress responses with the given encoding, if the client supports it. 7008 + #[must_use] 7009 + pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { 7010 + self.send_compression_encodings.enable(encoding); 7011 + self 7012 + } 7013 + /// Limits the maximum size of a decoded message. 7014 + /// 7015 + /// Default: `4MB` 7016 + #[must_use] 7017 + pub fn max_decoding_message_size(mut self, limit: usize) -> Self { 7018 + self.max_decoding_message_size = Some(limit); 7019 + self 7020 + } 7021 + /// Limits the maximum size of an encoded message. 7022 + /// 7023 + /// Default: `usize::MAX` 7024 + #[must_use] 7025 + pub fn max_encoding_message_size(mut self, limit: usize) -> Self { 7026 + self.max_encoding_message_size = Some(limit); 7027 + self 7028 + } 7029 + } 7030 + impl<T, B> tonic::codegen::Service<http::Request<B>> for SettingsServiceServer<T> 7031 + where 7032 + T: SettingsService, 7033 + B: Body + std::marker::Send + 'static, 7034 + B::Error: Into<StdError> + std::marker::Send + 'static, 7035 + { 7036 + type Response = http::Response<tonic::body::BoxBody>; 7037 + type Error = std::convert::Infallible; 7038 + type Future = BoxFuture<Self::Response, Self::Error>; 7039 + fn poll_ready( 7040 + &mut self, 7041 + _cx: &mut Context<'_>, 7042 + ) -> Poll<std::result::Result<(), Self::Error>> { 7043 + Poll::Ready(Ok(())) 7044 + } 7045 + fn call(&mut self, req: http::Request<B>) -> Self::Future { 7046 + match req.uri().path() { 7047 + "/rockbox.v1alpha1.SettingsService/GetSettingsList" => { 7048 + #[allow(non_camel_case_types)] 7049 + struct GetSettingsListSvc<T: SettingsService>(pub Arc<T>); 7050 + impl< 7051 + T: SettingsService, 7052 + > tonic::server::UnaryService<super::GetSettingsListRequest> 7053 + for GetSettingsListSvc<T> { 7054 + type Response = super::GetSettingsListResponse; 7055 + type Future = BoxFuture< 7056 + tonic::Response<Self::Response>, 7057 + tonic::Status, 7058 + >; 7059 + fn call( 7060 + &mut self, 7061 + request: tonic::Request<super::GetSettingsListRequest>, 7062 + ) -> Self::Future { 7063 + let inner = Arc::clone(&self.0); 7064 + let fut = async move { 7065 + <T as SettingsService>::get_settings_list(&inner, request) 7066 + .await 7067 + }; 7068 + Box::pin(fut) 7069 + } 7070 + } 7071 + let accept_compression_encodings = self.accept_compression_encodings; 7072 + let send_compression_encodings = self.send_compression_encodings; 7073 + let max_decoding_message_size = self.max_decoding_message_size; 7074 + let max_encoding_message_size = self.max_encoding_message_size; 7075 + let inner = self.inner.clone(); 7076 + let fut = async move { 7077 + let method = GetSettingsListSvc(inner); 7078 + let codec = tonic::codec::ProstCodec::default(); 7079 + let mut grpc = tonic::server::Grpc::new(codec) 7080 + .apply_compression_config( 7081 + accept_compression_encodings, 7082 + send_compression_encodings, 7083 + ) 7084 + .apply_max_message_size_config( 7085 + max_decoding_message_size, 7086 + max_encoding_message_size, 7087 + ); 7088 + let res = grpc.unary(method, req).await; 7089 + Ok(res) 7090 + }; 7091 + Box::pin(fut) 7092 + } 7093 + "/rockbox.v1alpha1.SettingsService/GetGlobalSettings" => { 7094 + #[allow(non_camel_case_types)] 7095 + struct GetGlobalSettingsSvc<T: SettingsService>(pub Arc<T>); 7096 + impl< 7097 + T: SettingsService, 7098 + > tonic::server::UnaryService<super::GetGlobalSettingsRequest> 7099 + for GetGlobalSettingsSvc<T> { 7100 + type Response = super::GetGlobalSettingsResponse; 7101 + type Future = BoxFuture< 7102 + tonic::Response<Self::Response>, 7103 + tonic::Status, 7104 + >; 7105 + fn call( 7106 + &mut self, 7107 + request: tonic::Request<super::GetGlobalSettingsRequest>, 7108 + ) -> Self::Future { 7109 + let inner = Arc::clone(&self.0); 7110 + let fut = async move { 7111 + <T as SettingsService>::get_global_settings(&inner, request) 7112 + .await 7113 + }; 7114 + Box::pin(fut) 7115 + } 7116 + } 7117 + let accept_compression_encodings = self.accept_compression_encodings; 7118 + let send_compression_encodings = self.send_compression_encodings; 7119 + let max_decoding_message_size = self.max_decoding_message_size; 7120 + let max_encoding_message_size = self.max_encoding_message_size; 7121 + let inner = self.inner.clone(); 7122 + let fut = async move { 7123 + let method = GetGlobalSettingsSvc(inner); 7124 + let codec = tonic::codec::ProstCodec::default(); 7125 + let mut grpc = tonic::server::Grpc::new(codec) 7126 + .apply_compression_config( 7127 + accept_compression_encodings, 7128 + send_compression_encodings, 7129 + ) 7130 + .apply_max_message_size_config( 7131 + max_decoding_message_size, 7132 + max_encoding_message_size, 7133 + ); 7134 + let res = grpc.unary(method, req).await; 7135 + Ok(res) 7136 + }; 7137 + Box::pin(fut) 7138 + } 7139 + "/rockbox.v1alpha1.SettingsService/SaveSettings" => { 7140 + #[allow(non_camel_case_types)] 7141 + struct SaveSettingsSvc<T: SettingsService>(pub Arc<T>); 7142 + impl< 7143 + T: SettingsService, 7144 + > tonic::server::UnaryService<super::SaveSettingsRequest> 7145 + for SaveSettingsSvc<T> { 7146 + type Response = super::SaveSettingsResponse; 7147 + type Future = BoxFuture< 7148 + tonic::Response<Self::Response>, 7149 + tonic::Status, 7150 + >; 7151 + fn call( 7152 + &mut self, 7153 + request: tonic::Request<super::SaveSettingsRequest>, 7154 + ) -> Self::Future { 7155 + let inner = Arc::clone(&self.0); 7156 + let fut = async move { 7157 + <T as SettingsService>::save_settings(&inner, request).await 7158 + }; 7159 + Box::pin(fut) 7160 + } 7161 + } 7162 + let accept_compression_encodings = self.accept_compression_encodings; 7163 + let send_compression_encodings = self.send_compression_encodings; 7164 + let max_decoding_message_size = self.max_decoding_message_size; 7165 + let max_encoding_message_size = self.max_encoding_message_size; 7166 + let inner = self.inner.clone(); 7167 + let fut = async move { 7168 + let method = SaveSettingsSvc(inner); 7169 + let codec = tonic::codec::ProstCodec::default(); 7170 + let mut grpc = tonic::server::Grpc::new(codec) 7171 + .apply_compression_config( 7172 + accept_compression_encodings, 7173 + send_compression_encodings, 7174 + ) 7175 + .apply_max_message_size_config( 7176 + max_decoding_message_size, 7177 + max_encoding_message_size, 7178 + ); 7179 + let res = grpc.unary(method, req).await; 7180 + Ok(res) 7181 + }; 7182 + Box::pin(fut) 7183 + } 7184 + _ => { 7185 + Box::pin(async move { 7186 + let mut response = http::Response::new(empty_body()); 7187 + let headers = response.headers_mut(); 7188 + headers 7189 + .insert( 7190 + tonic::Status::GRPC_STATUS, 7191 + (tonic::Code::Unimplemented as i32).into(), 7192 + ); 7193 + headers 7194 + .insert( 7195 + http::header::CONTENT_TYPE, 7196 + tonic::metadata::GRPC_CONTENT_TYPE, 7197 + ); 7198 + Ok(response) 7199 + }) 7200 + } 7201 + } 7202 + } 7203 + } 7204 + impl<T> Clone for SettingsServiceServer<T> { 7205 + fn clone(&self) -> Self { 7206 + let inner = self.inner.clone(); 7207 + Self { 7208 + inner, 7209 + accept_compression_encodings: self.accept_compression_encodings, 7210 + send_compression_encodings: self.send_compression_encodings, 7211 + max_decoding_message_size: self.max_decoding_message_size, 7212 + max_encoding_message_size: self.max_encoding_message_size, 7213 + } 7214 + } 7215 + } 7216 + /// Generated gRPC service name 7217 + pub const SERVICE_NAME: &str = "rockbox.v1alpha1.SettingsService"; 7218 + impl<T> tonic::server::NamedService for SettingsServiceServer<T> { 7219 + const NAME: &'static str = SERVICE_NAME; 7220 + } 7221 + } 7222 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 7223 + pub struct AdjustVolumeRequest { 7224 + #[prost(int32, tag = "1")] 7225 + pub steps: i32, 7226 + } 7227 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 7228 + pub struct AdjustVolumeResponse {} 7229 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 7230 + pub struct SoundSetRequest { 7231 + #[prost(int32, tag = "1")] 7232 + pub setting: i32, 7233 + #[prost(int32, tag = "2")] 7234 + pub value: i32, 7235 + } 7236 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 7237 + pub struct SoundSetResponse {} 7238 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 7239 + pub struct SoundCurrentRequest { 7240 + #[prost(int32, tag = "1")] 7241 + pub setting: i32, 7242 + } 7243 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 7244 + pub struct SoundCurrentResponse { 7245 + #[prost(int32, tag = "1")] 7246 + pub value: i32, 7247 + } 7248 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 7249 + pub struct SoundDefaultRequest { 7250 + #[prost(int32, tag = "1")] 7251 + pub setting: i32, 7252 + } 7253 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 7254 + pub struct SoundDefaultResponse { 7255 + #[prost(int32, tag = "1")] 7256 + pub value: i32, 7257 + } 7258 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 7259 + pub struct SoundMinRequest { 7260 + #[prost(int32, tag = "1")] 7261 + pub setting: i32, 7262 + } 7263 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 7264 + pub struct SoundMinResponse { 7265 + #[prost(int32, tag = "1")] 7266 + pub value: i32, 7267 + } 7268 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 7269 + pub struct SoundMaxRequest { 7270 + #[prost(int32, tag = "1")] 7271 + pub setting: i32, 7272 + } 7273 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 7274 + pub struct SoundMaxResponse { 7275 + #[prost(int32, tag = "1")] 7276 + pub value: i32, 7277 + } 7278 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 7279 + pub struct SoundUnitRequest {} 7280 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 7281 + pub struct SoundUnitResponse {} 7282 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 7283 + pub struct SoundVal2PhysRequest { 7284 + #[prost(int32, tag = "1")] 7285 + pub setting: i32, 7286 + #[prost(int32, tag = "2")] 7287 + pub value: i32, 7288 + } 7289 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 7290 + pub struct SoundVal2PhysResponse { 7291 + #[prost(int32, tag = "1")] 7292 + pub value: i32, 7293 + } 7294 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 7295 + pub struct GetPitchRequest {} 7296 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 7297 + pub struct GetPitchResponse { 7298 + #[prost(int32, tag = "1")] 7299 + pub value: i32, 7300 + } 7301 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 7302 + pub struct SetPitchRequest { 7303 + #[prost(int32, tag = "1")] 7304 + pub value: i32, 7305 + } 7306 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 7307 + pub struct SetPitchResponse {} 7308 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 7309 + pub struct BeepPlayRequest { 7310 + #[prost(uint32, tag = "1")] 7311 + pub frequency: u32, 7312 + #[prost(uint32, tag = "2")] 7313 + pub duration: u32, 7314 + #[prost(uint32, tag = "3")] 7315 + pub amplitude: u32, 7316 + } 7317 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 7318 + pub struct BeepPlayResponse {} 7319 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 7320 + pub struct PcmbufFadeRequest { 7321 + #[prost(int32, tag = "1")] 7322 + pub fade: i32, 7323 + #[prost(bool, tag = "2")] 7324 + pub r#in: bool, 7325 + } 7326 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 7327 + pub struct PcmbufFadeResponse {} 7328 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 7329 + pub struct PcmbufSetLowLatencyRequest { 7330 + #[prost(bool, tag = "1")] 7331 + pub state: bool, 7332 + } 7333 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 7334 + pub struct PcmbufSetLowLatencyResponse {} 7335 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 7336 + pub struct SystemSoundPlayRequest { 7337 + #[prost(uint32, tag = "1")] 7338 + pub sound: u32, 7339 + } 7340 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 7341 + pub struct SystemSoundPlayResponse {} 7342 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 7343 + pub struct KeyclickClickRequest { 7344 + #[prost(bool, tag = "1")] 7345 + pub rawbutton: bool, 7346 + #[prost(int32, tag = "2")] 7347 + pub action: i32, 7348 + } 7349 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 7350 + pub struct KeyclickClickResponse {} 7351 + /// Generated client implementations. 7352 + pub mod sound_service_client { 7353 + #![allow( 7354 + unused_variables, 7355 + dead_code, 7356 + missing_docs, 7357 + clippy::wildcard_imports, 7358 + clippy::let_unit_value, 7359 + )] 7360 + use tonic::codegen::*; 7361 + use tonic::codegen::http::Uri; 7362 + #[derive(Debug, Clone)] 7363 + pub struct SoundServiceClient<T> { 7364 + inner: tonic::client::Grpc<T>, 7365 + } 7366 + impl SoundServiceClient<tonic::transport::Channel> { 7367 + /// Attempt to create a new client by connecting to a given endpoint. 7368 + pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error> 7369 + where 7370 + D: TryInto<tonic::transport::Endpoint>, 7371 + D::Error: Into<StdError>, 7372 + { 7373 + let conn = tonic::transport::Endpoint::new(dst)?.connect().await?; 7374 + Ok(Self::new(conn)) 7375 + } 7376 + } 7377 + impl<T> SoundServiceClient<T> 7378 + where 7379 + T: tonic::client::GrpcService<tonic::body::BoxBody>, 7380 + T::Error: Into<StdError>, 7381 + T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static, 7382 + <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send, 7383 + { 7384 + pub fn new(inner: T) -> Self { 7385 + let inner = tonic::client::Grpc::new(inner); 7386 + Self { inner } 7387 + } 7388 + pub fn with_origin(inner: T, origin: Uri) -> Self { 7389 + let inner = tonic::client::Grpc::with_origin(inner, origin); 7390 + Self { inner } 7391 + } 7392 + pub fn with_interceptor<F>( 7393 + inner: T, 7394 + interceptor: F, 7395 + ) -> SoundServiceClient<InterceptedService<T, F>> 7396 + where 7397 + F: tonic::service::Interceptor, 7398 + T::ResponseBody: Default, 7399 + T: tonic::codegen::Service< 7400 + http::Request<tonic::body::BoxBody>, 7401 + Response = http::Response< 7402 + <T as tonic::client::GrpcService<tonic::body::BoxBody>>::ResponseBody, 7403 + >, 7404 + >, 7405 + <T as tonic::codegen::Service< 7406 + http::Request<tonic::body::BoxBody>, 7407 + >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync, 7408 + { 7409 + SoundServiceClient::new(InterceptedService::new(inner, interceptor)) 7410 + } 7411 + /// Compress requests with the given encoding. 7412 + /// 7413 + /// This requires the server to support it otherwise it might respond with an 7414 + /// error. 7415 + #[must_use] 7416 + pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { 7417 + self.inner = self.inner.send_compressed(encoding); 7418 + self 7419 + } 7420 + /// Enable decompressing responses. 7421 + #[must_use] 7422 + pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { 7423 + self.inner = self.inner.accept_compressed(encoding); 7424 + self 7425 + } 7426 + /// Limits the maximum size of a decoded message. 7427 + /// 7428 + /// Default: `4MB` 7429 + #[must_use] 7430 + pub fn max_decoding_message_size(mut self, limit: usize) -> Self { 7431 + self.inner = self.inner.max_decoding_message_size(limit); 7432 + self 7433 + } 7434 + /// Limits the maximum size of an encoded message. 7435 + /// 7436 + /// Default: `usize::MAX` 7437 + #[must_use] 7438 + pub fn max_encoding_message_size(mut self, limit: usize) -> Self { 7439 + self.inner = self.inner.max_encoding_message_size(limit); 7440 + self 7441 + } 7442 + pub async fn adjust_volume( 7443 + &mut self, 7444 + request: impl tonic::IntoRequest<super::AdjustVolumeRequest>, 7445 + ) -> std::result::Result< 7446 + tonic::Response<super::AdjustVolumeResponse>, 7447 + tonic::Status, 7448 + > { 7449 + self.inner 7450 + .ready() 7451 + .await 7452 + .map_err(|e| { 7453 + tonic::Status::unknown( 7454 + format!("Service was not ready: {}", e.into()), 7455 + ) 7456 + })?; 7457 + let codec = tonic::codec::ProstCodec::default(); 7458 + let path = http::uri::PathAndQuery::from_static( 7459 + "/rockbox.v1alpha1.SoundService/AdjustVolume", 7460 + ); 7461 + let mut req = request.into_request(); 7462 + req.extensions_mut() 7463 + .insert( 7464 + GrpcMethod::new("rockbox.v1alpha1.SoundService", "AdjustVolume"), 7465 + ); 7466 + self.inner.unary(req, path, codec).await 7467 + } 7468 + pub async fn sound_set( 7469 + &mut self, 7470 + request: impl tonic::IntoRequest<super::SoundSetRequest>, 7471 + ) -> std::result::Result< 7472 + tonic::Response<super::SoundSetResponse>, 7473 + tonic::Status, 7474 + > { 7475 + self.inner 7476 + .ready() 7477 + .await 7478 + .map_err(|e| { 7479 + tonic::Status::unknown( 7480 + format!("Service was not ready: {}", e.into()), 7481 + ) 7482 + })?; 7483 + let codec = tonic::codec::ProstCodec::default(); 7484 + let path = http::uri::PathAndQuery::from_static( 7485 + "/rockbox.v1alpha1.SoundService/SoundSet", 7486 + ); 7487 + let mut req = request.into_request(); 7488 + req.extensions_mut() 7489 + .insert(GrpcMethod::new("rockbox.v1alpha1.SoundService", "SoundSet")); 7490 + self.inner.unary(req, path, codec).await 7491 + } 7492 + pub async fn sound_current( 7493 + &mut self, 7494 + request: impl tonic::IntoRequest<super::SoundCurrentRequest>, 7495 + ) -> std::result::Result< 7496 + tonic::Response<super::SoundCurrentResponse>, 7497 + tonic::Status, 7498 + > { 7499 + self.inner 7500 + .ready() 7501 + .await 7502 + .map_err(|e| { 7503 + tonic::Status::unknown( 7504 + format!("Service was not ready: {}", e.into()), 7505 + ) 7506 + })?; 7507 + let codec = tonic::codec::ProstCodec::default(); 7508 + let path = http::uri::PathAndQuery::from_static( 7509 + "/rockbox.v1alpha1.SoundService/SoundCurrent", 7510 + ); 7511 + let mut req = request.into_request(); 7512 + req.extensions_mut() 7513 + .insert( 7514 + GrpcMethod::new("rockbox.v1alpha1.SoundService", "SoundCurrent"), 7515 + ); 7516 + self.inner.unary(req, path, codec).await 7517 + } 7518 + pub async fn sound_default( 7519 + &mut self, 7520 + request: impl tonic::IntoRequest<super::SoundDefaultRequest>, 7521 + ) -> std::result::Result< 7522 + tonic::Response<super::SoundDefaultResponse>, 7523 + tonic::Status, 7524 + > { 7525 + self.inner 7526 + .ready() 7527 + .await 7528 + .map_err(|e| { 7529 + tonic::Status::unknown( 7530 + format!("Service was not ready: {}", e.into()), 7531 + ) 7532 + })?; 7533 + let codec = tonic::codec::ProstCodec::default(); 7534 + let path = http::uri::PathAndQuery::from_static( 7535 + "/rockbox.v1alpha1.SoundService/SoundDefault", 7536 + ); 7537 + let mut req = request.into_request(); 7538 + req.extensions_mut() 7539 + .insert( 7540 + GrpcMethod::new("rockbox.v1alpha1.SoundService", "SoundDefault"), 7541 + ); 7542 + self.inner.unary(req, path, codec).await 7543 + } 7544 + pub async fn sound_min( 7545 + &mut self, 7546 + request: impl tonic::IntoRequest<super::SoundMinRequest>, 7547 + ) -> std::result::Result< 7548 + tonic::Response<super::SoundMinResponse>, 7549 + tonic::Status, 7550 + > { 7551 + self.inner 7552 + .ready() 7553 + .await 7554 + .map_err(|e| { 7555 + tonic::Status::unknown( 7556 + format!("Service was not ready: {}", e.into()), 7557 + ) 7558 + })?; 7559 + let codec = tonic::codec::ProstCodec::default(); 7560 + let path = http::uri::PathAndQuery::from_static( 7561 + "/rockbox.v1alpha1.SoundService/SoundMin", 7562 + ); 7563 + let mut req = request.into_request(); 7564 + req.extensions_mut() 7565 + .insert(GrpcMethod::new("rockbox.v1alpha1.SoundService", "SoundMin")); 7566 + self.inner.unary(req, path, codec).await 7567 + } 7568 + pub async fn sound_max( 7569 + &mut self, 7570 + request: impl tonic::IntoRequest<super::SoundMaxRequest>, 7571 + ) -> std::result::Result< 7572 + tonic::Response<super::SoundMaxResponse>, 7573 + tonic::Status, 7574 + > { 7575 + self.inner 7576 + .ready() 7577 + .await 7578 + .map_err(|e| { 7579 + tonic::Status::unknown( 7580 + format!("Service was not ready: {}", e.into()), 7581 + ) 7582 + })?; 7583 + let codec = tonic::codec::ProstCodec::default(); 7584 + let path = http::uri::PathAndQuery::from_static( 7585 + "/rockbox.v1alpha1.SoundService/SoundMax", 7586 + ); 7587 + let mut req = request.into_request(); 7588 + req.extensions_mut() 7589 + .insert(GrpcMethod::new("rockbox.v1alpha1.SoundService", "SoundMax")); 7590 + self.inner.unary(req, path, codec).await 7591 + } 7592 + pub async fn sound_unit( 7593 + &mut self, 7594 + request: impl tonic::IntoRequest<super::SoundUnitRequest>, 7595 + ) -> std::result::Result< 7596 + tonic::Response<super::SoundUnitResponse>, 7597 + tonic::Status, 7598 + > { 7599 + self.inner 7600 + .ready() 7601 + .await 7602 + .map_err(|e| { 7603 + tonic::Status::unknown( 7604 + format!("Service was not ready: {}", e.into()), 7605 + ) 7606 + })?; 7607 + let codec = tonic::codec::ProstCodec::default(); 7608 + let path = http::uri::PathAndQuery::from_static( 7609 + "/rockbox.v1alpha1.SoundService/SoundUnit", 7610 + ); 7611 + let mut req = request.into_request(); 7612 + req.extensions_mut() 7613 + .insert(GrpcMethod::new("rockbox.v1alpha1.SoundService", "SoundUnit")); 7614 + self.inner.unary(req, path, codec).await 7615 + } 7616 + pub async fn sound_val2_phys( 7617 + &mut self, 7618 + request: impl tonic::IntoRequest<super::SoundVal2PhysRequest>, 7619 + ) -> std::result::Result< 7620 + tonic::Response<super::SoundVal2PhysResponse>, 7621 + tonic::Status, 7622 + > { 7623 + self.inner 7624 + .ready() 7625 + .await 7626 + .map_err(|e| { 7627 + tonic::Status::unknown( 7628 + format!("Service was not ready: {}", e.into()), 7629 + ) 7630 + })?; 7631 + let codec = tonic::codec::ProstCodec::default(); 7632 + let path = http::uri::PathAndQuery::from_static( 7633 + "/rockbox.v1alpha1.SoundService/SoundVal2Phys", 7634 + ); 7635 + let mut req = request.into_request(); 7636 + req.extensions_mut() 7637 + .insert( 7638 + GrpcMethod::new("rockbox.v1alpha1.SoundService", "SoundVal2Phys"), 7639 + ); 7640 + self.inner.unary(req, path, codec).await 7641 + } 7642 + pub async fn get_pitch( 7643 + &mut self, 7644 + request: impl tonic::IntoRequest<super::GetPitchRequest>, 7645 + ) -> std::result::Result< 7646 + tonic::Response<super::GetPitchResponse>, 7647 + tonic::Status, 7648 + > { 7649 + self.inner 7650 + .ready() 7651 + .await 7652 + .map_err(|e| { 7653 + tonic::Status::unknown( 7654 + format!("Service was not ready: {}", e.into()), 7655 + ) 7656 + })?; 7657 + let codec = tonic::codec::ProstCodec::default(); 7658 + let path = http::uri::PathAndQuery::from_static( 7659 + "/rockbox.v1alpha1.SoundService/GetPitch", 7660 + ); 7661 + let mut req = request.into_request(); 7662 + req.extensions_mut() 7663 + .insert(GrpcMethod::new("rockbox.v1alpha1.SoundService", "GetPitch")); 7664 + self.inner.unary(req, path, codec).await 7665 + } 7666 + pub async fn set_pitch( 7667 + &mut self, 7668 + request: impl tonic::IntoRequest<super::SetPitchRequest>, 7669 + ) -> std::result::Result< 7670 + tonic::Response<super::SetPitchResponse>, 7671 + tonic::Status, 7672 + > { 7673 + self.inner 7674 + .ready() 7675 + .await 7676 + .map_err(|e| { 7677 + tonic::Status::unknown( 7678 + format!("Service was not ready: {}", e.into()), 7679 + ) 7680 + })?; 7681 + let codec = tonic::codec::ProstCodec::default(); 7682 + let path = http::uri::PathAndQuery::from_static( 7683 + "/rockbox.v1alpha1.SoundService/SetPitch", 7684 + ); 7685 + let mut req = request.into_request(); 7686 + req.extensions_mut() 7687 + .insert(GrpcMethod::new("rockbox.v1alpha1.SoundService", "SetPitch")); 7688 + self.inner.unary(req, path, codec).await 7689 + } 7690 + pub async fn beep_play( 7691 + &mut self, 7692 + request: impl tonic::IntoRequest<super::BeepPlayRequest>, 7693 + ) -> std::result::Result< 7694 + tonic::Response<super::BeepPlayResponse>, 7695 + tonic::Status, 7696 + > { 7697 + self.inner 7698 + .ready() 7699 + .await 7700 + .map_err(|e| { 7701 + tonic::Status::unknown( 7702 + format!("Service was not ready: {}", e.into()), 7703 + ) 7704 + })?; 7705 + let codec = tonic::codec::ProstCodec::default(); 7706 + let path = http::uri::PathAndQuery::from_static( 7707 + "/rockbox.v1alpha1.SoundService/BeepPlay", 7708 + ); 7709 + let mut req = request.into_request(); 7710 + req.extensions_mut() 7711 + .insert(GrpcMethod::new("rockbox.v1alpha1.SoundService", "BeepPlay")); 7712 + self.inner.unary(req, path, codec).await 7713 + } 7714 + pub async fn pcmbuf_fade( 7715 + &mut self, 7716 + request: impl tonic::IntoRequest<super::PcmbufFadeRequest>, 7717 + ) -> std::result::Result< 7718 + tonic::Response<super::PcmbufFadeResponse>, 7719 + tonic::Status, 7720 + > { 7721 + self.inner 7722 + .ready() 7723 + .await 7724 + .map_err(|e| { 7725 + tonic::Status::unknown( 7726 + format!("Service was not ready: {}", e.into()), 7727 + ) 7728 + })?; 7729 + let codec = tonic::codec::ProstCodec::default(); 7730 + let path = http::uri::PathAndQuery::from_static( 7731 + "/rockbox.v1alpha1.SoundService/PcmbufFade", 7732 + ); 7733 + let mut req = request.into_request(); 7734 + req.extensions_mut() 7735 + .insert(GrpcMethod::new("rockbox.v1alpha1.SoundService", "PcmbufFade")); 7736 + self.inner.unary(req, path, codec).await 7737 + } 7738 + pub async fn pcmbuf_set_low_latency( 7739 + &mut self, 7740 + request: impl tonic::IntoRequest<super::PcmbufSetLowLatencyRequest>, 7741 + ) -> std::result::Result< 7742 + tonic::Response<super::PcmbufSetLowLatencyResponse>, 7743 + tonic::Status, 7744 + > { 7745 + self.inner 7746 + .ready() 7747 + .await 7748 + .map_err(|e| { 7749 + tonic::Status::unknown( 7750 + format!("Service was not ready: {}", e.into()), 7751 + ) 7752 + })?; 7753 + let codec = tonic::codec::ProstCodec::default(); 7754 + let path = http::uri::PathAndQuery::from_static( 7755 + "/rockbox.v1alpha1.SoundService/PcmbufSetLowLatency", 7756 + ); 7757 + let mut req = request.into_request(); 7758 + req.extensions_mut() 7759 + .insert( 7760 + GrpcMethod::new( 7761 + "rockbox.v1alpha1.SoundService", 7762 + "PcmbufSetLowLatency", 7763 + ), 7764 + ); 7765 + self.inner.unary(req, path, codec).await 7766 + } 7767 + pub async fn system_sound_play( 7768 + &mut self, 7769 + request: impl tonic::IntoRequest<super::SystemSoundPlayRequest>, 7770 + ) -> std::result::Result< 7771 + tonic::Response<super::SystemSoundPlayResponse>, 7772 + tonic::Status, 7773 + > { 7774 + self.inner 7775 + .ready() 7776 + .await 7777 + .map_err(|e| { 7778 + tonic::Status::unknown( 7779 + format!("Service was not ready: {}", e.into()), 7780 + ) 7781 + })?; 7782 + let codec = tonic::codec::ProstCodec::default(); 7783 + let path = http::uri::PathAndQuery::from_static( 7784 + "/rockbox.v1alpha1.SoundService/SystemSoundPlay", 7785 + ); 7786 + let mut req = request.into_request(); 7787 + req.extensions_mut() 7788 + .insert( 7789 + GrpcMethod::new("rockbox.v1alpha1.SoundService", "SystemSoundPlay"), 7790 + ); 7791 + self.inner.unary(req, path, codec).await 7792 + } 7793 + pub async fn keyclick_click( 7794 + &mut self, 7795 + request: impl tonic::IntoRequest<super::KeyclickClickRequest>, 7796 + ) -> std::result::Result< 7797 + tonic::Response<super::KeyclickClickResponse>, 7798 + tonic::Status, 7799 + > { 7800 + self.inner 7801 + .ready() 7802 + .await 7803 + .map_err(|e| { 7804 + tonic::Status::unknown( 7805 + format!("Service was not ready: {}", e.into()), 7806 + ) 7807 + })?; 7808 + let codec = tonic::codec::ProstCodec::default(); 7809 + let path = http::uri::PathAndQuery::from_static( 7810 + "/rockbox.v1alpha1.SoundService/KeyclickClick", 7811 + ); 7812 + let mut req = request.into_request(); 7813 + req.extensions_mut() 7814 + .insert( 7815 + GrpcMethod::new("rockbox.v1alpha1.SoundService", "KeyclickClick"), 7816 + ); 7817 + self.inner.unary(req, path, codec).await 7818 + } 7819 + } 7820 + } 7821 + /// Generated server implementations. 7822 + pub mod sound_service_server { 7823 + #![allow( 7824 + unused_variables, 7825 + dead_code, 7826 + missing_docs, 7827 + clippy::wildcard_imports, 7828 + clippy::let_unit_value, 7829 + )] 7830 + use tonic::codegen::*; 7831 + /// Generated trait containing gRPC methods that should be implemented for use with SoundServiceServer. 7832 + #[async_trait] 7833 + pub trait SoundService: std::marker::Send + std::marker::Sync + 'static { 7834 + async fn adjust_volume( 7835 + &self, 7836 + request: tonic::Request<super::AdjustVolumeRequest>, 7837 + ) -> std::result::Result< 7838 + tonic::Response<super::AdjustVolumeResponse>, 7839 + tonic::Status, 7840 + >; 7841 + async fn sound_set( 7842 + &self, 7843 + request: tonic::Request<super::SoundSetRequest>, 7844 + ) -> std::result::Result< 7845 + tonic::Response<super::SoundSetResponse>, 7846 + tonic::Status, 7847 + >; 7848 + async fn sound_current( 7849 + &self, 7850 + request: tonic::Request<super::SoundCurrentRequest>, 7851 + ) -> std::result::Result< 7852 + tonic::Response<super::SoundCurrentResponse>, 7853 + tonic::Status, 7854 + >; 7855 + async fn sound_default( 7856 + &self, 7857 + request: tonic::Request<super::SoundDefaultRequest>, 7858 + ) -> std::result::Result< 7859 + tonic::Response<super::SoundDefaultResponse>, 7860 + tonic::Status, 7861 + >; 7862 + async fn sound_min( 7863 + &self, 7864 + request: tonic::Request<super::SoundMinRequest>, 7865 + ) -> std::result::Result< 7866 + tonic::Response<super::SoundMinResponse>, 7867 + tonic::Status, 7868 + >; 7869 + async fn sound_max( 7870 + &self, 7871 + request: tonic::Request<super::SoundMaxRequest>, 7872 + ) -> std::result::Result< 7873 + tonic::Response<super::SoundMaxResponse>, 7874 + tonic::Status, 7875 + >; 7876 + async fn sound_unit( 7877 + &self, 7878 + request: tonic::Request<super::SoundUnitRequest>, 7879 + ) -> std::result::Result< 7880 + tonic::Response<super::SoundUnitResponse>, 7881 + tonic::Status, 7882 + >; 7883 + async fn sound_val2_phys( 7884 + &self, 7885 + request: tonic::Request<super::SoundVal2PhysRequest>, 7886 + ) -> std::result::Result< 7887 + tonic::Response<super::SoundVal2PhysResponse>, 7888 + tonic::Status, 7889 + >; 7890 + async fn get_pitch( 7891 + &self, 7892 + request: tonic::Request<super::GetPitchRequest>, 7893 + ) -> std::result::Result< 7894 + tonic::Response<super::GetPitchResponse>, 7895 + tonic::Status, 7896 + >; 7897 + async fn set_pitch( 7898 + &self, 7899 + request: tonic::Request<super::SetPitchRequest>, 7900 + ) -> std::result::Result< 7901 + tonic::Response<super::SetPitchResponse>, 7902 + tonic::Status, 7903 + >; 7904 + async fn beep_play( 7905 + &self, 7906 + request: tonic::Request<super::BeepPlayRequest>, 7907 + ) -> std::result::Result< 7908 + tonic::Response<super::BeepPlayResponse>, 7909 + tonic::Status, 7910 + >; 7911 + async fn pcmbuf_fade( 7912 + &self, 7913 + request: tonic::Request<super::PcmbufFadeRequest>, 7914 + ) -> std::result::Result< 7915 + tonic::Response<super::PcmbufFadeResponse>, 7916 + tonic::Status, 7917 + >; 7918 + async fn pcmbuf_set_low_latency( 7919 + &self, 7920 + request: tonic::Request<super::PcmbufSetLowLatencyRequest>, 7921 + ) -> std::result::Result< 7922 + tonic::Response<super::PcmbufSetLowLatencyResponse>, 7923 + tonic::Status, 7924 + >; 7925 + async fn system_sound_play( 7926 + &self, 7927 + request: tonic::Request<super::SystemSoundPlayRequest>, 7928 + ) -> std::result::Result< 7929 + tonic::Response<super::SystemSoundPlayResponse>, 7930 + tonic::Status, 7931 + >; 7932 + async fn keyclick_click( 7933 + &self, 7934 + request: tonic::Request<super::KeyclickClickRequest>, 7935 + ) -> std::result::Result< 7936 + tonic::Response<super::KeyclickClickResponse>, 7937 + tonic::Status, 7938 + >; 7939 + } 7940 + #[derive(Debug)] 7941 + pub struct SoundServiceServer<T> { 7942 + inner: Arc<T>, 7943 + accept_compression_encodings: EnabledCompressionEncodings, 7944 + send_compression_encodings: EnabledCompressionEncodings, 7945 + max_decoding_message_size: Option<usize>, 7946 + max_encoding_message_size: Option<usize>, 7947 + } 7948 + impl<T> SoundServiceServer<T> { 7949 + pub fn new(inner: T) -> Self { 7950 + Self::from_arc(Arc::new(inner)) 7951 + } 7952 + pub fn from_arc(inner: Arc<T>) -> Self { 7953 + Self { 7954 + inner, 7955 + accept_compression_encodings: Default::default(), 7956 + send_compression_encodings: Default::default(), 7957 + max_decoding_message_size: None, 7958 + max_encoding_message_size: None, 7959 + } 7960 + } 7961 + pub fn with_interceptor<F>( 7962 + inner: T, 7963 + interceptor: F, 7964 + ) -> InterceptedService<Self, F> 7965 + where 7966 + F: tonic::service::Interceptor, 7967 + { 7968 + InterceptedService::new(Self::new(inner), interceptor) 7969 + } 7970 + /// Enable decompressing requests with the given encoding. 7971 + #[must_use] 7972 + pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { 7973 + self.accept_compression_encodings.enable(encoding); 7974 + self 7975 + } 7976 + /// Compress responses with the given encoding, if the client supports it. 7977 + #[must_use] 7978 + pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { 7979 + self.send_compression_encodings.enable(encoding); 7980 + self 7981 + } 7982 + /// Limits the maximum size of a decoded message. 7983 + /// 7984 + /// Default: `4MB` 7985 + #[must_use] 7986 + pub fn max_decoding_message_size(mut self, limit: usize) -> Self { 7987 + self.max_decoding_message_size = Some(limit); 7988 + self 7989 + } 7990 + /// Limits the maximum size of an encoded message. 7991 + /// 7992 + /// Default: `usize::MAX` 7993 + #[must_use] 7994 + pub fn max_encoding_message_size(mut self, limit: usize) -> Self { 7995 + self.max_encoding_message_size = Some(limit); 7996 + self 7997 + } 7998 + } 7999 + impl<T, B> tonic::codegen::Service<http::Request<B>> for SoundServiceServer<T> 8000 + where 8001 + T: SoundService, 8002 + B: Body + std::marker::Send + 'static, 8003 + B::Error: Into<StdError> + std::marker::Send + 'static, 8004 + { 8005 + type Response = http::Response<tonic::body::BoxBody>; 8006 + type Error = std::convert::Infallible; 8007 + type Future = BoxFuture<Self::Response, Self::Error>; 8008 + fn poll_ready( 8009 + &mut self, 8010 + _cx: &mut Context<'_>, 8011 + ) -> Poll<std::result::Result<(), Self::Error>> { 8012 + Poll::Ready(Ok(())) 8013 + } 8014 + fn call(&mut self, req: http::Request<B>) -> Self::Future { 8015 + match req.uri().path() { 8016 + "/rockbox.v1alpha1.SoundService/AdjustVolume" => { 8017 + #[allow(non_camel_case_types)] 8018 + struct AdjustVolumeSvc<T: SoundService>(pub Arc<T>); 8019 + impl< 8020 + T: SoundService, 8021 + > tonic::server::UnaryService<super::AdjustVolumeRequest> 8022 + for AdjustVolumeSvc<T> { 8023 + type Response = super::AdjustVolumeResponse; 8024 + type Future = BoxFuture< 8025 + tonic::Response<Self::Response>, 8026 + tonic::Status, 8027 + >; 8028 + fn call( 8029 + &mut self, 8030 + request: tonic::Request<super::AdjustVolumeRequest>, 8031 + ) -> Self::Future { 8032 + let inner = Arc::clone(&self.0); 8033 + let fut = async move { 8034 + <T as SoundService>::adjust_volume(&inner, request).await 8035 + }; 8036 + Box::pin(fut) 8037 + } 8038 + } 8039 + let accept_compression_encodings = self.accept_compression_encodings; 8040 + let send_compression_encodings = self.send_compression_encodings; 8041 + let max_decoding_message_size = self.max_decoding_message_size; 8042 + let max_encoding_message_size = self.max_encoding_message_size; 8043 + let inner = self.inner.clone(); 8044 + let fut = async move { 8045 + let method = AdjustVolumeSvc(inner); 8046 + let codec = tonic::codec::ProstCodec::default(); 8047 + let mut grpc = tonic::server::Grpc::new(codec) 8048 + .apply_compression_config( 8049 + accept_compression_encodings, 8050 + send_compression_encodings, 8051 + ) 8052 + .apply_max_message_size_config( 8053 + max_decoding_message_size, 8054 + max_encoding_message_size, 8055 + ); 8056 + let res = grpc.unary(method, req).await; 8057 + Ok(res) 8058 + }; 8059 + Box::pin(fut) 8060 + } 8061 + "/rockbox.v1alpha1.SoundService/SoundSet" => { 8062 + #[allow(non_camel_case_types)] 8063 + struct SoundSetSvc<T: SoundService>(pub Arc<T>); 8064 + impl< 8065 + T: SoundService, 8066 + > tonic::server::UnaryService<super::SoundSetRequest> 8067 + for SoundSetSvc<T> { 8068 + type Response = super::SoundSetResponse; 8069 + type Future = BoxFuture< 8070 + tonic::Response<Self::Response>, 8071 + tonic::Status, 8072 + >; 8073 + fn call( 8074 + &mut self, 8075 + request: tonic::Request<super::SoundSetRequest>, 8076 + ) -> Self::Future { 8077 + let inner = Arc::clone(&self.0); 8078 + let fut = async move { 8079 + <T as SoundService>::sound_set(&inner, request).await 8080 + }; 8081 + Box::pin(fut) 8082 + } 8083 + } 8084 + let accept_compression_encodings = self.accept_compression_encodings; 8085 + let send_compression_encodings = self.send_compression_encodings; 8086 + let max_decoding_message_size = self.max_decoding_message_size; 8087 + let max_encoding_message_size = self.max_encoding_message_size; 8088 + let inner = self.inner.clone(); 8089 + let fut = async move { 8090 + let method = SoundSetSvc(inner); 8091 + let codec = tonic::codec::ProstCodec::default(); 8092 + let mut grpc = tonic::server::Grpc::new(codec) 8093 + .apply_compression_config( 8094 + accept_compression_encodings, 8095 + send_compression_encodings, 8096 + ) 8097 + .apply_max_message_size_config( 8098 + max_decoding_message_size, 8099 + max_encoding_message_size, 8100 + ); 8101 + let res = grpc.unary(method, req).await; 8102 + Ok(res) 8103 + }; 8104 + Box::pin(fut) 8105 + } 8106 + "/rockbox.v1alpha1.SoundService/SoundCurrent" => { 8107 + #[allow(non_camel_case_types)] 8108 + struct SoundCurrentSvc<T: SoundService>(pub Arc<T>); 8109 + impl< 8110 + T: SoundService, 8111 + > tonic::server::UnaryService<super::SoundCurrentRequest> 8112 + for SoundCurrentSvc<T> { 8113 + type Response = super::SoundCurrentResponse; 8114 + type Future = BoxFuture< 8115 + tonic::Response<Self::Response>, 8116 + tonic::Status, 8117 + >; 8118 + fn call( 8119 + &mut self, 8120 + request: tonic::Request<super::SoundCurrentRequest>, 8121 + ) -> Self::Future { 8122 + let inner = Arc::clone(&self.0); 8123 + let fut = async move { 8124 + <T as SoundService>::sound_current(&inner, request).await 8125 + }; 8126 + Box::pin(fut) 8127 + } 8128 + } 8129 + let accept_compression_encodings = self.accept_compression_encodings; 8130 + let send_compression_encodings = self.send_compression_encodings; 8131 + let max_decoding_message_size = self.max_decoding_message_size; 8132 + let max_encoding_message_size = self.max_encoding_message_size; 8133 + let inner = self.inner.clone(); 8134 + let fut = async move { 8135 + let method = SoundCurrentSvc(inner); 8136 + let codec = tonic::codec::ProstCodec::default(); 8137 + let mut grpc = tonic::server::Grpc::new(codec) 8138 + .apply_compression_config( 8139 + accept_compression_encodings, 8140 + send_compression_encodings, 8141 + ) 8142 + .apply_max_message_size_config( 8143 + max_decoding_message_size, 8144 + max_encoding_message_size, 8145 + ); 8146 + let res = grpc.unary(method, req).await; 8147 + Ok(res) 8148 + }; 8149 + Box::pin(fut) 8150 + } 8151 + "/rockbox.v1alpha1.SoundService/SoundDefault" => { 8152 + #[allow(non_camel_case_types)] 8153 + struct SoundDefaultSvc<T: SoundService>(pub Arc<T>); 8154 + impl< 8155 + T: SoundService, 8156 + > tonic::server::UnaryService<super::SoundDefaultRequest> 8157 + for SoundDefaultSvc<T> { 8158 + type Response = super::SoundDefaultResponse; 8159 + type Future = BoxFuture< 8160 + tonic::Response<Self::Response>, 8161 + tonic::Status, 8162 + >; 8163 + fn call( 8164 + &mut self, 8165 + request: tonic::Request<super::SoundDefaultRequest>, 8166 + ) -> Self::Future { 8167 + let inner = Arc::clone(&self.0); 8168 + let fut = async move { 8169 + <T as SoundService>::sound_default(&inner, request).await 8170 + }; 8171 + Box::pin(fut) 8172 + } 8173 + } 8174 + let accept_compression_encodings = self.accept_compression_encodings; 8175 + let send_compression_encodings = self.send_compression_encodings; 8176 + let max_decoding_message_size = self.max_decoding_message_size; 8177 + let max_encoding_message_size = self.max_encoding_message_size; 8178 + let inner = self.inner.clone(); 8179 + let fut = async move { 8180 + let method = SoundDefaultSvc(inner); 8181 + let codec = tonic::codec::ProstCodec::default(); 8182 + let mut grpc = tonic::server::Grpc::new(codec) 8183 + .apply_compression_config( 8184 + accept_compression_encodings, 8185 + send_compression_encodings, 8186 + ) 8187 + .apply_max_message_size_config( 8188 + max_decoding_message_size, 8189 + max_encoding_message_size, 8190 + ); 8191 + let res = grpc.unary(method, req).await; 8192 + Ok(res) 8193 + }; 8194 + Box::pin(fut) 8195 + } 8196 + "/rockbox.v1alpha1.SoundService/SoundMin" => { 8197 + #[allow(non_camel_case_types)] 8198 + struct SoundMinSvc<T: SoundService>(pub Arc<T>); 8199 + impl< 8200 + T: SoundService, 8201 + > tonic::server::UnaryService<super::SoundMinRequest> 8202 + for SoundMinSvc<T> { 8203 + type Response = super::SoundMinResponse; 8204 + type Future = BoxFuture< 8205 + tonic::Response<Self::Response>, 8206 + tonic::Status, 8207 + >; 8208 + fn call( 8209 + &mut self, 8210 + request: tonic::Request<super::SoundMinRequest>, 8211 + ) -> Self::Future { 8212 + let inner = Arc::clone(&self.0); 8213 + let fut = async move { 8214 + <T as SoundService>::sound_min(&inner, request).await 8215 + }; 8216 + Box::pin(fut) 8217 + } 8218 + } 8219 + let accept_compression_encodings = self.accept_compression_encodings; 8220 + let send_compression_encodings = self.send_compression_encodings; 8221 + let max_decoding_message_size = self.max_decoding_message_size; 8222 + let max_encoding_message_size = self.max_encoding_message_size; 8223 + let inner = self.inner.clone(); 8224 + let fut = async move { 8225 + let method = SoundMinSvc(inner); 8226 + let codec = tonic::codec::ProstCodec::default(); 8227 + let mut grpc = tonic::server::Grpc::new(codec) 8228 + .apply_compression_config( 8229 + accept_compression_encodings, 8230 + send_compression_encodings, 8231 + ) 8232 + .apply_max_message_size_config( 8233 + max_decoding_message_size, 8234 + max_encoding_message_size, 8235 + ); 8236 + let res = grpc.unary(method, req).await; 8237 + Ok(res) 8238 + }; 8239 + Box::pin(fut) 8240 + } 8241 + "/rockbox.v1alpha1.SoundService/SoundMax" => { 8242 + #[allow(non_camel_case_types)] 8243 + struct SoundMaxSvc<T: SoundService>(pub Arc<T>); 8244 + impl< 8245 + T: SoundService, 8246 + > tonic::server::UnaryService<super::SoundMaxRequest> 8247 + for SoundMaxSvc<T> { 8248 + type Response = super::SoundMaxResponse; 8249 + type Future = BoxFuture< 8250 + tonic::Response<Self::Response>, 8251 + tonic::Status, 8252 + >; 8253 + fn call( 8254 + &mut self, 8255 + request: tonic::Request<super::SoundMaxRequest>, 8256 + ) -> Self::Future { 8257 + let inner = Arc::clone(&self.0); 8258 + let fut = async move { 8259 + <T as SoundService>::sound_max(&inner, request).await 8260 + }; 8261 + Box::pin(fut) 8262 + } 8263 + } 8264 + let accept_compression_encodings = self.accept_compression_encodings; 8265 + let send_compression_encodings = self.send_compression_encodings; 8266 + let max_decoding_message_size = self.max_decoding_message_size; 8267 + let max_encoding_message_size = self.max_encoding_message_size; 8268 + let inner = self.inner.clone(); 8269 + let fut = async move { 8270 + let method = SoundMaxSvc(inner); 8271 + let codec = tonic::codec::ProstCodec::default(); 8272 + let mut grpc = tonic::server::Grpc::new(codec) 8273 + .apply_compression_config( 8274 + accept_compression_encodings, 8275 + send_compression_encodings, 8276 + ) 8277 + .apply_max_message_size_config( 8278 + max_decoding_message_size, 8279 + max_encoding_message_size, 8280 + ); 8281 + let res = grpc.unary(method, req).await; 8282 + Ok(res) 8283 + }; 8284 + Box::pin(fut) 8285 + } 8286 + "/rockbox.v1alpha1.SoundService/SoundUnit" => { 8287 + #[allow(non_camel_case_types)] 8288 + struct SoundUnitSvc<T: SoundService>(pub Arc<T>); 8289 + impl< 8290 + T: SoundService, 8291 + > tonic::server::UnaryService<super::SoundUnitRequest> 8292 + for SoundUnitSvc<T> { 8293 + type Response = super::SoundUnitResponse; 8294 + type Future = BoxFuture< 8295 + tonic::Response<Self::Response>, 8296 + tonic::Status, 8297 + >; 8298 + fn call( 8299 + &mut self, 8300 + request: tonic::Request<super::SoundUnitRequest>, 8301 + ) -> Self::Future { 8302 + let inner = Arc::clone(&self.0); 8303 + let fut = async move { 8304 + <T as SoundService>::sound_unit(&inner, request).await 8305 + }; 8306 + Box::pin(fut) 8307 + } 8308 + } 8309 + let accept_compression_encodings = self.accept_compression_encodings; 8310 + let send_compression_encodings = self.send_compression_encodings; 8311 + let max_decoding_message_size = self.max_decoding_message_size; 8312 + let max_encoding_message_size = self.max_encoding_message_size; 8313 + let inner = self.inner.clone(); 8314 + let fut = async move { 8315 + let method = SoundUnitSvc(inner); 8316 + let codec = tonic::codec::ProstCodec::default(); 8317 + let mut grpc = tonic::server::Grpc::new(codec) 8318 + .apply_compression_config( 8319 + accept_compression_encodings, 8320 + send_compression_encodings, 8321 + ) 8322 + .apply_max_message_size_config( 8323 + max_decoding_message_size, 8324 + max_encoding_message_size, 8325 + ); 8326 + let res = grpc.unary(method, req).await; 8327 + Ok(res) 8328 + }; 8329 + Box::pin(fut) 8330 + } 8331 + "/rockbox.v1alpha1.SoundService/SoundVal2Phys" => { 8332 + #[allow(non_camel_case_types)] 8333 + struct SoundVal2PhysSvc<T: SoundService>(pub Arc<T>); 8334 + impl< 8335 + T: SoundService, 8336 + > tonic::server::UnaryService<super::SoundVal2PhysRequest> 8337 + for SoundVal2PhysSvc<T> { 8338 + type Response = super::SoundVal2PhysResponse; 8339 + type Future = BoxFuture< 8340 + tonic::Response<Self::Response>, 8341 + tonic::Status, 8342 + >; 8343 + fn call( 8344 + &mut self, 8345 + request: tonic::Request<super::SoundVal2PhysRequest>, 8346 + ) -> Self::Future { 8347 + let inner = Arc::clone(&self.0); 8348 + let fut = async move { 8349 + <T as SoundService>::sound_val2_phys(&inner, request).await 8350 + }; 8351 + Box::pin(fut) 8352 + } 8353 + } 8354 + let accept_compression_encodings = self.accept_compression_encodings; 8355 + let send_compression_encodings = self.send_compression_encodings; 8356 + let max_decoding_message_size = self.max_decoding_message_size; 8357 + let max_encoding_message_size = self.max_encoding_message_size; 8358 + let inner = self.inner.clone(); 8359 + let fut = async move { 8360 + let method = SoundVal2PhysSvc(inner); 8361 + let codec = tonic::codec::ProstCodec::default(); 8362 + let mut grpc = tonic::server::Grpc::new(codec) 8363 + .apply_compression_config( 8364 + accept_compression_encodings, 8365 + send_compression_encodings, 8366 + ) 8367 + .apply_max_message_size_config( 8368 + max_decoding_message_size, 8369 + max_encoding_message_size, 8370 + ); 8371 + let res = grpc.unary(method, req).await; 8372 + Ok(res) 8373 + }; 8374 + Box::pin(fut) 8375 + } 8376 + "/rockbox.v1alpha1.SoundService/GetPitch" => { 8377 + #[allow(non_camel_case_types)] 8378 + struct GetPitchSvc<T: SoundService>(pub Arc<T>); 8379 + impl< 8380 + T: SoundService, 8381 + > tonic::server::UnaryService<super::GetPitchRequest> 8382 + for GetPitchSvc<T> { 8383 + type Response = super::GetPitchResponse; 8384 + type Future = BoxFuture< 8385 + tonic::Response<Self::Response>, 8386 + tonic::Status, 8387 + >; 8388 + fn call( 8389 + &mut self, 8390 + request: tonic::Request<super::GetPitchRequest>, 8391 + ) -> Self::Future { 8392 + let inner = Arc::clone(&self.0); 8393 + let fut = async move { 8394 + <T as SoundService>::get_pitch(&inner, request).await 8395 + }; 8396 + Box::pin(fut) 8397 + } 8398 + } 8399 + let accept_compression_encodings = self.accept_compression_encodings; 8400 + let send_compression_encodings = self.send_compression_encodings; 8401 + let max_decoding_message_size = self.max_decoding_message_size; 8402 + let max_encoding_message_size = self.max_encoding_message_size; 8403 + let inner = self.inner.clone(); 8404 + let fut = async move { 8405 + let method = GetPitchSvc(inner); 8406 + let codec = tonic::codec::ProstCodec::default(); 8407 + let mut grpc = tonic::server::Grpc::new(codec) 8408 + .apply_compression_config( 8409 + accept_compression_encodings, 8410 + send_compression_encodings, 8411 + ) 8412 + .apply_max_message_size_config( 8413 + max_decoding_message_size, 8414 + max_encoding_message_size, 8415 + ); 8416 + let res = grpc.unary(method, req).await; 8417 + Ok(res) 8418 + }; 8419 + Box::pin(fut) 8420 + } 8421 + "/rockbox.v1alpha1.SoundService/SetPitch" => { 8422 + #[allow(non_camel_case_types)] 8423 + struct SetPitchSvc<T: SoundService>(pub Arc<T>); 8424 + impl< 8425 + T: SoundService, 8426 + > tonic::server::UnaryService<super::SetPitchRequest> 8427 + for SetPitchSvc<T> { 8428 + type Response = super::SetPitchResponse; 8429 + type Future = BoxFuture< 8430 + tonic::Response<Self::Response>, 8431 + tonic::Status, 8432 + >; 8433 + fn call( 8434 + &mut self, 8435 + request: tonic::Request<super::SetPitchRequest>, 8436 + ) -> Self::Future { 8437 + let inner = Arc::clone(&self.0); 8438 + let fut = async move { 8439 + <T as SoundService>::set_pitch(&inner, request).await 8440 + }; 8441 + Box::pin(fut) 8442 + } 8443 + } 8444 + let accept_compression_encodings = self.accept_compression_encodings; 8445 + let send_compression_encodings = self.send_compression_encodings; 8446 + let max_decoding_message_size = self.max_decoding_message_size; 8447 + let max_encoding_message_size = self.max_encoding_message_size; 8448 + let inner = self.inner.clone(); 8449 + let fut = async move { 8450 + let method = SetPitchSvc(inner); 8451 + let codec = tonic::codec::ProstCodec::default(); 8452 + let mut grpc = tonic::server::Grpc::new(codec) 8453 + .apply_compression_config( 8454 + accept_compression_encodings, 8455 + send_compression_encodings, 8456 + ) 8457 + .apply_max_message_size_config( 8458 + max_decoding_message_size, 8459 + max_encoding_message_size, 8460 + ); 8461 + let res = grpc.unary(method, req).await; 8462 + Ok(res) 8463 + }; 8464 + Box::pin(fut) 8465 + } 8466 + "/rockbox.v1alpha1.SoundService/BeepPlay" => { 8467 + #[allow(non_camel_case_types)] 8468 + struct BeepPlaySvc<T: SoundService>(pub Arc<T>); 8469 + impl< 8470 + T: SoundService, 8471 + > tonic::server::UnaryService<super::BeepPlayRequest> 8472 + for BeepPlaySvc<T> { 8473 + type Response = super::BeepPlayResponse; 8474 + type Future = BoxFuture< 8475 + tonic::Response<Self::Response>, 8476 + tonic::Status, 8477 + >; 8478 + fn call( 8479 + &mut self, 8480 + request: tonic::Request<super::BeepPlayRequest>, 8481 + ) -> Self::Future { 8482 + let inner = Arc::clone(&self.0); 8483 + let fut = async move { 8484 + <T as SoundService>::beep_play(&inner, request).await 8485 + }; 8486 + Box::pin(fut) 8487 + } 8488 + } 8489 + let accept_compression_encodings = self.accept_compression_encodings; 8490 + let send_compression_encodings = self.send_compression_encodings; 8491 + let max_decoding_message_size = self.max_decoding_message_size; 8492 + let max_encoding_message_size = self.max_encoding_message_size; 8493 + let inner = self.inner.clone(); 8494 + let fut = async move { 8495 + let method = BeepPlaySvc(inner); 8496 + let codec = tonic::codec::ProstCodec::default(); 8497 + let mut grpc = tonic::server::Grpc::new(codec) 8498 + .apply_compression_config( 8499 + accept_compression_encodings, 8500 + send_compression_encodings, 8501 + ) 8502 + .apply_max_message_size_config( 8503 + max_decoding_message_size, 8504 + max_encoding_message_size, 8505 + ); 8506 + let res = grpc.unary(method, req).await; 8507 + Ok(res) 8508 + }; 8509 + Box::pin(fut) 8510 + } 8511 + "/rockbox.v1alpha1.SoundService/PcmbufFade" => { 8512 + #[allow(non_camel_case_types)] 8513 + struct PcmbufFadeSvc<T: SoundService>(pub Arc<T>); 8514 + impl< 8515 + T: SoundService, 8516 + > tonic::server::UnaryService<super::PcmbufFadeRequest> 8517 + for PcmbufFadeSvc<T> { 8518 + type Response = super::PcmbufFadeResponse; 8519 + type Future = BoxFuture< 8520 + tonic::Response<Self::Response>, 8521 + tonic::Status, 8522 + >; 8523 + fn call( 8524 + &mut self, 8525 + request: tonic::Request<super::PcmbufFadeRequest>, 8526 + ) -> Self::Future { 8527 + let inner = Arc::clone(&self.0); 8528 + let fut = async move { 8529 + <T as SoundService>::pcmbuf_fade(&inner, request).await 8530 + }; 8531 + Box::pin(fut) 8532 + } 8533 + } 8534 + let accept_compression_encodings = self.accept_compression_encodings; 8535 + let send_compression_encodings = self.send_compression_encodings; 8536 + let max_decoding_message_size = self.max_decoding_message_size; 8537 + let max_encoding_message_size = self.max_encoding_message_size; 8538 + let inner = self.inner.clone(); 8539 + let fut = async move { 8540 + let method = PcmbufFadeSvc(inner); 8541 + let codec = tonic::codec::ProstCodec::default(); 8542 + let mut grpc = tonic::server::Grpc::new(codec) 8543 + .apply_compression_config( 8544 + accept_compression_encodings, 8545 + send_compression_encodings, 8546 + ) 8547 + .apply_max_message_size_config( 8548 + max_decoding_message_size, 8549 + max_encoding_message_size, 8550 + ); 8551 + let res = grpc.unary(method, req).await; 8552 + Ok(res) 8553 + }; 8554 + Box::pin(fut) 8555 + } 8556 + "/rockbox.v1alpha1.SoundService/PcmbufSetLowLatency" => { 8557 + #[allow(non_camel_case_types)] 8558 + struct PcmbufSetLowLatencySvc<T: SoundService>(pub Arc<T>); 8559 + impl< 8560 + T: SoundService, 8561 + > tonic::server::UnaryService<super::PcmbufSetLowLatencyRequest> 8562 + for PcmbufSetLowLatencySvc<T> { 8563 + type Response = super::PcmbufSetLowLatencyResponse; 8564 + type Future = BoxFuture< 8565 + tonic::Response<Self::Response>, 8566 + tonic::Status, 8567 + >; 8568 + fn call( 8569 + &mut self, 8570 + request: tonic::Request<super::PcmbufSetLowLatencyRequest>, 8571 + ) -> Self::Future { 8572 + let inner = Arc::clone(&self.0); 8573 + let fut = async move { 8574 + <T as SoundService>::pcmbuf_set_low_latency(&inner, request) 8575 + .await 8576 + }; 8577 + Box::pin(fut) 8578 + } 8579 + } 8580 + let accept_compression_encodings = self.accept_compression_encodings; 8581 + let send_compression_encodings = self.send_compression_encodings; 8582 + let max_decoding_message_size = self.max_decoding_message_size; 8583 + let max_encoding_message_size = self.max_encoding_message_size; 8584 + let inner = self.inner.clone(); 8585 + let fut = async move { 8586 + let method = PcmbufSetLowLatencySvc(inner); 8587 + let codec = tonic::codec::ProstCodec::default(); 8588 + let mut grpc = tonic::server::Grpc::new(codec) 8589 + .apply_compression_config( 8590 + accept_compression_encodings, 8591 + send_compression_encodings, 8592 + ) 8593 + .apply_max_message_size_config( 8594 + max_decoding_message_size, 8595 + max_encoding_message_size, 8596 + ); 8597 + let res = grpc.unary(method, req).await; 8598 + Ok(res) 8599 + }; 8600 + Box::pin(fut) 8601 + } 8602 + "/rockbox.v1alpha1.SoundService/SystemSoundPlay" => { 8603 + #[allow(non_camel_case_types)] 8604 + struct SystemSoundPlaySvc<T: SoundService>(pub Arc<T>); 8605 + impl< 8606 + T: SoundService, 8607 + > tonic::server::UnaryService<super::SystemSoundPlayRequest> 8608 + for SystemSoundPlaySvc<T> { 8609 + type Response = super::SystemSoundPlayResponse; 8610 + type Future = BoxFuture< 8611 + tonic::Response<Self::Response>, 8612 + tonic::Status, 8613 + >; 8614 + fn call( 8615 + &mut self, 8616 + request: tonic::Request<super::SystemSoundPlayRequest>, 8617 + ) -> Self::Future { 8618 + let inner = Arc::clone(&self.0); 8619 + let fut = async move { 8620 + <T as SoundService>::system_sound_play(&inner, request) 8621 + .await 8622 + }; 8623 + Box::pin(fut) 8624 + } 8625 + } 8626 + let accept_compression_encodings = self.accept_compression_encodings; 8627 + let send_compression_encodings = self.send_compression_encodings; 8628 + let max_decoding_message_size = self.max_decoding_message_size; 8629 + let max_encoding_message_size = self.max_encoding_message_size; 8630 + let inner = self.inner.clone(); 8631 + let fut = async move { 8632 + let method = SystemSoundPlaySvc(inner); 8633 + let codec = tonic::codec::ProstCodec::default(); 8634 + let mut grpc = tonic::server::Grpc::new(codec) 8635 + .apply_compression_config( 8636 + accept_compression_encodings, 8637 + send_compression_encodings, 8638 + ) 8639 + .apply_max_message_size_config( 8640 + max_decoding_message_size, 8641 + max_encoding_message_size, 8642 + ); 8643 + let res = grpc.unary(method, req).await; 8644 + Ok(res) 8645 + }; 8646 + Box::pin(fut) 8647 + } 8648 + "/rockbox.v1alpha1.SoundService/KeyclickClick" => { 8649 + #[allow(non_camel_case_types)] 8650 + struct KeyclickClickSvc<T: SoundService>(pub Arc<T>); 8651 + impl< 8652 + T: SoundService, 8653 + > tonic::server::UnaryService<super::KeyclickClickRequest> 8654 + for KeyclickClickSvc<T> { 8655 + type Response = super::KeyclickClickResponse; 8656 + type Future = BoxFuture< 8657 + tonic::Response<Self::Response>, 8658 + tonic::Status, 8659 + >; 8660 + fn call( 8661 + &mut self, 8662 + request: tonic::Request<super::KeyclickClickRequest>, 8663 + ) -> Self::Future { 8664 + let inner = Arc::clone(&self.0); 8665 + let fut = async move { 8666 + <T as SoundService>::keyclick_click(&inner, request).await 8667 + }; 8668 + Box::pin(fut) 8669 + } 8670 + } 8671 + let accept_compression_encodings = self.accept_compression_encodings; 8672 + let send_compression_encodings = self.send_compression_encodings; 8673 + let max_decoding_message_size = self.max_decoding_message_size; 8674 + let max_encoding_message_size = self.max_encoding_message_size; 8675 + let inner = self.inner.clone(); 8676 + let fut = async move { 8677 + let method = KeyclickClickSvc(inner); 8678 + let codec = tonic::codec::ProstCodec::default(); 8679 + let mut grpc = tonic::server::Grpc::new(codec) 8680 + .apply_compression_config( 8681 + accept_compression_encodings, 8682 + send_compression_encodings, 8683 + ) 8684 + .apply_max_message_size_config( 8685 + max_decoding_message_size, 8686 + max_encoding_message_size, 8687 + ); 8688 + let res = grpc.unary(method, req).await; 8689 + Ok(res) 8690 + }; 8691 + Box::pin(fut) 8692 + } 8693 + _ => { 8694 + Box::pin(async move { 8695 + let mut response = http::Response::new(empty_body()); 8696 + let headers = response.headers_mut(); 8697 + headers 8698 + .insert( 8699 + tonic::Status::GRPC_STATUS, 8700 + (tonic::Code::Unimplemented as i32).into(), 8701 + ); 8702 + headers 8703 + .insert( 8704 + http::header::CONTENT_TYPE, 8705 + tonic::metadata::GRPC_CONTENT_TYPE, 8706 + ); 8707 + Ok(response) 8708 + }) 8709 + } 8710 + } 8711 + } 8712 + } 8713 + impl<T> Clone for SoundServiceServer<T> { 8714 + fn clone(&self) -> Self { 8715 + let inner = self.inner.clone(); 8716 + Self { 8717 + inner, 8718 + accept_compression_encodings: self.accept_compression_encodings, 8719 + send_compression_encodings: self.send_compression_encodings, 8720 + max_decoding_message_size: self.max_decoding_message_size, 8721 + max_encoding_message_size: self.max_encoding_message_size, 8722 + } 8723 + } 8724 + } 8725 + /// Generated gRPC service name 8726 + pub const SERVICE_NAME: &str = "rockbox.v1alpha1.SoundService"; 8727 + impl<T> tonic::server::NamedService for SoundServiceServer<T> { 8728 + const NAME: &'static str = SERVICE_NAME; 8729 + } 8730 + } 8731 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 8732 + pub struct GetRockboxVersionRequest {} 8733 + #[derive(Clone, PartialEq, ::prost::Message)] 8734 + pub struct GetRockboxVersionResponse { 8735 + #[prost(string, tag = "1")] 8736 + pub version: ::prost::alloc::string::String, 8737 + } 8738 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 8739 + pub struct GetGlobalStatusRequest {} 8740 + #[derive(Clone, Copy, PartialEq, ::prost::Message)] 8741 + pub struct GetGlobalStatusResponse { 8742 + #[prost(int32, tag = "1")] 8743 + pub resume_index: i32, 8744 + #[prost(uint32, tag = "2")] 8745 + pub resume_crc32: u32, 8746 + #[prost(uint32, tag = "3")] 8747 + pub resume_elapsed: u32, 8748 + #[prost(uint32, tag = "4")] 8749 + pub resume_offset: u32, 8750 + #[prost(int32, tag = "5")] 8751 + pub runtime: i32, 8752 + #[prost(int32, tag = "6")] 8753 + pub topruntime: i32, 8754 + #[prost(int32, tag = "7")] 8755 + pub dircache_size: i32, 8756 + #[prost(int32, tag = "8")] 8757 + pub last_screen: i32, 8758 + #[prost(int32, tag = "9")] 8759 + pub viewer_icon_count: i32, 8760 + #[prost(int32, tag = "10")] 8761 + pub last_volume_change: i32, 8762 + } 8763 + /// Generated client implementations. 8764 + pub mod system_service_client { 8765 + #![allow( 8766 + unused_variables, 8767 + dead_code, 8768 + missing_docs, 8769 + clippy::wildcard_imports, 8770 + clippy::let_unit_value, 8771 + )] 8772 + use tonic::codegen::*; 8773 + use tonic::codegen::http::Uri; 8774 + #[derive(Debug, Clone)] 8775 + pub struct SystemServiceClient<T> { 8776 + inner: tonic::client::Grpc<T>, 8777 + } 8778 + impl SystemServiceClient<tonic::transport::Channel> { 8779 + /// Attempt to create a new client by connecting to a given endpoint. 8780 + pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error> 8781 + where 8782 + D: TryInto<tonic::transport::Endpoint>, 8783 + D::Error: Into<StdError>, 8784 + { 8785 + let conn = tonic::transport::Endpoint::new(dst)?.connect().await?; 8786 + Ok(Self::new(conn)) 8787 + } 8788 + } 8789 + impl<T> SystemServiceClient<T> 8790 + where 8791 + T: tonic::client::GrpcService<tonic::body::BoxBody>, 8792 + T::Error: Into<StdError>, 8793 + T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static, 8794 + <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send, 8795 + { 8796 + pub fn new(inner: T) -> Self { 8797 + let inner = tonic::client::Grpc::new(inner); 8798 + Self { inner } 8799 + } 8800 + pub fn with_origin(inner: T, origin: Uri) -> Self { 8801 + let inner = tonic::client::Grpc::with_origin(inner, origin); 8802 + Self { inner } 8803 + } 8804 + pub fn with_interceptor<F>( 8805 + inner: T, 8806 + interceptor: F, 8807 + ) -> SystemServiceClient<InterceptedService<T, F>> 8808 + where 8809 + F: tonic::service::Interceptor, 8810 + T::ResponseBody: Default, 8811 + T: tonic::codegen::Service< 8812 + http::Request<tonic::body::BoxBody>, 8813 + Response = http::Response< 8814 + <T as tonic::client::GrpcService<tonic::body::BoxBody>>::ResponseBody, 8815 + >, 8816 + >, 8817 + <T as tonic::codegen::Service< 8818 + http::Request<tonic::body::BoxBody>, 8819 + >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync, 8820 + { 8821 + SystemServiceClient::new(InterceptedService::new(inner, interceptor)) 8822 + } 8823 + /// Compress requests with the given encoding. 8824 + /// 8825 + /// This requires the server to support it otherwise it might respond with an 8826 + /// error. 8827 + #[must_use] 8828 + pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { 8829 + self.inner = self.inner.send_compressed(encoding); 8830 + self 8831 + } 8832 + /// Enable decompressing responses. 8833 + #[must_use] 8834 + pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { 8835 + self.inner = self.inner.accept_compressed(encoding); 8836 + self 8837 + } 8838 + /// Limits the maximum size of a decoded message. 8839 + /// 8840 + /// Default: `4MB` 8841 + #[must_use] 8842 + pub fn max_decoding_message_size(mut self, limit: usize) -> Self { 8843 + self.inner = self.inner.max_decoding_message_size(limit); 8844 + self 8845 + } 8846 + /// Limits the maximum size of an encoded message. 8847 + /// 8848 + /// Default: `usize::MAX` 8849 + #[must_use] 8850 + pub fn max_encoding_message_size(mut self, limit: usize) -> Self { 8851 + self.inner = self.inner.max_encoding_message_size(limit); 8852 + self 8853 + } 8854 + pub async fn get_rockbox_version( 8855 + &mut self, 8856 + request: impl tonic::IntoRequest<super::GetRockboxVersionRequest>, 8857 + ) -> std::result::Result< 8858 + tonic::Response<super::GetRockboxVersionResponse>, 8859 + tonic::Status, 8860 + > { 8861 + self.inner 8862 + .ready() 8863 + .await 8864 + .map_err(|e| { 8865 + tonic::Status::unknown( 8866 + format!("Service was not ready: {}", e.into()), 8867 + ) 8868 + })?; 8869 + let codec = tonic::codec::ProstCodec::default(); 8870 + let path = http::uri::PathAndQuery::from_static( 8871 + "/rockbox.v1alpha1.SystemService/GetRockboxVersion", 8872 + ); 8873 + let mut req = request.into_request(); 8874 + req.extensions_mut() 8875 + .insert( 8876 + GrpcMethod::new( 8877 + "rockbox.v1alpha1.SystemService", 8878 + "GetRockboxVersion", 8879 + ), 8880 + ); 8881 + self.inner.unary(req, path, codec).await 8882 + } 8883 + pub async fn get_global_status( 8884 + &mut self, 8885 + request: impl tonic::IntoRequest<super::GetGlobalStatusRequest>, 8886 + ) -> std::result::Result< 8887 + tonic::Response<super::GetGlobalStatusResponse>, 8888 + tonic::Status, 8889 + > { 8890 + self.inner 8891 + .ready() 8892 + .await 8893 + .map_err(|e| { 8894 + tonic::Status::unknown( 8895 + format!("Service was not ready: {}", e.into()), 8896 + ) 8897 + })?; 8898 + let codec = tonic::codec::ProstCodec::default(); 8899 + let path = http::uri::PathAndQuery::from_static( 8900 + "/rockbox.v1alpha1.SystemService/GetGlobalStatus", 8901 + ); 8902 + let mut req = request.into_request(); 8903 + req.extensions_mut() 8904 + .insert( 8905 + GrpcMethod::new("rockbox.v1alpha1.SystemService", "GetGlobalStatus"), 8906 + ); 8907 + self.inner.unary(req, path, codec).await 8908 + } 8909 + } 8910 + } 8911 + /// Generated server implementations. 8912 + pub mod system_service_server { 8913 + #![allow( 8914 + unused_variables, 8915 + dead_code, 8916 + missing_docs, 8917 + clippy::wildcard_imports, 8918 + clippy::let_unit_value, 8919 + )] 8920 + use tonic::codegen::*; 8921 + /// Generated trait containing gRPC methods that should be implemented for use with SystemServiceServer. 8922 + #[async_trait] 8923 + pub trait SystemService: std::marker::Send + std::marker::Sync + 'static { 8924 + async fn get_rockbox_version( 8925 + &self, 8926 + request: tonic::Request<super::GetRockboxVersionRequest>, 8927 + ) -> std::result::Result< 8928 + tonic::Response<super::GetRockboxVersionResponse>, 8929 + tonic::Status, 8930 + >; 8931 + async fn get_global_status( 8932 + &self, 8933 + request: tonic::Request<super::GetGlobalStatusRequest>, 8934 + ) -> std::result::Result< 8935 + tonic::Response<super::GetGlobalStatusResponse>, 8936 + tonic::Status, 8937 + >; 8938 + } 8939 + #[derive(Debug)] 8940 + pub struct SystemServiceServer<T> { 8941 + inner: Arc<T>, 8942 + accept_compression_encodings: EnabledCompressionEncodings, 8943 + send_compression_encodings: EnabledCompressionEncodings, 8944 + max_decoding_message_size: Option<usize>, 8945 + max_encoding_message_size: Option<usize>, 8946 + } 8947 + impl<T> SystemServiceServer<T> { 8948 + pub fn new(inner: T) -> Self { 8949 + Self::from_arc(Arc::new(inner)) 8950 + } 8951 + pub fn from_arc(inner: Arc<T>) -> Self { 8952 + Self { 8953 + inner, 8954 + accept_compression_encodings: Default::default(), 8955 + send_compression_encodings: Default::default(), 8956 + max_decoding_message_size: None, 8957 + max_encoding_message_size: None, 8958 + } 8959 + } 8960 + pub fn with_interceptor<F>( 8961 + inner: T, 8962 + interceptor: F, 8963 + ) -> InterceptedService<Self, F> 8964 + where 8965 + F: tonic::service::Interceptor, 8966 + { 8967 + InterceptedService::new(Self::new(inner), interceptor) 8968 + } 8969 + /// Enable decompressing requests with the given encoding. 8970 + #[must_use] 8971 + pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { 8972 + self.accept_compression_encodings.enable(encoding); 8973 + self 8974 + } 8975 + /// Compress responses with the given encoding, if the client supports it. 8976 + #[must_use] 8977 + pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { 8978 + self.send_compression_encodings.enable(encoding); 8979 + self 8980 + } 8981 + /// Limits the maximum size of a decoded message. 8982 + /// 8983 + /// Default: `4MB` 8984 + #[must_use] 8985 + pub fn max_decoding_message_size(mut self, limit: usize) -> Self { 8986 + self.max_decoding_message_size = Some(limit); 8987 + self 8988 + } 8989 + /// Limits the maximum size of an encoded message. 8990 + /// 8991 + /// Default: `usize::MAX` 8992 + #[must_use] 8993 + pub fn max_encoding_message_size(mut self, limit: usize) -> Self { 8994 + self.max_encoding_message_size = Some(limit); 8995 + self 8996 + } 8997 + } 8998 + impl<T, B> tonic::codegen::Service<http::Request<B>> for SystemServiceServer<T> 8999 + where 9000 + T: SystemService, 9001 + B: Body + std::marker::Send + 'static, 9002 + B::Error: Into<StdError> + std::marker::Send + 'static, 9003 + { 9004 + type Response = http::Response<tonic::body::BoxBody>; 9005 + type Error = std::convert::Infallible; 9006 + type Future = BoxFuture<Self::Response, Self::Error>; 9007 + fn poll_ready( 9008 + &mut self, 9009 + _cx: &mut Context<'_>, 9010 + ) -> Poll<std::result::Result<(), Self::Error>> { 9011 + Poll::Ready(Ok(())) 9012 + } 9013 + fn call(&mut self, req: http::Request<B>) -> Self::Future { 9014 + match req.uri().path() { 9015 + "/rockbox.v1alpha1.SystemService/GetRockboxVersion" => { 9016 + #[allow(non_camel_case_types)] 9017 + struct GetRockboxVersionSvc<T: SystemService>(pub Arc<T>); 9018 + impl< 9019 + T: SystemService, 9020 + > tonic::server::UnaryService<super::GetRockboxVersionRequest> 9021 + for GetRockboxVersionSvc<T> { 9022 + type Response = super::GetRockboxVersionResponse; 9023 + type Future = BoxFuture< 9024 + tonic::Response<Self::Response>, 9025 + tonic::Status, 9026 + >; 9027 + fn call( 9028 + &mut self, 9029 + request: tonic::Request<super::GetRockboxVersionRequest>, 9030 + ) -> Self::Future { 9031 + let inner = Arc::clone(&self.0); 9032 + let fut = async move { 9033 + <T as SystemService>::get_rockbox_version(&inner, request) 9034 + .await 9035 + }; 9036 + Box::pin(fut) 9037 + } 9038 + } 9039 + let accept_compression_encodings = self.accept_compression_encodings; 9040 + let send_compression_encodings = self.send_compression_encodings; 9041 + let max_decoding_message_size = self.max_decoding_message_size; 9042 + let max_encoding_message_size = self.max_encoding_message_size; 9043 + let inner = self.inner.clone(); 9044 + let fut = async move { 9045 + let method = GetRockboxVersionSvc(inner); 9046 + let codec = tonic::codec::ProstCodec::default(); 9047 + let mut grpc = tonic::server::Grpc::new(codec) 9048 + .apply_compression_config( 9049 + accept_compression_encodings, 9050 + send_compression_encodings, 9051 + ) 9052 + .apply_max_message_size_config( 9053 + max_decoding_message_size, 9054 + max_encoding_message_size, 9055 + ); 9056 + let res = grpc.unary(method, req).await; 9057 + Ok(res) 9058 + }; 9059 + Box::pin(fut) 9060 + } 9061 + "/rockbox.v1alpha1.SystemService/GetGlobalStatus" => { 9062 + #[allow(non_camel_case_types)] 9063 + struct GetGlobalStatusSvc<T: SystemService>(pub Arc<T>); 9064 + impl< 9065 + T: SystemService, 9066 + > tonic::server::UnaryService<super::GetGlobalStatusRequest> 9067 + for GetGlobalStatusSvc<T> { 9068 + type Response = super::GetGlobalStatusResponse; 9069 + type Future = BoxFuture< 9070 + tonic::Response<Self::Response>, 9071 + tonic::Status, 9072 + >; 9073 + fn call( 9074 + &mut self, 9075 + request: tonic::Request<super::GetGlobalStatusRequest>, 9076 + ) -> Self::Future { 9077 + let inner = Arc::clone(&self.0); 9078 + let fut = async move { 9079 + <T as SystemService>::get_global_status(&inner, request) 9080 + .await 9081 + }; 9082 + Box::pin(fut) 9083 + } 9084 + } 9085 + let accept_compression_encodings = self.accept_compression_encodings; 9086 + let send_compression_encodings = self.send_compression_encodings; 9087 + let max_decoding_message_size = self.max_decoding_message_size; 9088 + let max_encoding_message_size = self.max_encoding_message_size; 9089 + let inner = self.inner.clone(); 9090 + let fut = async move { 9091 + let method = GetGlobalStatusSvc(inner); 9092 + let codec = tonic::codec::ProstCodec::default(); 9093 + let mut grpc = tonic::server::Grpc::new(codec) 9094 + .apply_compression_config( 9095 + accept_compression_encodings, 9096 + send_compression_encodings, 9097 + ) 9098 + .apply_max_message_size_config( 9099 + max_decoding_message_size, 9100 + max_encoding_message_size, 9101 + ); 9102 + let res = grpc.unary(method, req).await; 9103 + Ok(res) 9104 + }; 9105 + Box::pin(fut) 9106 + } 9107 + _ => { 9108 + Box::pin(async move { 9109 + let mut response = http::Response::new(empty_body()); 9110 + let headers = response.headers_mut(); 9111 + headers 9112 + .insert( 9113 + tonic::Status::GRPC_STATUS, 9114 + (tonic::Code::Unimplemented as i32).into(), 9115 + ); 9116 + headers 9117 + .insert( 9118 + http::header::CONTENT_TYPE, 9119 + tonic::metadata::GRPC_CONTENT_TYPE, 9120 + ); 9121 + Ok(response) 9122 + }) 9123 + } 9124 + } 9125 + } 9126 + } 9127 + impl<T> Clone for SystemServiceServer<T> { 9128 + fn clone(&self) -> Self { 9129 + let inner = self.inner.clone(); 9130 + Self { 9131 + inner, 9132 + accept_compression_encodings: self.accept_compression_encodings, 9133 + send_compression_encodings: self.send_compression_encodings, 9134 + max_decoding_message_size: self.max_decoding_message_size, 9135 + max_encoding_message_size: self.max_encoding_message_size, 9136 + } 9137 + } 9138 + } 9139 + /// Generated gRPC service name 9140 + pub const SERVICE_NAME: &str = "rockbox.v1alpha1.SystemService"; 9141 + impl<T> tonic::server::NamedService for SystemServiceServer<T> { 9142 + const NAME: &'static str = SERVICE_NAME; 9143 + } 9144 + }
crates/rocksky/src/api/rockbox_descriptor.bin

This is a binary file and will not be displayed.

+223
crates/rocksky/src/lib.rs
··· 1 1 use anyhow::Error; 2 + use api::rockbox::v1alpha1::playback_service_client::PlaybackServiceClient; 3 + use api::rockbox::v1alpha1::NextRequest; 4 + use api::rockbox::v1alpha1::PauseRequest; 5 + use api::rockbox::v1alpha1::PlayRequest; 6 + use api::rockbox::v1alpha1::PreviousRequest; 7 + use api::rockbox::v1alpha1::ResumeRequest; 8 + use api::rockbox::v1alpha1::StreamCurrentTrackRequest; 9 + use api::rockbox::v1alpha1::StreamStatusRequest; 10 + use futures_util::SinkExt; 11 + use futures_util::StreamExt; 2 12 use lofty::file::TaggedFileExt; 3 13 use reqwest::multipart; 4 14 use reqwest::Client; 5 15 use rockbox_library::entity::album::Album; 6 16 use rockbox_library::entity::track::Track; 17 + use serde_json::json; 18 + use serde_json::Value; 19 + use std::env; 7 20 use std::fs::File; 8 21 use std::io::Read; 22 + use std::sync::Arc; 23 + use std::thread; 24 + use tokio::sync::Mutex; 25 + use tokio_tungstenite::connect_async; 9 26 10 27 const AUDIO_EXTENSIONS: [&str; 18] = [ 11 28 "mp3", "ogg", "flac", "m4a", "aac", "mp4", "alac", "wav", "wv", "mpc", "aiff", "aif", "ac3", 12 29 "opus", "spx", "sid", "ape", "wma", 13 30 ]; 31 + 32 + // const ROCKSKY_WS: &str = "ws://localhost:8000/ws"; 33 + 34 + pub mod api { 35 + #[path = ""] 36 + pub mod rockbox { 37 + 38 + #[path = "rockbox.v1alpha1.rs"] 39 + pub mod v1alpha1; 40 + } 41 + } 42 + 43 + pub fn register_rockbox() -> Result<(), Error> { 44 + let home = dirs::home_dir().unwrap(); 45 + let token_file = home.join(".config").join("rockbox.org").join("token"); 46 + 47 + if !token_file.exists() { 48 + return Ok(()); 49 + } 50 + 51 + let token = std::fs::read_to_string(token_file)?; 52 + 53 + thread::spawn(move || { 54 + let rt = tokio::runtime::Runtime::new().unwrap(); 55 + rt.block_on(async { 56 + let device_id = Arc::new(Mutex::new(String::new())); 57 + let rocksky_ws = 58 + env::var("ROCKSKY_WS").unwrap_or_else(|_| "wss://api.rocksky.app/ws".to_string()); 59 + let (ws_stream, _) = connect_async(rocksky_ws).await?; 60 + println!("Handshake successful"); 61 + let (mut write, mut read) = ws_stream.split(); 62 + write 63 + .send( 64 + json!({ 65 + "type": "register", 66 + "clientName": "Rockbox", 67 + "token": token, 68 + }) 69 + .to_string() 70 + .into(), 71 + ) 72 + .await?; 73 + 74 + let (tx, mut rx) = tokio::sync::mpsc::channel::<String>(32); 75 + 76 + let tx_clone = tx.clone(); 77 + thread::spawn(move || { 78 + let rt = tokio::runtime::Runtime::new().unwrap(); 79 + rt.block_on(async { 80 + let host = env::var("ROCKBOX_HOST").unwrap_or_else(|_| "localhost".to_string()); 81 + let port = env::var("ROCKBOX_PORT").unwrap_or_else(|_| "6061".to_string()); 82 + 83 + let url = format!("tcp://{}:{}", host, port); 84 + let mut client = PlaybackServiceClient::connect(url).await?; 85 + let request = tonic::Request::new(StreamCurrentTrackRequest {}); 86 + 87 + let mut stream = client.stream_current_track(request).await?.into_inner(); 88 + while let Some(Ok(track)) = stream.next().await { 89 + tx_clone 90 + .send( 91 + json!( 92 + { 93 + "type": "track", 94 + "title": track.title, 95 + "artist": track.artist, 96 + "album_artist": track.album_artist, 97 + "album": track.album, 98 + "length": track.length, 99 + "elapsed": track.elapsed, 100 + "track_number": track.tracknum, 101 + "disc_number": track.discnum, 102 + "composer": track.composer, 103 + "album_art": track.album_art, 104 + } 105 + ) 106 + .to_string(), 107 + ) 108 + .await?; 109 + } 110 + 111 + Ok::<(), Error>(()) 112 + })?; 113 + 114 + Ok::<(), Error>(()) 115 + }); 116 + 117 + thread::spawn(move || { 118 + let rt = tokio::runtime::Runtime::new().unwrap(); 119 + rt.block_on(async { 120 + let host = env::var("ROCKBOX_HOST").unwrap_or_else(|_| "localhost".to_string()); 121 + let port = env::var("ROCKBOX_PORT").unwrap_or_else(|_| "6061".to_string()); 122 + 123 + let url = format!("tcp://{}:{}", host, port); 124 + let mut client = PlaybackServiceClient::connect(url).await?; 125 + let request = tonic::Request::new(StreamStatusRequest {}); 126 + 127 + let mut stream = client.stream_status(request).await?.into_inner(); 128 + while let Some(Ok(response)) = stream.next().await { 129 + tx.send( 130 + json!( 131 + { 132 + "type": "status", 133 + "status": response.status, 134 + } 135 + ) 136 + .to_string(), 137 + ) 138 + .await?; 139 + } 140 + 141 + Ok::<(), Error>(()) 142 + })?; 143 + 144 + Ok::<(), Error>(()) 145 + }); 146 + 147 + let device_id_clone = device_id.clone(); 148 + thread::spawn(move || { 149 + let rt = tokio::runtime::Runtime::new().unwrap(); 150 + rt.block_on(async { 151 + while let Some(msg) = rx.recv().await { 152 + let device_id = device_id_clone.lock().await; 153 + match write 154 + .send( 155 + json!({ 156 + "type": "message", 157 + "data": serde_json::from_str::<Value>(&msg).unwrap(), 158 + "device_id": *device_id, 159 + "token": token, 160 + }) 161 + .to_string() 162 + .into(), 163 + ) 164 + .await 165 + { 166 + Ok(_) => {} 167 + Err(e) => { 168 + eprintln!("Failed to send message: {}", e); 169 + } 170 + } 171 + } 172 + }) 173 + }); 174 + 175 + let host = env::var("ROCKBOX_HOST").unwrap_or_else(|_| "localhost".to_string()); 176 + let port = env::var("ROCKBOX_PORT").unwrap_or_else(|_| "6061".to_string()); 177 + let url = format!("tcp://{}:{}", host, port); 178 + let mut client = PlaybackServiceClient::connect(url).await?; 179 + 180 + while let Some(Ok(msg)) = read.next().await { 181 + let msg = msg.to_string(); 182 + let msg = serde_json::from_str::<Value>(&msg)?; 183 + if msg["deviceId"].is_string() { 184 + let mut device_id = device_id.lock().await; 185 + *device_id = msg["deviceId"].as_str().unwrap().to_string(); 186 + } 187 + 188 + if msg["type"].is_string() { 189 + if msg["type"].as_str().unwrap() == "command" { 190 + let command = msg["action"].as_str().unwrap(); 191 + match command { 192 + "play" => { 193 + let request = tonic::Request::new(ResumeRequest {}); 194 + client.resume(request).await?; 195 + } 196 + "pause" => { 197 + let request = tonic::Request::new(PauseRequest { 198 + ..Default::default() 199 + }); 200 + client.pause(request).await?; 201 + } 202 + "next" => { 203 + let request = tonic::Request::new(NextRequest { 204 + ..Default::default() 205 + }); 206 + client.next(request).await?; 207 + } 208 + "previous" => { 209 + let request = tonic::Request::new(PreviousRequest { 210 + ..Default::default() 211 + }); 212 + client.previous(request).await?; 213 + } 214 + "seek" => { 215 + let position = msg["args"]["position"].as_i64().unwrap(); 216 + let request = tonic::Request::new(PlayRequest { 217 + offset: 0, 218 + elapsed: position, 219 + }); 220 + client.play(request).await?; 221 + } 222 + _ => { 223 + println!("Unknown command: {}", command); 224 + } 225 + } 226 + } 227 + } 228 + } 229 + 230 + Ok::<(), Error>(()) 231 + })?; 232 + Ok::<(), Error>(()) 233 + }); 234 + 235 + Ok(()) 236 + } 14 237 15 238 pub async fn upload_album_cover(name: &str) -> Result<(), Error> { 16 239 let home = dirs::home_dir().unwrap();
+3 -21
crates/rocksky/src/main.rs
··· 1 - use std::{thread, time::Duration}; 2 - 3 1 use anyhow::Error; 4 - use rockbox_library::repo; 5 - use rockbox_rocksky::save_track; 6 2 7 3 #[tokio::main] 8 4 async fn main() -> Result<(), Error> { 9 - let pool = rockbox_library::create_connection_pool().await?; 10 - let tracks = repo::track::all(pool.clone()).await?; 11 - println!("Tracks {}", tracks.len()); 12 - 13 - for (i, track) in tracks.iter().enumerate() { 14 - print!("{}/{} ", i + 1, tracks.len()); 15 - let album = repo::album::find(pool.clone(), &track.album_id).await?; 16 - let track_clone = track.clone(); 17 - let album = album.unwrap(); 18 - let album_clone = album.clone(); 19 - thread::spawn(move || { 20 - let rt = tokio::runtime::Runtime::new().unwrap(); 21 - rt.block_on(save_track(track_clone, album_clone)).unwrap(); 22 - }); 23 - thread::sleep(Duration::from_millis(500)); 5 + rockbox_rocksky::register_rockbox()?; 6 + loop { 7 + tokio::time::sleep(tokio::time::Duration::from_secs(1)).await; 24 8 } 25 - 26 - Ok(()) 27 9 }