Rockbox open source high quality audio player as a Music Player Daemon
mpris rockbox mpd libadwaita audio rust zig deno
2
fork

Configure Feed

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

Merge pull request #142 from tsirysndr/feat/pcm-airplay

Add AirPlay output sink and rockbox-airplay crate

authored by

Tsiry Sandratraina and committed by
GitHub
50f6e628 c8ec70d4

+6954 -2486
+180
CLAUDE.md
··· 1 + # CLAUDE.md — Rockbox Zig 2 + 3 + ## Project overview 4 + 5 + Rockbox Zig is a modern wrapper around the [Rockbox](https://www.rockbox.org) open-source audio player firmware. It adds Rust/Zig services on top of the C firmware to expose gRPC, GraphQL, HTTP, and MPD APIs, a Typesense-backed search engine, Chromecast/AirPlay/Snapcast output sinks, and a desktop/web UI. 6 + 7 + The binary is called **`rockboxd`**. It is a single executable built by Zig that links: 8 + - The Rockbox C firmware (compiled by Make into `build-lib/libfirmware.a` and friends) 9 + - Rust crates (compiled by Cargo into `target/release/librockbox_cli.a` and `librockbox_server.a`) 10 + - SDL2 for audio/event handling on the host platform 11 + 12 + ## Repository layout 13 + 14 + ``` 15 + firmware/ Rockbox C firmware (audio engine, codecs, DSP) 16 + apps/ Rockbox application layer (playlist, database, plugins) 17 + lib/ Codec libraries (rbcodec, fixedpoint, skin_parser, tlsf) 18 + build-lib/ Out-of-tree Make build directory (generated; do not edit) 19 + crates/ Rust workspace 20 + airplay/ ALAC encoder + RAOP/RTP sender (AirPlay 1 output) 21 + cli/ Entry point compiled to librockbox_cli.a (staticlib) 22 + server/ gRPC / HTTP server 23 + settings/ load_settings() — reads settings.toml, applies sinks 24 + sys/ FFI bindings to the C firmware (unsafe extern "C") 25 + library/ Audio file scanning and SQLite library management 26 + typesense/ Typesense client for fast music search 27 + netstream/ HTTP streaming (Range-request based fd multiplexing) 28 + chromecast/ Chromecast output 29 + rpc/ gRPC definitions / generated code 30 + graphql/ GraphQL schema and resolvers 31 + mpd/ MPD protocol server 32 + mpris/ MPRIS D-Bus integration 33 + tracklist/ Playlist / tracklist management 34 + types/ Shared Rust types 35 + traits/ Shared Rust traits 36 + zig/ Zig build script and thin main.zig entry point 37 + ``` 38 + 39 + ## Build system 40 + 41 + ### Step 1 — C firmware (Make) 42 + ```sh 43 + cd build-lib 44 + make lib # builds libfirmware.a, librockbox.a, codec libs 45 + ``` 46 + The `build-lib/` directory was pre-configured via Rockbox's `tools/configure` for the `sdlapp` target. Do **not** run `configure` again unless you know what you're doing — it regenerates the Makefile and overwrites any local edits. 47 + 48 + ### Step 2 — Rust crates (Cargo) 49 + ```sh 50 + cargo build --release -p rockbox-cli # produces target/release/librockbox_cli.a 51 + cargo build --release -p rockbox-server # produces target/release/librockbox_server.a 52 + ``` 53 + Both crates have `crate-type = ["staticlib"]`. All transitive rlib dependencies are bundled into the `.a`. 54 + 55 + ### Step 3 — Zig linker 56 + ```sh 57 + cd zig 58 + zig build # links everything into zig-out/bin/rockboxd 59 + ``` 60 + 61 + ### Quick full rebuild 62 + ```sh 63 + cd build-lib && make lib && cd .. 64 + cargo build --release -p rockbox-cli -p rockbox-server 65 + cd zig && zig build 66 + ``` 67 + 68 + ### Critical: stale binary pitfall 69 + `zig build` only re-links if the `.a` files are newer than the binary. After changing C code, always run `make lib` first. After changing Rust code, run `cargo build --release`. If behavior doesn't match the code, check timestamps: 70 + ```sh 71 + ls -la zig/zig-out/bin/rockboxd build-lib/libfirmware.a target/release/librockbox_cli.a 72 + ``` 73 + 74 + ## Runtime configuration 75 + 76 + Settings file: `~/.config/rockbox.org/settings.toml` 77 + 78 + ```toml 79 + music_dir = "/path/to/Music" 80 + 81 + # Audio output — pick one: 82 + audio_output = "builtin" # SDL audio (default) 83 + 84 + audio_output = "fifo" 85 + fifo_path = "/tmp/snapfifo" # named FIFO for Snapcast; use "-" for stdout 86 + 87 + audio_output = "airplay" 88 + airplay_host = "192.168.1.x" # RAOP receiver IP 89 + airplay_port = 5000 # optional, default 5000 90 + ``` 91 + 92 + ## PCM sink architecture 93 + 94 + The audio output abstraction lives in `firmware/export/pcm_sink.h`. Each sink implements `struct pcm_sink_ops` (init / postinit / set_freq / lock / unlock / play / stop). 95 + 96 + | Enum constant | Value | Implementation file | 97 + |--------------------|-------|---------------------------------------------| 98 + | `PCM_SINK_BUILTIN` | 0 | `firmware/target/hosted/sdl/pcm-sdl.c` | 99 + | `PCM_SINK_FIFO` | 1 | `firmware/target/hosted/pcm-fifo.c` | 100 + | `PCM_SINK_AIRPLAY` | 2 | `firmware/target/hosted/pcm-airplay.c` | 101 + 102 + `crates/settings/src/lib.rs:load_settings()` reads `audio_output` and calls `pcm::switch_sink()`. 103 + 104 + Rust constants + helpers live in `crates/sys/src/sound/pcm.rs`. 105 + 106 + ### FIFO sink (Snapcast) 107 + - Pre-creates the named FIFO with `O_RDWR|O_NONBLOCK` in `pcm_fifo_set_path()` then clears `O_NONBLOCK`, so a permanent writer reference is held — readers never see premature EOF between tracks. 108 + - `sink_dma_stop()` does NOT close the fd; it stays open across track transitions. 109 + - **Startup order matters**: rockboxd must start before snapserver. If snapserver opens the FIFO first it may get EOF and stop reading. 110 + - On macOS, snapserver v0.35.0 ignores the `-s` sample-format CLI flag; use `/usr/local/etc/snapserver.conf`: 111 + ```ini 112 + [stream] 113 + source = pipe:///tmp/snapfifo?name=default&sampleformat=44100:16:2 114 + ``` 115 + 116 + ### AirPlay sink (RAOP) 117 + - `crates/airplay/` implements the full RAOP stack in pure Rust (no tokio needed). 118 + - `alac.rs` — ALAC escape/verbatim frame encoder: 352 stereo S16LE samples → 1411-byte bitstream 119 + - `rtp.rs` — RTP/UDP packet sender; RTCP NTP sync packets sent every ~44 frames 120 + - `rtsp.rs` — synchronous RTSP client: ANNOUNCE (SDP) → SETUP → RECORD 121 + - `pcm_airplay_connect()` is called once per `sink_dma_start()` (idempotent if already connected). 122 + - The `rockbox-airplay` rlib must be force-included in `librockbox_cli.a` via the `use rockbox_airplay::_link_airplay as _` shim in `crates/cli/src/lib.rs`. 123 + 124 + ## Key cross-cutting concerns 125 + 126 + ### macOS SDL audio 127 + `SDL_InitSubSystem(SDL_INIT_AUDIO)` must be called explicitly on macOS because the SDL event thread (which normally does it) is `#ifndef __APPLE__`. This is done in `firmware/target/hosted/sdl/system-sdl.c` in the `#else` branch of the event-thread guard. 128 + 129 + ### SIGTERM handling 130 + `system-hosted.c` installs a SIGTERM handler that loops forever (waits for SDL quit event). `crates/cli/src/lib.rs` overrides SIGTERM/SIGINT with a handler that kills the typesense child and calls `_exit(0)`. 131 + 132 + ### Typesense subprocess 133 + Spawned in `crates/cli/src/lib.rs` with `Stdio::piped()`. stdout/stderr lines are forwarded to `tracing::debug!`/`tracing::warn!` in background threads, keeping the PCM stdout stream clean in FIFO mode. 134 + 135 + ### Logging — use `tracing`, never `eprintln!`/`println!` 136 + All Rust logging must use the `tracing` crate (`tracing::debug!`, `tracing::info!`, `tracing::warn!`, `tracing::error!`). **Never use `eprintln!` or `println!` for diagnostic output** in Rust code — they bypass the structured log filter, pollute stdout (breaking FIFO/pipe mode), and can't be silenced at runtime. 137 + 138 + Severity guide: 139 + - `tracing::error!` — unrecoverable failures (connection refused, missing config) 140 + - `tracing::warn!` — recoverable issues (non-fatal fallbacks, unexpected-but-handled states) 141 + - `tracing::info!` — notable lifecycle events (session established, device paired) 142 + - `tracing::debug!` — per-packet/per-frame detail, protocol negotiation steps 143 + 144 + `tracing` is declared as a workspace dependency in the root `Cargo.toml`; add `tracing = { workspace = true }` to any crate that needs it. Control verbosity at runtime with `RUST_LOG`, e.g. `RUST_LOG=debug rockboxd` or `RUST_LOG=rockbox_airplay=debug,info`. 145 + 146 + ### HTTP streaming 147 + HTTP fds are encoded as values `<= STREAM_HTTP_FD_BASE (-1000)`. `stream_open/read/lseek/close` in `crates/netstream/` dispatch between HTTP and POSIX based on fd value. The global `STREAMS` map holds `Arc<Mutex<StreamState>>` per handle so concurrent reads don't serialize on a single lock. 148 + 149 + ## Adding a new PCM sink 150 + 151 + 1. Create `firmware/target/hosted/pcm-<name>.c` — model on `pcm-fifo.c`. 152 + 2. Add `PCM_SINK_<NAME>` to the enum in `firmware/export/pcm_sink.h`. 153 + 3. Register `&<name>_pcm_sink` in the `sinks[]` array in `firmware/pcm.c`. 154 + 4. Add `target/hosted/pcm-<name>.c` inside the `#if PLATFORM_HOSTED` block in `firmware/SOURCES`. 155 + 5. Add Rust constant `PCM_SINK_<NAME>: i32` in `crates/sys/src/sound/pcm.rs`. 156 + 6. Add a `set_<name>_*` wrapper if configuration is needed. 157 + 7. Handle in `crates/settings/src/lib.rs:load_settings()`. 158 + 8. If the sink has a Rust implementation in a new crate: add a `_link_<name>()` dummy fn and reference it from `crates/cli/src/lib.rs` to force inclusion in the staticlib. 159 + 160 + ## Useful commands 161 + 162 + ```sh 163 + # Run the daemon 164 + ./zig/zig-out/bin/rockboxd 165 + 166 + # Run with AirPlay debug logging 167 + RUST_LOG=debug ./zig/zig-out/bin/rockboxd 168 + 169 + # Test FIFO → stdout pipe 170 + ./zig/zig-out/bin/rockboxd | ffplay -f s16le -ar 44100 -ac 2 - 171 + 172 + # Check binary vs library timestamps 173 + ls -la zig/zig-out/bin/rockboxd build-lib/libfirmware.a target/release/librockbox_cli.a 174 + 175 + # Verify AirPlay symbols are present 176 + nm zig/zig-out/bin/rockboxd | grep pcm_airplay 177 + 178 + # Verify a crate is in the staticlib 179 + ar t target/release/librockbox_cli.a | grep airplay 180 + ```
+55 -1
Cargo.lock
··· 1609 1609 1610 1610 [[package]] 1611 1611 name = "chacha20" 1612 + version = "0.9.1" 1613 + source = "registry+https://github.com/rust-lang/crates.io-index" 1614 + checksum = "c3613f74bd2eac03dad61bd53dbe620703d4371614fe0bc3b9f04dd36fe4e818" 1615 + dependencies = [ 1616 + "cfg-if 1.0.0", 1617 + "cipher", 1618 + "cpufeatures 0.2.14", 1619 + ] 1620 + 1621 + [[package]] 1622 + name = "chacha20" 1612 1623 version = "0.10.0" 1613 1624 source = "registry+https://github.com/rust-lang/crates.io-index" 1614 1625 checksum = "6f8d983286843e49675a4b7a2d174efe136dc93a18d69130dd18198a6c167601" ··· 1616 1627 "cfg-if 1.0.0", 1617 1628 "cpufeatures 0.3.0", 1618 1629 "rand_core 0.10.1", 1630 + ] 1631 + 1632 + [[package]] 1633 + name = "chacha20poly1305" 1634 + version = "0.10.1" 1635 + source = "registry+https://github.com/rust-lang/crates.io-index" 1636 + checksum = "10cd79432192d1c0f4e1a0fef9527696cc039165d729fb41b3f4f4f354c2dc35" 1637 + dependencies = [ 1638 + "aead", 1639 + "chacha20 0.9.1", 1640 + "cipher", 1641 + "poly1305", 1642 + "zeroize", 1619 1643 ] 1620 1644 1621 1645 [[package]] ··· 1658 1682 dependencies = [ 1659 1683 "crypto-common 0.1.6", 1660 1684 "inout", 1685 + "zeroize", 1661 1686 ] 1662 1687 1663 1688 [[package]] ··· 8135 8160 ] 8136 8161 8137 8162 [[package]] 8163 + name = "poly1305" 8164 + version = "0.8.0" 8165 + source = "registry+https://github.com/rust-lang/crates.io-index" 8166 + checksum = "8159bd90725d2df49889a078b54f4f79e87f1f8a8444194cdca81d38f5393abf" 8167 + dependencies = [ 8168 + "cpufeatures 0.2.14", 8169 + "opaque-debug", 8170 + "universal-hash", 8171 + ] 8172 + 8173 + [[package]] 8138 8174 name = "polyval" 8139 8175 version = "0.6.2" 8140 8176 source = "registry+https://github.com/rust-lang/crates.io-index" ··· 8644 8680 source = "registry+https://github.com/rust-lang/crates.io-index" 8645 8681 checksum = "d2e8e8bcc7961af1fdac401278c6a831614941f6164ee3bf4ce61b7edb162207" 8646 8682 dependencies = [ 8647 - "chacha20", 8683 + "chacha20 0.10.0", 8648 8684 "getrandom 0.4.2", 8649 8685 "rand_core 0.10.1", 8650 8686 ] ··· 9080 9116 ] 9081 9117 9082 9118 [[package]] 9119 + name = "rockbox-airplay" 9120 + version = "0.1.0" 9121 + dependencies = [ 9122 + "chacha20poly1305", 9123 + "dirs 6.0.0", 9124 + "ed25519-dalek", 9125 + "hkdf", 9126 + "hmac", 9127 + "num-bigint", 9128 + "num-traits", 9129 + "rand 0.8.5", 9130 + "sha2", 9131 + "tracing", 9132 + "x25519-dalek", 9133 + ] 9134 + 9135 + [[package]] 9083 9136 name = "rockbox-chromecast" 9084 9137 version = "0.1.0" 9085 9138 dependencies = [ ··· 9106 9159 "dirs 6.0.0", 9107 9160 "libc", 9108 9161 "owo-colors 4.1.0", 9162 + "rockbox-airplay", 9109 9163 "rockbox-library", 9110 9164 "rockbox-rocksky", 9111 9165 "rockbox-settings",
+2506 -1240
cli/src/api/rockbox.v1alpha1.rs
··· 43 43 dead_code, 44 44 missing_docs, 45 45 clippy::wildcard_imports, 46 - clippy::let_unit_value 46 + clippy::let_unit_value, 47 47 )] 48 - use tonic::codegen::http::Uri; 49 48 use tonic::codegen::*; 49 + use tonic::codegen::http::Uri; 50 50 #[derive(Debug, Clone)] 51 51 pub struct BrowseServiceClient<T> { 52 52 inner: tonic::client::Grpc<T>, ··· 90 90 <T as tonic::client::GrpcService<tonic::body::BoxBody>>::ResponseBody, 91 91 >, 92 92 >, 93 - <T as tonic::codegen::Service<http::Request<tonic::body::BoxBody>>>::Error: 94 - Into<StdError> + std::marker::Send + std::marker::Sync, 93 + <T as tonic::codegen::Service< 94 + http::Request<tonic::body::BoxBody>, 95 + >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync, 95 96 { 96 97 BrowseServiceClient::new(InterceptedService::new(inner, interceptor)) 97 98 } ··· 129 130 pub async fn tree_get_entries( 130 131 &mut self, 131 132 request: impl tonic::IntoRequest<super::TreeGetEntriesRequest>, 132 - ) -> std::result::Result<tonic::Response<super::TreeGetEntriesResponse>, tonic::Status> 133 - { 134 - self.inner.ready().await.map_err(|e| { 135 - tonic::Status::unknown(format!("Service was not ready: {}", e.into())) 136 - })?; 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 + })?; 137 145 let codec = tonic::codec::ProstCodec::default(); 138 146 let path = http::uri::PathAndQuery::from_static( 139 147 "/rockbox.v1alpha1.BrowseService/TreeGetEntries", 140 148 ); 141 149 let mut req = request.into_request(); 142 - req.extensions_mut().insert(GrpcMethod::new( 143 - "rockbox.v1alpha1.BrowseService", 144 - "TreeGetEntries", 145 - )); 150 + req.extensions_mut() 151 + .insert( 152 + GrpcMethod::new("rockbox.v1alpha1.BrowseService", "TreeGetEntries"), 153 + ); 146 154 self.inner.unary(req, path, codec).await 147 155 } 148 156 } ··· 154 162 dead_code, 155 163 missing_docs, 156 164 clippy::wildcard_imports, 157 - clippy::let_unit_value 165 + clippy::let_unit_value, 158 166 )] 159 167 use tonic::codegen::*; 160 168 /// Generated trait containing gRPC methods that should be implemented for use with BrowseServiceServer. ··· 163 171 async fn tree_get_entries( 164 172 &self, 165 173 request: tonic::Request<super::TreeGetEntriesRequest>, 166 - ) -> std::result::Result<tonic::Response<super::TreeGetEntriesResponse>, tonic::Status>; 174 + ) -> std::result::Result< 175 + tonic::Response<super::TreeGetEntriesResponse>, 176 + tonic::Status, 177 + >; 167 178 } 168 179 #[derive(Debug)] 169 180 pub struct BrowseServiceServer<T> { ··· 186 197 max_encoding_message_size: None, 187 198 } 188 199 } 189 - pub fn with_interceptor<F>(inner: T, interceptor: F) -> InterceptedService<Self, F> 200 + pub fn with_interceptor<F>( 201 + inner: T, 202 + interceptor: F, 203 + ) -> InterceptedService<Self, F> 190 204 where 191 205 F: tonic::service::Interceptor, 192 206 { ··· 241 255 "/rockbox.v1alpha1.BrowseService/TreeGetEntries" => { 242 256 #[allow(non_camel_case_types)] 243 257 struct TreeGetEntriesSvc<T: BrowseService>(pub Arc<T>); 244 - impl<T: BrowseService> tonic::server::UnaryService<super::TreeGetEntriesRequest> 245 - for TreeGetEntriesSvc<T> 246 - { 258 + impl< 259 + T: BrowseService, 260 + > tonic::server::UnaryService<super::TreeGetEntriesRequest> 261 + for TreeGetEntriesSvc<T> { 247 262 type Response = super::TreeGetEntriesResponse; 248 - type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>; 263 + type Future = BoxFuture< 264 + tonic::Response<Self::Response>, 265 + tonic::Status, 266 + >; 249 267 fn call( 250 268 &mut self, 251 269 request: tonic::Request<super::TreeGetEntriesRequest>, 252 270 ) -> Self::Future { 253 271 let inner = Arc::clone(&self.0); 254 272 let fut = async move { 255 - <T as BrowseService>::tree_get_entries(&inner, request).await 273 + <T as BrowseService>::tree_get_entries(&inner, request) 274 + .await 256 275 }; 257 276 Box::pin(fut) 258 277 } ··· 279 298 }; 280 299 Box::pin(fut) 281 300 } 282 - _ => Box::pin(async move { 283 - let mut response = http::Response::new(empty_body()); 284 - let headers = response.headers_mut(); 285 - headers.insert( 286 - tonic::Status::GRPC_STATUS, 287 - (tonic::Code::Unimplemented as i32).into(), 288 - ); 289 - headers.insert( 290 - http::header::CONTENT_TYPE, 291 - tonic::metadata::GRPC_CONTENT_TYPE, 292 - ); 293 - Ok(response) 294 - }), 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 + } 295 318 } 296 319 } 297 320 } ··· 527 550 dead_code, 528 551 missing_docs, 529 552 clippy::wildcard_imports, 530 - clippy::let_unit_value 553 + clippy::let_unit_value, 531 554 )] 532 - use tonic::codegen::http::Uri; 533 555 use tonic::codegen::*; 556 + use tonic::codegen::http::Uri; 534 557 #[derive(Debug, Clone)] 535 558 pub struct LibraryServiceClient<T> { 536 559 inner: tonic::client::Grpc<T>, ··· 574 597 <T as tonic::client::GrpcService<tonic::body::BoxBody>>::ResponseBody, 575 598 >, 576 599 >, 577 - <T as tonic::codegen::Service<http::Request<tonic::body::BoxBody>>>::Error: 578 - Into<StdError> + std::marker::Send + std::marker::Sync, 600 + <T as tonic::codegen::Service< 601 + http::Request<tonic::body::BoxBody>, 602 + >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync, 579 603 { 580 604 LibraryServiceClient::new(InterceptedService::new(inner, interceptor)) 581 605 } ··· 613 637 pub async fn get_albums( 614 638 &mut self, 615 639 request: impl tonic::IntoRequest<super::GetAlbumsRequest>, 616 - ) -> std::result::Result<tonic::Response<super::GetAlbumsResponse>, tonic::Status> { 617 - self.inner.ready().await.map_err(|e| { 618 - tonic::Status::unknown(format!("Service was not ready: {}", e.into())) 619 - })?; 640 + ) -> std::result::Result< 641 + tonic::Response<super::GetAlbumsResponse>, 642 + tonic::Status, 643 + > { 644 + self.inner 645 + .ready() 646 + .await 647 + .map_err(|e| { 648 + tonic::Status::unknown( 649 + format!("Service was not ready: {}", e.into()), 650 + ) 651 + })?; 620 652 let codec = tonic::codec::ProstCodec::default(); 621 - let path = 622 - http::uri::PathAndQuery::from_static("/rockbox.v1alpha1.LibraryService/GetAlbums"); 653 + let path = http::uri::PathAndQuery::from_static( 654 + "/rockbox.v1alpha1.LibraryService/GetAlbums", 655 + ); 623 656 let mut req = request.into_request(); 624 - req.extensions_mut().insert(GrpcMethod::new( 625 - "rockbox.v1alpha1.LibraryService", 626 - "GetAlbums", 627 - )); 657 + req.extensions_mut() 658 + .insert(GrpcMethod::new("rockbox.v1alpha1.LibraryService", "GetAlbums")); 628 659 self.inner.unary(req, path, codec).await 629 660 } 630 661 pub async fn get_artists( 631 662 &mut self, 632 663 request: impl tonic::IntoRequest<super::GetArtistsRequest>, 633 - ) -> std::result::Result<tonic::Response<super::GetArtistsResponse>, tonic::Status> 634 - { 635 - self.inner.ready().await.map_err(|e| { 636 - tonic::Status::unknown(format!("Service was not ready: {}", e.into())) 637 - })?; 664 + ) -> std::result::Result< 665 + tonic::Response<super::GetArtistsResponse>, 666 + tonic::Status, 667 + > { 668 + self.inner 669 + .ready() 670 + .await 671 + .map_err(|e| { 672 + tonic::Status::unknown( 673 + format!("Service was not ready: {}", e.into()), 674 + ) 675 + })?; 638 676 let codec = tonic::codec::ProstCodec::default(); 639 - let path = 640 - http::uri::PathAndQuery::from_static("/rockbox.v1alpha1.LibraryService/GetArtists"); 677 + let path = http::uri::PathAndQuery::from_static( 678 + "/rockbox.v1alpha1.LibraryService/GetArtists", 679 + ); 641 680 let mut req = request.into_request(); 642 - req.extensions_mut().insert(GrpcMethod::new( 643 - "rockbox.v1alpha1.LibraryService", 644 - "GetArtists", 645 - )); 681 + req.extensions_mut() 682 + .insert( 683 + GrpcMethod::new("rockbox.v1alpha1.LibraryService", "GetArtists"), 684 + ); 646 685 self.inner.unary(req, path, codec).await 647 686 } 648 687 pub async fn get_tracks( 649 688 &mut self, 650 689 request: impl tonic::IntoRequest<super::GetTracksRequest>, 651 - ) -> std::result::Result<tonic::Response<super::GetTracksResponse>, tonic::Status> { 652 - self.inner.ready().await.map_err(|e| { 653 - tonic::Status::unknown(format!("Service was not ready: {}", e.into())) 654 - })?; 690 + ) -> std::result::Result< 691 + tonic::Response<super::GetTracksResponse>, 692 + tonic::Status, 693 + > { 694 + self.inner 695 + .ready() 696 + .await 697 + .map_err(|e| { 698 + tonic::Status::unknown( 699 + format!("Service was not ready: {}", e.into()), 700 + ) 701 + })?; 655 702 let codec = tonic::codec::ProstCodec::default(); 656 - let path = 657 - http::uri::PathAndQuery::from_static("/rockbox.v1alpha1.LibraryService/GetTracks"); 703 + let path = http::uri::PathAndQuery::from_static( 704 + "/rockbox.v1alpha1.LibraryService/GetTracks", 705 + ); 658 706 let mut req = request.into_request(); 659 - req.extensions_mut().insert(GrpcMethod::new( 660 - "rockbox.v1alpha1.LibraryService", 661 - "GetTracks", 662 - )); 707 + req.extensions_mut() 708 + .insert(GrpcMethod::new("rockbox.v1alpha1.LibraryService", "GetTracks")); 663 709 self.inner.unary(req, path, codec).await 664 710 } 665 711 pub async fn get_album( 666 712 &mut self, 667 713 request: impl tonic::IntoRequest<super::GetAlbumRequest>, 668 - ) -> std::result::Result<tonic::Response<super::GetAlbumResponse>, tonic::Status> { 669 - self.inner.ready().await.map_err(|e| { 670 - tonic::Status::unknown(format!("Service was not ready: {}", e.into())) 671 - })?; 714 + ) -> std::result::Result< 715 + tonic::Response<super::GetAlbumResponse>, 716 + tonic::Status, 717 + > { 718 + self.inner 719 + .ready() 720 + .await 721 + .map_err(|e| { 722 + tonic::Status::unknown( 723 + format!("Service was not ready: {}", e.into()), 724 + ) 725 + })?; 672 726 let codec = tonic::codec::ProstCodec::default(); 673 - let path = 674 - http::uri::PathAndQuery::from_static("/rockbox.v1alpha1.LibraryService/GetAlbum"); 727 + let path = http::uri::PathAndQuery::from_static( 728 + "/rockbox.v1alpha1.LibraryService/GetAlbum", 729 + ); 675 730 let mut req = request.into_request(); 676 - req.extensions_mut().insert(GrpcMethod::new( 677 - "rockbox.v1alpha1.LibraryService", 678 - "GetAlbum", 679 - )); 731 + req.extensions_mut() 732 + .insert(GrpcMethod::new("rockbox.v1alpha1.LibraryService", "GetAlbum")); 680 733 self.inner.unary(req, path, codec).await 681 734 } 682 735 pub async fn get_artist( 683 736 &mut self, 684 737 request: impl tonic::IntoRequest<super::GetArtistRequest>, 685 - ) -> std::result::Result<tonic::Response<super::GetArtistResponse>, tonic::Status> { 686 - self.inner.ready().await.map_err(|e| { 687 - tonic::Status::unknown(format!("Service was not ready: {}", e.into())) 688 - })?; 738 + ) -> std::result::Result< 739 + tonic::Response<super::GetArtistResponse>, 740 + tonic::Status, 741 + > { 742 + self.inner 743 + .ready() 744 + .await 745 + .map_err(|e| { 746 + tonic::Status::unknown( 747 + format!("Service was not ready: {}", e.into()), 748 + ) 749 + })?; 689 750 let codec = tonic::codec::ProstCodec::default(); 690 - let path = 691 - http::uri::PathAndQuery::from_static("/rockbox.v1alpha1.LibraryService/GetArtist"); 751 + let path = http::uri::PathAndQuery::from_static( 752 + "/rockbox.v1alpha1.LibraryService/GetArtist", 753 + ); 692 754 let mut req = request.into_request(); 693 - req.extensions_mut().insert(GrpcMethod::new( 694 - "rockbox.v1alpha1.LibraryService", 695 - "GetArtist", 696 - )); 755 + req.extensions_mut() 756 + .insert(GrpcMethod::new("rockbox.v1alpha1.LibraryService", "GetArtist")); 697 757 self.inner.unary(req, path, codec).await 698 758 } 699 759 pub async fn get_track( 700 760 &mut self, 701 761 request: impl tonic::IntoRequest<super::GetTrackRequest>, 702 - ) -> std::result::Result<tonic::Response<super::GetTrackResponse>, tonic::Status> { 703 - self.inner.ready().await.map_err(|e| { 704 - tonic::Status::unknown(format!("Service was not ready: {}", e.into())) 705 - })?; 762 + ) -> std::result::Result< 763 + tonic::Response<super::GetTrackResponse>, 764 + tonic::Status, 765 + > { 766 + self.inner 767 + .ready() 768 + .await 769 + .map_err(|e| { 770 + tonic::Status::unknown( 771 + format!("Service was not ready: {}", e.into()), 772 + ) 773 + })?; 706 774 let codec = tonic::codec::ProstCodec::default(); 707 - let path = 708 - http::uri::PathAndQuery::from_static("/rockbox.v1alpha1.LibraryService/GetTrack"); 775 + let path = http::uri::PathAndQuery::from_static( 776 + "/rockbox.v1alpha1.LibraryService/GetTrack", 777 + ); 709 778 let mut req = request.into_request(); 710 - req.extensions_mut().insert(GrpcMethod::new( 711 - "rockbox.v1alpha1.LibraryService", 712 - "GetTrack", 713 - )); 779 + req.extensions_mut() 780 + .insert(GrpcMethod::new("rockbox.v1alpha1.LibraryService", "GetTrack")); 714 781 self.inner.unary(req, path, codec).await 715 782 } 716 783 pub async fn like_track( 717 784 &mut self, 718 785 request: impl tonic::IntoRequest<super::LikeTrackRequest>, 719 - ) -> std::result::Result<tonic::Response<super::LikeTrackResponse>, tonic::Status> { 720 - self.inner.ready().await.map_err(|e| { 721 - tonic::Status::unknown(format!("Service was not ready: {}", e.into())) 722 - })?; 786 + ) -> std::result::Result< 787 + tonic::Response<super::LikeTrackResponse>, 788 + tonic::Status, 789 + > { 790 + self.inner 791 + .ready() 792 + .await 793 + .map_err(|e| { 794 + tonic::Status::unknown( 795 + format!("Service was not ready: {}", e.into()), 796 + ) 797 + })?; 723 798 let codec = tonic::codec::ProstCodec::default(); 724 - let path = 725 - http::uri::PathAndQuery::from_static("/rockbox.v1alpha1.LibraryService/LikeTrack"); 799 + let path = http::uri::PathAndQuery::from_static( 800 + "/rockbox.v1alpha1.LibraryService/LikeTrack", 801 + ); 726 802 let mut req = request.into_request(); 727 - req.extensions_mut().insert(GrpcMethod::new( 728 - "rockbox.v1alpha1.LibraryService", 729 - "LikeTrack", 730 - )); 803 + req.extensions_mut() 804 + .insert(GrpcMethod::new("rockbox.v1alpha1.LibraryService", "LikeTrack")); 731 805 self.inner.unary(req, path, codec).await 732 806 } 733 807 pub async fn unlike_track( 734 808 &mut self, 735 809 request: impl tonic::IntoRequest<super::UnlikeTrackRequest>, 736 - ) -> std::result::Result<tonic::Response<super::UnlikeTrackResponse>, tonic::Status> 737 - { 738 - self.inner.ready().await.map_err(|e| { 739 - tonic::Status::unknown(format!("Service was not ready: {}", e.into())) 740 - })?; 810 + ) -> std::result::Result< 811 + tonic::Response<super::UnlikeTrackResponse>, 812 + tonic::Status, 813 + > { 814 + self.inner 815 + .ready() 816 + .await 817 + .map_err(|e| { 818 + tonic::Status::unknown( 819 + format!("Service was not ready: {}", e.into()), 820 + ) 821 + })?; 741 822 let codec = tonic::codec::ProstCodec::default(); 742 823 let path = http::uri::PathAndQuery::from_static( 743 824 "/rockbox.v1alpha1.LibraryService/UnlikeTrack", 744 825 ); 745 826 let mut req = request.into_request(); 746 - req.extensions_mut().insert(GrpcMethod::new( 747 - "rockbox.v1alpha1.LibraryService", 748 - "UnlikeTrack", 749 - )); 827 + req.extensions_mut() 828 + .insert( 829 + GrpcMethod::new("rockbox.v1alpha1.LibraryService", "UnlikeTrack"), 830 + ); 750 831 self.inner.unary(req, path, codec).await 751 832 } 752 833 pub async fn like_album( 753 834 &mut self, 754 835 request: impl tonic::IntoRequest<super::LikeAlbumRequest>, 755 - ) -> std::result::Result<tonic::Response<super::LikeAlbumResponse>, tonic::Status> { 756 - self.inner.ready().await.map_err(|e| { 757 - tonic::Status::unknown(format!("Service was not ready: {}", e.into())) 758 - })?; 836 + ) -> std::result::Result< 837 + tonic::Response<super::LikeAlbumResponse>, 838 + tonic::Status, 839 + > { 840 + self.inner 841 + .ready() 842 + .await 843 + .map_err(|e| { 844 + tonic::Status::unknown( 845 + format!("Service was not ready: {}", e.into()), 846 + ) 847 + })?; 759 848 let codec = tonic::codec::ProstCodec::default(); 760 - let path = 761 - http::uri::PathAndQuery::from_static("/rockbox.v1alpha1.LibraryService/LikeAlbum"); 849 + let path = http::uri::PathAndQuery::from_static( 850 + "/rockbox.v1alpha1.LibraryService/LikeAlbum", 851 + ); 762 852 let mut req = request.into_request(); 763 - req.extensions_mut().insert(GrpcMethod::new( 764 - "rockbox.v1alpha1.LibraryService", 765 - "LikeAlbum", 766 - )); 853 + req.extensions_mut() 854 + .insert(GrpcMethod::new("rockbox.v1alpha1.LibraryService", "LikeAlbum")); 767 855 self.inner.unary(req, path, codec).await 768 856 } 769 857 pub async fn unlike_album( 770 858 &mut self, 771 859 request: impl tonic::IntoRequest<super::UnlikeAlbumRequest>, 772 - ) -> std::result::Result<tonic::Response<super::UnlikeAlbumResponse>, tonic::Status> 773 - { 774 - self.inner.ready().await.map_err(|e| { 775 - tonic::Status::unknown(format!("Service was not ready: {}", e.into())) 776 - })?; 860 + ) -> std::result::Result< 861 + tonic::Response<super::UnlikeAlbumResponse>, 862 + tonic::Status, 863 + > { 864 + self.inner 865 + .ready() 866 + .await 867 + .map_err(|e| { 868 + tonic::Status::unknown( 869 + format!("Service was not ready: {}", e.into()), 870 + ) 871 + })?; 777 872 let codec = tonic::codec::ProstCodec::default(); 778 873 let path = http::uri::PathAndQuery::from_static( 779 874 "/rockbox.v1alpha1.LibraryService/UnlikeAlbum", 780 875 ); 781 876 let mut req = request.into_request(); 782 - req.extensions_mut().insert(GrpcMethod::new( 783 - "rockbox.v1alpha1.LibraryService", 784 - "UnlikeAlbum", 785 - )); 877 + req.extensions_mut() 878 + .insert( 879 + GrpcMethod::new("rockbox.v1alpha1.LibraryService", "UnlikeAlbum"), 880 + ); 786 881 self.inner.unary(req, path, codec).await 787 882 } 788 883 pub async fn get_liked_tracks( 789 884 &mut self, 790 885 request: impl tonic::IntoRequest<super::GetLikedTracksRequest>, 791 - ) -> std::result::Result<tonic::Response<super::GetLikedTracksResponse>, tonic::Status> 792 - { 793 - self.inner.ready().await.map_err(|e| { 794 - tonic::Status::unknown(format!("Service was not ready: {}", e.into())) 795 - })?; 886 + ) -> std::result::Result< 887 + tonic::Response<super::GetLikedTracksResponse>, 888 + tonic::Status, 889 + > { 890 + self.inner 891 + .ready() 892 + .await 893 + .map_err(|e| { 894 + tonic::Status::unknown( 895 + format!("Service was not ready: {}", e.into()), 896 + ) 897 + })?; 796 898 let codec = tonic::codec::ProstCodec::default(); 797 899 let path = http::uri::PathAndQuery::from_static( 798 900 "/rockbox.v1alpha1.LibraryService/GetLikedTracks", 799 901 ); 800 902 let mut req = request.into_request(); 801 - req.extensions_mut().insert(GrpcMethod::new( 802 - "rockbox.v1alpha1.LibraryService", 803 - "GetLikedTracks", 804 - )); 903 + req.extensions_mut() 904 + .insert( 905 + GrpcMethod::new("rockbox.v1alpha1.LibraryService", "GetLikedTracks"), 906 + ); 805 907 self.inner.unary(req, path, codec).await 806 908 } 807 909 pub async fn get_liked_albums( 808 910 &mut self, 809 911 request: impl tonic::IntoRequest<super::GetLikedAlbumsRequest>, 810 - ) -> std::result::Result<tonic::Response<super::GetLikedAlbumsResponse>, tonic::Status> 811 - { 812 - self.inner.ready().await.map_err(|e| { 813 - tonic::Status::unknown(format!("Service was not ready: {}", e.into())) 814 - })?; 912 + ) -> std::result::Result< 913 + tonic::Response<super::GetLikedAlbumsResponse>, 914 + tonic::Status, 915 + > { 916 + self.inner 917 + .ready() 918 + .await 919 + .map_err(|e| { 920 + tonic::Status::unknown( 921 + format!("Service was not ready: {}", e.into()), 922 + ) 923 + })?; 815 924 let codec = tonic::codec::ProstCodec::default(); 816 925 let path = http::uri::PathAndQuery::from_static( 817 926 "/rockbox.v1alpha1.LibraryService/GetLikedAlbums", 818 927 ); 819 928 let mut req = request.into_request(); 820 - req.extensions_mut().insert(GrpcMethod::new( 821 - "rockbox.v1alpha1.LibraryService", 822 - "GetLikedAlbums", 823 - )); 929 + req.extensions_mut() 930 + .insert( 931 + GrpcMethod::new("rockbox.v1alpha1.LibraryService", "GetLikedAlbums"), 932 + ); 824 933 self.inner.unary(req, path, codec).await 825 934 } 826 935 pub async fn scan_library( 827 936 &mut self, 828 937 request: impl tonic::IntoRequest<super::ScanLibraryRequest>, 829 - ) -> std::result::Result<tonic::Response<super::ScanLibraryResponse>, tonic::Status> 830 - { 831 - self.inner.ready().await.map_err(|e| { 832 - tonic::Status::unknown(format!("Service was not ready: {}", e.into())) 833 - })?; 938 + ) -> std::result::Result< 939 + tonic::Response<super::ScanLibraryResponse>, 940 + tonic::Status, 941 + > { 942 + self.inner 943 + .ready() 944 + .await 945 + .map_err(|e| { 946 + tonic::Status::unknown( 947 + format!("Service was not ready: {}", e.into()), 948 + ) 949 + })?; 834 950 let codec = tonic::codec::ProstCodec::default(); 835 951 let path = http::uri::PathAndQuery::from_static( 836 952 "/rockbox.v1alpha1.LibraryService/ScanLibrary", 837 953 ); 838 954 let mut req = request.into_request(); 839 - req.extensions_mut().insert(GrpcMethod::new( 840 - "rockbox.v1alpha1.LibraryService", 841 - "ScanLibrary", 842 - )); 955 + req.extensions_mut() 956 + .insert( 957 + GrpcMethod::new("rockbox.v1alpha1.LibraryService", "ScanLibrary"), 958 + ); 843 959 self.inner.unary(req, path, codec).await 844 960 } 845 961 pub async fn search( 846 962 &mut self, 847 963 request: impl tonic::IntoRequest<super::SearchRequest>, 848 964 ) -> std::result::Result<tonic::Response<super::SearchResponse>, tonic::Status> { 849 - self.inner.ready().await.map_err(|e| { 850 - tonic::Status::unknown(format!("Service was not ready: {}", e.into())) 851 - })?; 965 + self.inner 966 + .ready() 967 + .await 968 + .map_err(|e| { 969 + tonic::Status::unknown( 970 + format!("Service was not ready: {}", e.into()), 971 + ) 972 + })?; 852 973 let codec = tonic::codec::ProstCodec::default(); 853 - let path = 854 - http::uri::PathAndQuery::from_static("/rockbox.v1alpha1.LibraryService/Search"); 974 + let path = http::uri::PathAndQuery::from_static( 975 + "/rockbox.v1alpha1.LibraryService/Search", 976 + ); 855 977 let mut req = request.into_request(); 856 978 req.extensions_mut() 857 979 .insert(GrpcMethod::new("rockbox.v1alpha1.LibraryService", "Search")); ··· 866 988 dead_code, 867 989 missing_docs, 868 990 clippy::wildcard_imports, 869 - clippy::let_unit_value 991 + clippy::let_unit_value, 870 992 )] 871 993 use tonic::codegen::*; 872 994 /// Generated trait containing gRPC methods that should be implemented for use with LibraryServiceServer. ··· 875 997 async fn get_albums( 876 998 &self, 877 999 request: tonic::Request<super::GetAlbumsRequest>, 878 - ) -> std::result::Result<tonic::Response<super::GetAlbumsResponse>, tonic::Status>; 1000 + ) -> std::result::Result< 1001 + tonic::Response<super::GetAlbumsResponse>, 1002 + tonic::Status, 1003 + >; 879 1004 async fn get_artists( 880 1005 &self, 881 1006 request: tonic::Request<super::GetArtistsRequest>, 882 - ) -> std::result::Result<tonic::Response<super::GetArtistsResponse>, tonic::Status>; 1007 + ) -> std::result::Result< 1008 + tonic::Response<super::GetArtistsResponse>, 1009 + tonic::Status, 1010 + >; 883 1011 async fn get_tracks( 884 1012 &self, 885 1013 request: tonic::Request<super::GetTracksRequest>, 886 - ) -> std::result::Result<tonic::Response<super::GetTracksResponse>, tonic::Status>; 1014 + ) -> std::result::Result< 1015 + tonic::Response<super::GetTracksResponse>, 1016 + tonic::Status, 1017 + >; 887 1018 async fn get_album( 888 1019 &self, 889 1020 request: tonic::Request<super::GetAlbumRequest>, 890 - ) -> std::result::Result<tonic::Response<super::GetAlbumResponse>, tonic::Status>; 1021 + ) -> std::result::Result< 1022 + tonic::Response<super::GetAlbumResponse>, 1023 + tonic::Status, 1024 + >; 891 1025 async fn get_artist( 892 1026 &self, 893 1027 request: tonic::Request<super::GetArtistRequest>, 894 - ) -> std::result::Result<tonic::Response<super::GetArtistResponse>, tonic::Status>; 1028 + ) -> std::result::Result< 1029 + tonic::Response<super::GetArtistResponse>, 1030 + tonic::Status, 1031 + >; 895 1032 async fn get_track( 896 1033 &self, 897 1034 request: tonic::Request<super::GetTrackRequest>, 898 - ) -> std::result::Result<tonic::Response<super::GetTrackResponse>, tonic::Status>; 1035 + ) -> std::result::Result< 1036 + tonic::Response<super::GetTrackResponse>, 1037 + tonic::Status, 1038 + >; 899 1039 async fn like_track( 900 1040 &self, 901 1041 request: tonic::Request<super::LikeTrackRequest>, 902 - ) -> std::result::Result<tonic::Response<super::LikeTrackResponse>, tonic::Status>; 1042 + ) -> std::result::Result< 1043 + tonic::Response<super::LikeTrackResponse>, 1044 + tonic::Status, 1045 + >; 903 1046 async fn unlike_track( 904 1047 &self, 905 1048 request: tonic::Request<super::UnlikeTrackRequest>, 906 - ) -> std::result::Result<tonic::Response<super::UnlikeTrackResponse>, tonic::Status>; 1049 + ) -> std::result::Result< 1050 + tonic::Response<super::UnlikeTrackResponse>, 1051 + tonic::Status, 1052 + >; 907 1053 async fn like_album( 908 1054 &self, 909 1055 request: tonic::Request<super::LikeAlbumRequest>, 910 - ) -> std::result::Result<tonic::Response<super::LikeAlbumResponse>, tonic::Status>; 1056 + ) -> std::result::Result< 1057 + tonic::Response<super::LikeAlbumResponse>, 1058 + tonic::Status, 1059 + >; 911 1060 async fn unlike_album( 912 1061 &self, 913 1062 request: tonic::Request<super::UnlikeAlbumRequest>, 914 - ) -> std::result::Result<tonic::Response<super::UnlikeAlbumResponse>, tonic::Status>; 1063 + ) -> std::result::Result< 1064 + tonic::Response<super::UnlikeAlbumResponse>, 1065 + tonic::Status, 1066 + >; 915 1067 async fn get_liked_tracks( 916 1068 &self, 917 1069 request: tonic::Request<super::GetLikedTracksRequest>, 918 - ) -> std::result::Result<tonic::Response<super::GetLikedTracksResponse>, tonic::Status>; 1070 + ) -> std::result::Result< 1071 + tonic::Response<super::GetLikedTracksResponse>, 1072 + tonic::Status, 1073 + >; 919 1074 async fn get_liked_albums( 920 1075 &self, 921 1076 request: tonic::Request<super::GetLikedAlbumsRequest>, 922 - ) -> std::result::Result<tonic::Response<super::GetLikedAlbumsResponse>, tonic::Status>; 1077 + ) -> std::result::Result< 1078 + tonic::Response<super::GetLikedAlbumsResponse>, 1079 + tonic::Status, 1080 + >; 923 1081 async fn scan_library( 924 1082 &self, 925 1083 request: tonic::Request<super::ScanLibraryRequest>, 926 - ) -> std::result::Result<tonic::Response<super::ScanLibraryResponse>, tonic::Status>; 1084 + ) -> std::result::Result< 1085 + tonic::Response<super::ScanLibraryResponse>, 1086 + tonic::Status, 1087 + >; 927 1088 async fn search( 928 1089 &self, 929 1090 request: tonic::Request<super::SearchRequest>, ··· 950 1111 max_encoding_message_size: None, 951 1112 } 952 1113 } 953 - pub fn with_interceptor<F>(inner: T, interceptor: F) -> InterceptedService<Self, F> 1114 + pub fn with_interceptor<F>( 1115 + inner: T, 1116 + interceptor: F, 1117 + ) -> InterceptedService<Self, F> 954 1118 where 955 1119 F: tonic::service::Interceptor, 956 1120 { ··· 1005 1169 "/rockbox.v1alpha1.LibraryService/GetAlbums" => { 1006 1170 #[allow(non_camel_case_types)] 1007 1171 struct GetAlbumsSvc<T: LibraryService>(pub Arc<T>); 1008 - impl<T: LibraryService> tonic::server::UnaryService<super::GetAlbumsRequest> for GetAlbumsSvc<T> { 1172 + impl< 1173 + T: LibraryService, 1174 + > tonic::server::UnaryService<super::GetAlbumsRequest> 1175 + for GetAlbumsSvc<T> { 1009 1176 type Response = super::GetAlbumsResponse; 1010 - type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>; 1177 + type Future = BoxFuture< 1178 + tonic::Response<Self::Response>, 1179 + tonic::Status, 1180 + >; 1011 1181 fn call( 1012 1182 &mut self, 1013 1183 request: tonic::Request<super::GetAlbumsRequest>, ··· 1044 1214 "/rockbox.v1alpha1.LibraryService/GetArtists" => { 1045 1215 #[allow(non_camel_case_types)] 1046 1216 struct GetArtistsSvc<T: LibraryService>(pub Arc<T>); 1047 - impl<T: LibraryService> tonic::server::UnaryService<super::GetArtistsRequest> for GetArtistsSvc<T> { 1217 + impl< 1218 + T: LibraryService, 1219 + > tonic::server::UnaryService<super::GetArtistsRequest> 1220 + for GetArtistsSvc<T> { 1048 1221 type Response = super::GetArtistsResponse; 1049 - type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>; 1222 + type Future = BoxFuture< 1223 + tonic::Response<Self::Response>, 1224 + tonic::Status, 1225 + >; 1050 1226 fn call( 1051 1227 &mut self, 1052 1228 request: tonic::Request<super::GetArtistsRequest>, ··· 1083 1259 "/rockbox.v1alpha1.LibraryService/GetTracks" => { 1084 1260 #[allow(non_camel_case_types)] 1085 1261 struct GetTracksSvc<T: LibraryService>(pub Arc<T>); 1086 - impl<T: LibraryService> tonic::server::UnaryService<super::GetTracksRequest> for GetTracksSvc<T> { 1262 + impl< 1263 + T: LibraryService, 1264 + > tonic::server::UnaryService<super::GetTracksRequest> 1265 + for GetTracksSvc<T> { 1087 1266 type Response = super::GetTracksResponse; 1088 - type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>; 1267 + type Future = BoxFuture< 1268 + tonic::Response<Self::Response>, 1269 + tonic::Status, 1270 + >; 1089 1271 fn call( 1090 1272 &mut self, 1091 1273 request: tonic::Request<super::GetTracksRequest>, ··· 1122 1304 "/rockbox.v1alpha1.LibraryService/GetAlbum" => { 1123 1305 #[allow(non_camel_case_types)] 1124 1306 struct GetAlbumSvc<T: LibraryService>(pub Arc<T>); 1125 - impl<T: LibraryService> tonic::server::UnaryService<super::GetAlbumRequest> for GetAlbumSvc<T> { 1307 + impl< 1308 + T: LibraryService, 1309 + > tonic::server::UnaryService<super::GetAlbumRequest> 1310 + for GetAlbumSvc<T> { 1126 1311 type Response = super::GetAlbumResponse; 1127 - type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>; 1312 + type Future = BoxFuture< 1313 + tonic::Response<Self::Response>, 1314 + tonic::Status, 1315 + >; 1128 1316 fn call( 1129 1317 &mut self, 1130 1318 request: tonic::Request<super::GetAlbumRequest>, ··· 1161 1349 "/rockbox.v1alpha1.LibraryService/GetArtist" => { 1162 1350 #[allow(non_camel_case_types)] 1163 1351 struct GetArtistSvc<T: LibraryService>(pub Arc<T>); 1164 - impl<T: LibraryService> tonic::server::UnaryService<super::GetArtistRequest> for GetArtistSvc<T> { 1352 + impl< 1353 + T: LibraryService, 1354 + > tonic::server::UnaryService<super::GetArtistRequest> 1355 + for GetArtistSvc<T> { 1165 1356 type Response = super::GetArtistResponse; 1166 - type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>; 1357 + type Future = BoxFuture< 1358 + tonic::Response<Self::Response>, 1359 + tonic::Status, 1360 + >; 1167 1361 fn call( 1168 1362 &mut self, 1169 1363 request: tonic::Request<super::GetArtistRequest>, ··· 1200 1394 "/rockbox.v1alpha1.LibraryService/GetTrack" => { 1201 1395 #[allow(non_camel_case_types)] 1202 1396 struct GetTrackSvc<T: LibraryService>(pub Arc<T>); 1203 - impl<T: LibraryService> tonic::server::UnaryService<super::GetTrackRequest> for GetTrackSvc<T> { 1397 + impl< 1398 + T: LibraryService, 1399 + > tonic::server::UnaryService<super::GetTrackRequest> 1400 + for GetTrackSvc<T> { 1204 1401 type Response = super::GetTrackResponse; 1205 - type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>; 1402 + type Future = BoxFuture< 1403 + tonic::Response<Self::Response>, 1404 + tonic::Status, 1405 + >; 1206 1406 fn call( 1207 1407 &mut self, 1208 1408 request: tonic::Request<super::GetTrackRequest>, ··· 1239 1439 "/rockbox.v1alpha1.LibraryService/LikeTrack" => { 1240 1440 #[allow(non_camel_case_types)] 1241 1441 struct LikeTrackSvc<T: LibraryService>(pub Arc<T>); 1242 - impl<T: LibraryService> tonic::server::UnaryService<super::LikeTrackRequest> for LikeTrackSvc<T> { 1442 + impl< 1443 + T: LibraryService, 1444 + > tonic::server::UnaryService<super::LikeTrackRequest> 1445 + for LikeTrackSvc<T> { 1243 1446 type Response = super::LikeTrackResponse; 1244 - type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>; 1447 + type Future = BoxFuture< 1448 + tonic::Response<Self::Response>, 1449 + tonic::Status, 1450 + >; 1245 1451 fn call( 1246 1452 &mut self, 1247 1453 request: tonic::Request<super::LikeTrackRequest>, ··· 1278 1484 "/rockbox.v1alpha1.LibraryService/UnlikeTrack" => { 1279 1485 #[allow(non_camel_case_types)] 1280 1486 struct UnlikeTrackSvc<T: LibraryService>(pub Arc<T>); 1281 - impl<T: LibraryService> tonic::server::UnaryService<super::UnlikeTrackRequest> 1282 - for UnlikeTrackSvc<T> 1283 - { 1487 + impl< 1488 + T: LibraryService, 1489 + > tonic::server::UnaryService<super::UnlikeTrackRequest> 1490 + for UnlikeTrackSvc<T> { 1284 1491 type Response = super::UnlikeTrackResponse; 1285 - type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>; 1492 + type Future = BoxFuture< 1493 + tonic::Response<Self::Response>, 1494 + tonic::Status, 1495 + >; 1286 1496 fn call( 1287 1497 &mut self, 1288 1498 request: tonic::Request<super::UnlikeTrackRequest>, ··· 1319 1529 "/rockbox.v1alpha1.LibraryService/LikeAlbum" => { 1320 1530 #[allow(non_camel_case_types)] 1321 1531 struct LikeAlbumSvc<T: LibraryService>(pub Arc<T>); 1322 - impl<T: LibraryService> tonic::server::UnaryService<super::LikeAlbumRequest> for LikeAlbumSvc<T> { 1532 + impl< 1533 + T: LibraryService, 1534 + > tonic::server::UnaryService<super::LikeAlbumRequest> 1535 + for LikeAlbumSvc<T> { 1323 1536 type Response = super::LikeAlbumResponse; 1324 - type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>; 1537 + type Future = BoxFuture< 1538 + tonic::Response<Self::Response>, 1539 + tonic::Status, 1540 + >; 1325 1541 fn call( 1326 1542 &mut self, 1327 1543 request: tonic::Request<super::LikeAlbumRequest>, ··· 1358 1574 "/rockbox.v1alpha1.LibraryService/UnlikeAlbum" => { 1359 1575 #[allow(non_camel_case_types)] 1360 1576 struct UnlikeAlbumSvc<T: LibraryService>(pub Arc<T>); 1361 - impl<T: LibraryService> tonic::server::UnaryService<super::UnlikeAlbumRequest> 1362 - for UnlikeAlbumSvc<T> 1363 - { 1577 + impl< 1578 + T: LibraryService, 1579 + > tonic::server::UnaryService<super::UnlikeAlbumRequest> 1580 + for UnlikeAlbumSvc<T> { 1364 1581 type Response = super::UnlikeAlbumResponse; 1365 - type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>; 1582 + type Future = BoxFuture< 1583 + tonic::Response<Self::Response>, 1584 + tonic::Status, 1585 + >; 1366 1586 fn call( 1367 1587 &mut self, 1368 1588 request: tonic::Request<super::UnlikeAlbumRequest>, ··· 1399 1619 "/rockbox.v1alpha1.LibraryService/GetLikedTracks" => { 1400 1620 #[allow(non_camel_case_types)] 1401 1621 struct GetLikedTracksSvc<T: LibraryService>(pub Arc<T>); 1402 - impl<T: LibraryService> 1403 - tonic::server::UnaryService<super::GetLikedTracksRequest> 1404 - for GetLikedTracksSvc<T> 1405 - { 1622 + impl< 1623 + T: LibraryService, 1624 + > tonic::server::UnaryService<super::GetLikedTracksRequest> 1625 + for GetLikedTracksSvc<T> { 1406 1626 type Response = super::GetLikedTracksResponse; 1407 - type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>; 1627 + type Future = BoxFuture< 1628 + tonic::Response<Self::Response>, 1629 + tonic::Status, 1630 + >; 1408 1631 fn call( 1409 1632 &mut self, 1410 1633 request: tonic::Request<super::GetLikedTracksRequest>, 1411 1634 ) -> Self::Future { 1412 1635 let inner = Arc::clone(&self.0); 1413 1636 let fut = async move { 1414 - <T as LibraryService>::get_liked_tracks(&inner, request).await 1637 + <T as LibraryService>::get_liked_tracks(&inner, request) 1638 + .await 1415 1639 }; 1416 1640 Box::pin(fut) 1417 1641 } ··· 1441 1665 "/rockbox.v1alpha1.LibraryService/GetLikedAlbums" => { 1442 1666 #[allow(non_camel_case_types)] 1443 1667 struct GetLikedAlbumsSvc<T: LibraryService>(pub Arc<T>); 1444 - impl<T: LibraryService> 1445 - tonic::server::UnaryService<super::GetLikedAlbumsRequest> 1446 - for GetLikedAlbumsSvc<T> 1447 - { 1668 + impl< 1669 + T: LibraryService, 1670 + > tonic::server::UnaryService<super::GetLikedAlbumsRequest> 1671 + for GetLikedAlbumsSvc<T> { 1448 1672 type Response = super::GetLikedAlbumsResponse; 1449 - type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>; 1673 + type Future = BoxFuture< 1674 + tonic::Response<Self::Response>, 1675 + tonic::Status, 1676 + >; 1450 1677 fn call( 1451 1678 &mut self, 1452 1679 request: tonic::Request<super::GetLikedAlbumsRequest>, 1453 1680 ) -> Self::Future { 1454 1681 let inner = Arc::clone(&self.0); 1455 1682 let fut = async move { 1456 - <T as LibraryService>::get_liked_albums(&inner, request).await 1683 + <T as LibraryService>::get_liked_albums(&inner, request) 1684 + .await 1457 1685 }; 1458 1686 Box::pin(fut) 1459 1687 } ··· 1483 1711 "/rockbox.v1alpha1.LibraryService/ScanLibrary" => { 1484 1712 #[allow(non_camel_case_types)] 1485 1713 struct ScanLibrarySvc<T: LibraryService>(pub Arc<T>); 1486 - impl<T: LibraryService> tonic::server::UnaryService<super::ScanLibraryRequest> 1487 - for ScanLibrarySvc<T> 1488 - { 1714 + impl< 1715 + T: LibraryService, 1716 + > tonic::server::UnaryService<super::ScanLibraryRequest> 1717 + for ScanLibrarySvc<T> { 1489 1718 type Response = super::ScanLibraryResponse; 1490 - type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>; 1719 + type Future = BoxFuture< 1720 + tonic::Response<Self::Response>, 1721 + tonic::Status, 1722 + >; 1491 1723 fn call( 1492 1724 &mut self, 1493 1725 request: tonic::Request<super::ScanLibraryRequest>, ··· 1524 1756 "/rockbox.v1alpha1.LibraryService/Search" => { 1525 1757 #[allow(non_camel_case_types)] 1526 1758 struct SearchSvc<T: LibraryService>(pub Arc<T>); 1527 - impl<T: LibraryService> tonic::server::UnaryService<super::SearchRequest> for SearchSvc<T> { 1759 + impl< 1760 + T: LibraryService, 1761 + > tonic::server::UnaryService<super::SearchRequest> 1762 + for SearchSvc<T> { 1528 1763 type Response = super::SearchResponse; 1529 - type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>; 1764 + type Future = BoxFuture< 1765 + tonic::Response<Self::Response>, 1766 + tonic::Status, 1767 + >; 1530 1768 fn call( 1531 1769 &mut self, 1532 1770 request: tonic::Request<super::SearchRequest>, 1533 1771 ) -> Self::Future { 1534 1772 let inner = Arc::clone(&self.0); 1535 - let fut = 1536 - async move { <T as LibraryService>::search(&inner, request).await }; 1773 + let fut = async move { 1774 + <T as LibraryService>::search(&inner, request).await 1775 + }; 1537 1776 Box::pin(fut) 1538 1777 } 1539 1778 } ··· 1559 1798 }; 1560 1799 Box::pin(fut) 1561 1800 } 1562 - _ => Box::pin(async move { 1563 - let mut response = http::Response::new(empty_body()); 1564 - let headers = response.headers_mut(); 1565 - headers.insert( 1566 - tonic::Status::GRPC_STATUS, 1567 - (tonic::Code::Unimplemented as i32).into(), 1568 - ); 1569 - headers.insert( 1570 - http::header::CONTENT_TYPE, 1571 - tonic::metadata::GRPC_CONTENT_TYPE, 1572 - ); 1573 - Ok(response) 1574 - }), 1801 + _ => { 1802 + Box::pin(async move { 1803 + let mut response = http::Response::new(empty_body()); 1804 + let headers = response.headers_mut(); 1805 + headers 1806 + .insert( 1807 + tonic::Status::GRPC_STATUS, 1808 + (tonic::Code::Unimplemented as i32).into(), 1809 + ); 1810 + headers 1811 + .insert( 1812 + http::header::CONTENT_TYPE, 1813 + tonic::metadata::GRPC_CONTENT_TYPE, 1814 + ); 1815 + Ok(response) 1816 + }) 1817 + } 1575 1818 } 1576 1819 } 1577 1820 } ··· 1600 1843 dead_code, 1601 1844 missing_docs, 1602 1845 clippy::wildcard_imports, 1603 - clippy::let_unit_value 1846 + clippy::let_unit_value, 1604 1847 )] 1605 - use tonic::codegen::http::Uri; 1606 1848 use tonic::codegen::*; 1849 + use tonic::codegen::http::Uri; 1607 1850 #[derive(Debug, Clone)] 1608 1851 pub struct MetadataServiceClient<T> { 1609 1852 inner: tonic::client::Grpc<T>, ··· 1647 1890 <T as tonic::client::GrpcService<tonic::body::BoxBody>>::ResponseBody, 1648 1891 >, 1649 1892 >, 1650 - <T as tonic::codegen::Service<http::Request<tonic::body::BoxBody>>>::Error: 1651 - Into<StdError> + std::marker::Send + std::marker::Sync, 1893 + <T as tonic::codegen::Service< 1894 + http::Request<tonic::body::BoxBody>, 1895 + >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync, 1652 1896 { 1653 1897 MetadataServiceClient::new(InterceptedService::new(inner, interceptor)) 1654 1898 } ··· 1692 1936 dead_code, 1693 1937 missing_docs, 1694 1938 clippy::wildcard_imports, 1695 - clippy::let_unit_value 1939 + clippy::let_unit_value, 1696 1940 )] 1697 1941 use tonic::codegen::*; 1698 1942 /// Generated trait containing gRPC methods that should be implemented for use with MetadataServiceServer. ··· 1719 1963 max_encoding_message_size: None, 1720 1964 } 1721 1965 } 1722 - pub fn with_interceptor<F>(inner: T, interceptor: F) -> InterceptedService<Self, F> 1966 + pub fn with_interceptor<F>( 1967 + inner: T, 1968 + interceptor: F, 1969 + ) -> InterceptedService<Self, F> 1723 1970 where 1724 1971 F: tonic::service::Interceptor, 1725 1972 { ··· 1771 2018 } 1772 2019 fn call(&mut self, req: http::Request<B>) -> Self::Future { 1773 2020 match req.uri().path() { 1774 - _ => Box::pin(async move { 1775 - let mut response = http::Response::new(empty_body()); 1776 - let headers = response.headers_mut(); 1777 - headers.insert( 1778 - tonic::Status::GRPC_STATUS, 1779 - (tonic::Code::Unimplemented as i32).into(), 1780 - ); 1781 - headers.insert( 1782 - http::header::CONTENT_TYPE, 1783 - tonic::metadata::GRPC_CONTENT_TYPE, 1784 - ); 1785 - Ok(response) 1786 - }), 2021 + _ => { 2022 + Box::pin(async move { 2023 + let mut response = http::Response::new(empty_body()); 2024 + let headers = response.headers_mut(); 2025 + headers 2026 + .insert( 2027 + tonic::Status::GRPC_STATUS, 2028 + (tonic::Code::Unimplemented as i32).into(), 2029 + ); 2030 + headers 2031 + .insert( 2032 + http::header::CONTENT_TYPE, 2033 + tonic::metadata::GRPC_CONTENT_TYPE, 2034 + ); 2035 + Ok(response) 2036 + }) 2037 + } 1787 2038 } 1788 2039 } 1789 2040 } ··· 2067 2318 dead_code, 2068 2319 missing_docs, 2069 2320 clippy::wildcard_imports, 2070 - clippy::let_unit_value 2321 + clippy::let_unit_value, 2071 2322 )] 2072 - use tonic::codegen::http::Uri; 2073 2323 use tonic::codegen::*; 2324 + use tonic::codegen::http::Uri; 2074 2325 #[derive(Debug, Clone)] 2075 2326 pub struct PlaybackServiceClient<T> { 2076 2327 inner: tonic::client::Grpc<T>, ··· 2114 2365 <T as tonic::client::GrpcService<tonic::body::BoxBody>>::ResponseBody, 2115 2366 >, 2116 2367 >, 2117 - <T as tonic::codegen::Service<http::Request<tonic::body::BoxBody>>>::Error: 2118 - Into<StdError> + std::marker::Send + std::marker::Sync, 2368 + <T as tonic::codegen::Service< 2369 + http::Request<tonic::body::BoxBody>, 2370 + >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync, 2119 2371 { 2120 2372 PlaybackServiceClient::new(InterceptedService::new(inner, interceptor)) 2121 2373 } ··· 2154 2406 &mut self, 2155 2407 request: impl tonic::IntoRequest<super::PlayRequest>, 2156 2408 ) -> std::result::Result<tonic::Response<super::PlayResponse>, tonic::Status> { 2157 - self.inner.ready().await.map_err(|e| { 2158 - tonic::Status::unknown(format!("Service was not ready: {}", e.into())) 2159 - })?; 2409 + self.inner 2410 + .ready() 2411 + .await 2412 + .map_err(|e| { 2413 + tonic::Status::unknown( 2414 + format!("Service was not ready: {}", e.into()), 2415 + ) 2416 + })?; 2160 2417 let codec = tonic::codec::ProstCodec::default(); 2161 - let path = 2162 - http::uri::PathAndQuery::from_static("/rockbox.v1alpha1.PlaybackService/Play"); 2418 + let path = http::uri::PathAndQuery::from_static( 2419 + "/rockbox.v1alpha1.PlaybackService/Play", 2420 + ); 2163 2421 let mut req = request.into_request(); 2164 2422 req.extensions_mut() 2165 2423 .insert(GrpcMethod::new("rockbox.v1alpha1.PlaybackService", "Play")); ··· 2169 2427 &mut self, 2170 2428 request: impl tonic::IntoRequest<super::PauseRequest>, 2171 2429 ) -> std::result::Result<tonic::Response<super::PauseResponse>, tonic::Status> { 2172 - self.inner.ready().await.map_err(|e| { 2173 - tonic::Status::unknown(format!("Service was not ready: {}", e.into())) 2174 - })?; 2430 + self.inner 2431 + .ready() 2432 + .await 2433 + .map_err(|e| { 2434 + tonic::Status::unknown( 2435 + format!("Service was not ready: {}", e.into()), 2436 + ) 2437 + })?; 2175 2438 let codec = tonic::codec::ProstCodec::default(); 2176 - let path = 2177 - http::uri::PathAndQuery::from_static("/rockbox.v1alpha1.PlaybackService/Pause"); 2439 + let path = http::uri::PathAndQuery::from_static( 2440 + "/rockbox.v1alpha1.PlaybackService/Pause", 2441 + ); 2178 2442 let mut req = request.into_request(); 2179 2443 req.extensions_mut() 2180 2444 .insert(GrpcMethod::new("rockbox.v1alpha1.PlaybackService", "Pause")); ··· 2183 2447 pub async fn play_or_pause( 2184 2448 &mut self, 2185 2449 request: impl tonic::IntoRequest<super::PlayOrPauseRequest>, 2186 - ) -> std::result::Result<tonic::Response<super::PlayOrPauseResponse>, tonic::Status> 2187 - { 2188 - self.inner.ready().await.map_err(|e| { 2189 - tonic::Status::unknown(format!("Service was not ready: {}", e.into())) 2190 - })?; 2450 + ) -> std::result::Result< 2451 + tonic::Response<super::PlayOrPauseResponse>, 2452 + tonic::Status, 2453 + > { 2454 + self.inner 2455 + .ready() 2456 + .await 2457 + .map_err(|e| { 2458 + tonic::Status::unknown( 2459 + format!("Service was not ready: {}", e.into()), 2460 + ) 2461 + })?; 2191 2462 let codec = tonic::codec::ProstCodec::default(); 2192 2463 let path = http::uri::PathAndQuery::from_static( 2193 2464 "/rockbox.v1alpha1.PlaybackService/PlayOrPause", 2194 2465 ); 2195 2466 let mut req = request.into_request(); 2196 - req.extensions_mut().insert(GrpcMethod::new( 2197 - "rockbox.v1alpha1.PlaybackService", 2198 - "PlayOrPause", 2199 - )); 2467 + req.extensions_mut() 2468 + .insert( 2469 + GrpcMethod::new("rockbox.v1alpha1.PlaybackService", "PlayOrPause"), 2470 + ); 2200 2471 self.inner.unary(req, path, codec).await 2201 2472 } 2202 2473 pub async fn resume( 2203 2474 &mut self, 2204 2475 request: impl tonic::IntoRequest<super::ResumeRequest>, 2205 2476 ) -> std::result::Result<tonic::Response<super::ResumeResponse>, tonic::Status> { 2206 - self.inner.ready().await.map_err(|e| { 2207 - tonic::Status::unknown(format!("Service was not ready: {}", e.into())) 2208 - })?; 2477 + self.inner 2478 + .ready() 2479 + .await 2480 + .map_err(|e| { 2481 + tonic::Status::unknown( 2482 + format!("Service was not ready: {}", e.into()), 2483 + ) 2484 + })?; 2209 2485 let codec = tonic::codec::ProstCodec::default(); 2210 - let path = 2211 - http::uri::PathAndQuery::from_static("/rockbox.v1alpha1.PlaybackService/Resume"); 2486 + let path = http::uri::PathAndQuery::from_static( 2487 + "/rockbox.v1alpha1.PlaybackService/Resume", 2488 + ); 2212 2489 let mut req = request.into_request(); 2213 - req.extensions_mut().insert(GrpcMethod::new( 2214 - "rockbox.v1alpha1.PlaybackService", 2215 - "Resume", 2216 - )); 2490 + req.extensions_mut() 2491 + .insert(GrpcMethod::new("rockbox.v1alpha1.PlaybackService", "Resume")); 2217 2492 self.inner.unary(req, path, codec).await 2218 2493 } 2219 2494 pub async fn next( 2220 2495 &mut self, 2221 2496 request: impl tonic::IntoRequest<super::NextRequest>, 2222 2497 ) -> std::result::Result<tonic::Response<super::NextResponse>, tonic::Status> { 2223 - self.inner.ready().await.map_err(|e| { 2224 - tonic::Status::unknown(format!("Service was not ready: {}", e.into())) 2225 - })?; 2498 + self.inner 2499 + .ready() 2500 + .await 2501 + .map_err(|e| { 2502 + tonic::Status::unknown( 2503 + format!("Service was not ready: {}", e.into()), 2504 + ) 2505 + })?; 2226 2506 let codec = tonic::codec::ProstCodec::default(); 2227 - let path = 2228 - http::uri::PathAndQuery::from_static("/rockbox.v1alpha1.PlaybackService/Next"); 2507 + let path = http::uri::PathAndQuery::from_static( 2508 + "/rockbox.v1alpha1.PlaybackService/Next", 2509 + ); 2229 2510 let mut req = request.into_request(); 2230 2511 req.extensions_mut() 2231 2512 .insert(GrpcMethod::new("rockbox.v1alpha1.PlaybackService", "Next")); ··· 2234 2515 pub async fn previous( 2235 2516 &mut self, 2236 2517 request: impl tonic::IntoRequest<super::PreviousRequest>, 2237 - ) -> std::result::Result<tonic::Response<super::PreviousResponse>, tonic::Status> { 2238 - self.inner.ready().await.map_err(|e| { 2239 - tonic::Status::unknown(format!("Service was not ready: {}", e.into())) 2240 - })?; 2518 + ) -> std::result::Result< 2519 + tonic::Response<super::PreviousResponse>, 2520 + tonic::Status, 2521 + > { 2522 + self.inner 2523 + .ready() 2524 + .await 2525 + .map_err(|e| { 2526 + tonic::Status::unknown( 2527 + format!("Service was not ready: {}", e.into()), 2528 + ) 2529 + })?; 2241 2530 let codec = tonic::codec::ProstCodec::default(); 2242 - let path = 2243 - http::uri::PathAndQuery::from_static("/rockbox.v1alpha1.PlaybackService/Previous"); 2531 + let path = http::uri::PathAndQuery::from_static( 2532 + "/rockbox.v1alpha1.PlaybackService/Previous", 2533 + ); 2244 2534 let mut req = request.into_request(); 2245 - req.extensions_mut().insert(GrpcMethod::new( 2246 - "rockbox.v1alpha1.PlaybackService", 2247 - "Previous", 2248 - )); 2535 + req.extensions_mut() 2536 + .insert(GrpcMethod::new("rockbox.v1alpha1.PlaybackService", "Previous")); 2249 2537 self.inner.unary(req, path, codec).await 2250 2538 } 2251 2539 pub async fn fast_forward_rewind( 2252 2540 &mut self, 2253 2541 request: impl tonic::IntoRequest<super::FastForwardRewindRequest>, 2254 - ) -> std::result::Result<tonic::Response<super::FastForwardRewindResponse>, tonic::Status> 2255 - { 2256 - self.inner.ready().await.map_err(|e| { 2257 - tonic::Status::unknown(format!("Service was not ready: {}", e.into())) 2258 - })?; 2542 + ) -> std::result::Result< 2543 + tonic::Response<super::FastForwardRewindResponse>, 2544 + tonic::Status, 2545 + > { 2546 + self.inner 2547 + .ready() 2548 + .await 2549 + .map_err(|e| { 2550 + tonic::Status::unknown( 2551 + format!("Service was not ready: {}", e.into()), 2552 + ) 2553 + })?; 2259 2554 let codec = tonic::codec::ProstCodec::default(); 2260 2555 let path = http::uri::PathAndQuery::from_static( 2261 2556 "/rockbox.v1alpha1.PlaybackService/FastForwardRewind", 2262 2557 ); 2263 2558 let mut req = request.into_request(); 2264 - req.extensions_mut().insert(GrpcMethod::new( 2265 - "rockbox.v1alpha1.PlaybackService", 2266 - "FastForwardRewind", 2267 - )); 2559 + req.extensions_mut() 2560 + .insert( 2561 + GrpcMethod::new( 2562 + "rockbox.v1alpha1.PlaybackService", 2563 + "FastForwardRewind", 2564 + ), 2565 + ); 2268 2566 self.inner.unary(req, path, codec).await 2269 2567 } 2270 2568 pub async fn status( 2271 2569 &mut self, 2272 2570 request: impl tonic::IntoRequest<super::StatusRequest>, 2273 2571 ) -> std::result::Result<tonic::Response<super::StatusResponse>, tonic::Status> { 2274 - self.inner.ready().await.map_err(|e| { 2275 - tonic::Status::unknown(format!("Service was not ready: {}", e.into())) 2276 - })?; 2572 + self.inner 2573 + .ready() 2574 + .await 2575 + .map_err(|e| { 2576 + tonic::Status::unknown( 2577 + format!("Service was not ready: {}", e.into()), 2578 + ) 2579 + })?; 2277 2580 let codec = tonic::codec::ProstCodec::default(); 2278 - let path = 2279 - http::uri::PathAndQuery::from_static("/rockbox.v1alpha1.PlaybackService/Status"); 2581 + let path = http::uri::PathAndQuery::from_static( 2582 + "/rockbox.v1alpha1.PlaybackService/Status", 2583 + ); 2280 2584 let mut req = request.into_request(); 2281 - req.extensions_mut().insert(GrpcMethod::new( 2282 - "rockbox.v1alpha1.PlaybackService", 2283 - "Status", 2284 - )); 2585 + req.extensions_mut() 2586 + .insert(GrpcMethod::new("rockbox.v1alpha1.PlaybackService", "Status")); 2285 2587 self.inner.unary(req, path, codec).await 2286 2588 } 2287 2589 pub async fn current_track( 2288 2590 &mut self, 2289 2591 request: impl tonic::IntoRequest<super::CurrentTrackRequest>, 2290 - ) -> std::result::Result<tonic::Response<super::CurrentTrackResponse>, tonic::Status> 2291 - { 2292 - self.inner.ready().await.map_err(|e| { 2293 - tonic::Status::unknown(format!("Service was not ready: {}", e.into())) 2294 - })?; 2592 + ) -> std::result::Result< 2593 + tonic::Response<super::CurrentTrackResponse>, 2594 + tonic::Status, 2595 + > { 2596 + self.inner 2597 + .ready() 2598 + .await 2599 + .map_err(|e| { 2600 + tonic::Status::unknown( 2601 + format!("Service was not ready: {}", e.into()), 2602 + ) 2603 + })?; 2295 2604 let codec = tonic::codec::ProstCodec::default(); 2296 2605 let path = http::uri::PathAndQuery::from_static( 2297 2606 "/rockbox.v1alpha1.PlaybackService/CurrentTrack", 2298 2607 ); 2299 2608 let mut req = request.into_request(); 2300 - req.extensions_mut().insert(GrpcMethod::new( 2301 - "rockbox.v1alpha1.PlaybackService", 2302 - "CurrentTrack", 2303 - )); 2609 + req.extensions_mut() 2610 + .insert( 2611 + GrpcMethod::new("rockbox.v1alpha1.PlaybackService", "CurrentTrack"), 2612 + ); 2304 2613 self.inner.unary(req, path, codec).await 2305 2614 } 2306 2615 pub async fn next_track( 2307 2616 &mut self, 2308 2617 request: impl tonic::IntoRequest<super::NextTrackRequest>, 2309 - ) -> std::result::Result<tonic::Response<super::NextTrackResponse>, tonic::Status> { 2310 - self.inner.ready().await.map_err(|e| { 2311 - tonic::Status::unknown(format!("Service was not ready: {}", e.into())) 2312 - })?; 2618 + ) -> std::result::Result< 2619 + tonic::Response<super::NextTrackResponse>, 2620 + tonic::Status, 2621 + > { 2622 + self.inner 2623 + .ready() 2624 + .await 2625 + .map_err(|e| { 2626 + tonic::Status::unknown( 2627 + format!("Service was not ready: {}", e.into()), 2628 + ) 2629 + })?; 2313 2630 let codec = tonic::codec::ProstCodec::default(); 2314 - let path = 2315 - http::uri::PathAndQuery::from_static("/rockbox.v1alpha1.PlaybackService/NextTrack"); 2631 + let path = http::uri::PathAndQuery::from_static( 2632 + "/rockbox.v1alpha1.PlaybackService/NextTrack", 2633 + ); 2316 2634 let mut req = request.into_request(); 2317 - req.extensions_mut().insert(GrpcMethod::new( 2318 - "rockbox.v1alpha1.PlaybackService", 2319 - "NextTrack", 2320 - )); 2635 + req.extensions_mut() 2636 + .insert( 2637 + GrpcMethod::new("rockbox.v1alpha1.PlaybackService", "NextTrack"), 2638 + ); 2321 2639 self.inner.unary(req, path, codec).await 2322 2640 } 2323 2641 pub async fn flush_and_reload_tracks( 2324 2642 &mut self, 2325 2643 request: impl tonic::IntoRequest<super::FlushAndReloadTracksRequest>, 2326 - ) -> std::result::Result<tonic::Response<super::FlushAndReloadTracksResponse>, tonic::Status> 2327 - { 2328 - self.inner.ready().await.map_err(|e| { 2329 - tonic::Status::unknown(format!("Service was not ready: {}", e.into())) 2330 - })?; 2644 + ) -> std::result::Result< 2645 + tonic::Response<super::FlushAndReloadTracksResponse>, 2646 + tonic::Status, 2647 + > { 2648 + self.inner 2649 + .ready() 2650 + .await 2651 + .map_err(|e| { 2652 + tonic::Status::unknown( 2653 + format!("Service was not ready: {}", e.into()), 2654 + ) 2655 + })?; 2331 2656 let codec = tonic::codec::ProstCodec::default(); 2332 2657 let path = http::uri::PathAndQuery::from_static( 2333 2658 "/rockbox.v1alpha1.PlaybackService/FlushAndReloadTracks", 2334 2659 ); 2335 2660 let mut req = request.into_request(); 2336 - req.extensions_mut().insert(GrpcMethod::new( 2337 - "rockbox.v1alpha1.PlaybackService", 2338 - "FlushAndReloadTracks", 2339 - )); 2661 + req.extensions_mut() 2662 + .insert( 2663 + GrpcMethod::new( 2664 + "rockbox.v1alpha1.PlaybackService", 2665 + "FlushAndReloadTracks", 2666 + ), 2667 + ); 2340 2668 self.inner.unary(req, path, codec).await 2341 2669 } 2342 2670 pub async fn get_file_position( 2343 2671 &mut self, 2344 2672 request: impl tonic::IntoRequest<super::GetFilePositionRequest>, 2345 - ) -> std::result::Result<tonic::Response<super::GetFilePositionResponse>, tonic::Status> 2346 - { 2347 - self.inner.ready().await.map_err(|e| { 2348 - tonic::Status::unknown(format!("Service was not ready: {}", e.into())) 2349 - })?; 2673 + ) -> std::result::Result< 2674 + tonic::Response<super::GetFilePositionResponse>, 2675 + tonic::Status, 2676 + > { 2677 + self.inner 2678 + .ready() 2679 + .await 2680 + .map_err(|e| { 2681 + tonic::Status::unknown( 2682 + format!("Service was not ready: {}", e.into()), 2683 + ) 2684 + })?; 2350 2685 let codec = tonic::codec::ProstCodec::default(); 2351 2686 let path = http::uri::PathAndQuery::from_static( 2352 2687 "/rockbox.v1alpha1.PlaybackService/GetFilePosition", 2353 2688 ); 2354 2689 let mut req = request.into_request(); 2355 - req.extensions_mut().insert(GrpcMethod::new( 2356 - "rockbox.v1alpha1.PlaybackService", 2357 - "GetFilePosition", 2358 - )); 2690 + req.extensions_mut() 2691 + .insert( 2692 + GrpcMethod::new( 2693 + "rockbox.v1alpha1.PlaybackService", 2694 + "GetFilePosition", 2695 + ), 2696 + ); 2359 2697 self.inner.unary(req, path, codec).await 2360 2698 } 2361 2699 pub async fn hard_stop( 2362 2700 &mut self, 2363 2701 request: impl tonic::IntoRequest<super::HardStopRequest>, 2364 - ) -> std::result::Result<tonic::Response<super::HardStopResponse>, tonic::Status> { 2365 - self.inner.ready().await.map_err(|e| { 2366 - tonic::Status::unknown(format!("Service was not ready: {}", e.into())) 2367 - })?; 2702 + ) -> std::result::Result< 2703 + tonic::Response<super::HardStopResponse>, 2704 + tonic::Status, 2705 + > { 2706 + self.inner 2707 + .ready() 2708 + .await 2709 + .map_err(|e| { 2710 + tonic::Status::unknown( 2711 + format!("Service was not ready: {}", e.into()), 2712 + ) 2713 + })?; 2368 2714 let codec = tonic::codec::ProstCodec::default(); 2369 - let path = 2370 - http::uri::PathAndQuery::from_static("/rockbox.v1alpha1.PlaybackService/HardStop"); 2715 + let path = http::uri::PathAndQuery::from_static( 2716 + "/rockbox.v1alpha1.PlaybackService/HardStop", 2717 + ); 2371 2718 let mut req = request.into_request(); 2372 - req.extensions_mut().insert(GrpcMethod::new( 2373 - "rockbox.v1alpha1.PlaybackService", 2374 - "HardStop", 2375 - )); 2719 + req.extensions_mut() 2720 + .insert(GrpcMethod::new("rockbox.v1alpha1.PlaybackService", "HardStop")); 2376 2721 self.inner.unary(req, path, codec).await 2377 2722 } 2378 2723 pub async fn play_album( 2379 2724 &mut self, 2380 2725 request: impl tonic::IntoRequest<super::PlayAlbumRequest>, 2381 - ) -> std::result::Result<tonic::Response<super::PlayAlbumResponse>, tonic::Status> { 2382 - self.inner.ready().await.map_err(|e| { 2383 - tonic::Status::unknown(format!("Service was not ready: {}", e.into())) 2384 - })?; 2726 + ) -> std::result::Result< 2727 + tonic::Response<super::PlayAlbumResponse>, 2728 + tonic::Status, 2729 + > { 2730 + self.inner 2731 + .ready() 2732 + .await 2733 + .map_err(|e| { 2734 + tonic::Status::unknown( 2735 + format!("Service was not ready: {}", e.into()), 2736 + ) 2737 + })?; 2385 2738 let codec = tonic::codec::ProstCodec::default(); 2386 - let path = 2387 - http::uri::PathAndQuery::from_static("/rockbox.v1alpha1.PlaybackService/PlayAlbum"); 2739 + let path = http::uri::PathAndQuery::from_static( 2740 + "/rockbox.v1alpha1.PlaybackService/PlayAlbum", 2741 + ); 2388 2742 let mut req = request.into_request(); 2389 - req.extensions_mut().insert(GrpcMethod::new( 2390 - "rockbox.v1alpha1.PlaybackService", 2391 - "PlayAlbum", 2392 - )); 2743 + req.extensions_mut() 2744 + .insert( 2745 + GrpcMethod::new("rockbox.v1alpha1.PlaybackService", "PlayAlbum"), 2746 + ); 2393 2747 self.inner.unary(req, path, codec).await 2394 2748 } 2395 2749 pub async fn play_artist_tracks( 2396 2750 &mut self, 2397 2751 request: impl tonic::IntoRequest<super::PlayArtistTracksRequest>, 2398 - ) -> std::result::Result<tonic::Response<super::PlayArtistTracksResponse>, tonic::Status> 2399 - { 2400 - self.inner.ready().await.map_err(|e| { 2401 - tonic::Status::unknown(format!("Service was not ready: {}", e.into())) 2402 - })?; 2752 + ) -> std::result::Result< 2753 + tonic::Response<super::PlayArtistTracksResponse>, 2754 + tonic::Status, 2755 + > { 2756 + self.inner 2757 + .ready() 2758 + .await 2759 + .map_err(|e| { 2760 + tonic::Status::unknown( 2761 + format!("Service was not ready: {}", e.into()), 2762 + ) 2763 + })?; 2403 2764 let codec = tonic::codec::ProstCodec::default(); 2404 2765 let path = http::uri::PathAndQuery::from_static( 2405 2766 "/rockbox.v1alpha1.PlaybackService/PlayArtistTracks", 2406 2767 ); 2407 2768 let mut req = request.into_request(); 2408 - req.extensions_mut().insert(GrpcMethod::new( 2409 - "rockbox.v1alpha1.PlaybackService", 2410 - "PlayArtistTracks", 2411 - )); 2769 + req.extensions_mut() 2770 + .insert( 2771 + GrpcMethod::new( 2772 + "rockbox.v1alpha1.PlaybackService", 2773 + "PlayArtistTracks", 2774 + ), 2775 + ); 2412 2776 self.inner.unary(req, path, codec).await 2413 2777 } 2414 2778 pub async fn play_playlist( 2415 2779 &mut self, 2416 2780 request: impl tonic::IntoRequest<super::PlayPlaylistRequest>, 2417 - ) -> std::result::Result<tonic::Response<super::PlayPlaylistResponse>, tonic::Status> 2418 - { 2419 - self.inner.ready().await.map_err(|e| { 2420 - tonic::Status::unknown(format!("Service was not ready: {}", e.into())) 2421 - })?; 2781 + ) -> std::result::Result< 2782 + tonic::Response<super::PlayPlaylistResponse>, 2783 + tonic::Status, 2784 + > { 2785 + self.inner 2786 + .ready() 2787 + .await 2788 + .map_err(|e| { 2789 + tonic::Status::unknown( 2790 + format!("Service was not ready: {}", e.into()), 2791 + ) 2792 + })?; 2422 2793 let codec = tonic::codec::ProstCodec::default(); 2423 2794 let path = http::uri::PathAndQuery::from_static( 2424 2795 "/rockbox.v1alpha1.PlaybackService/PlayPlaylist", 2425 2796 ); 2426 2797 let mut req = request.into_request(); 2427 - req.extensions_mut().insert(GrpcMethod::new( 2428 - "rockbox.v1alpha1.PlaybackService", 2429 - "PlayPlaylist", 2430 - )); 2798 + req.extensions_mut() 2799 + .insert( 2800 + GrpcMethod::new("rockbox.v1alpha1.PlaybackService", "PlayPlaylist"), 2801 + ); 2431 2802 self.inner.unary(req, path, codec).await 2432 2803 } 2433 2804 pub async fn play_directory( 2434 2805 &mut self, 2435 2806 request: impl tonic::IntoRequest<super::PlayDirectoryRequest>, 2436 - ) -> std::result::Result<tonic::Response<super::PlayDirectoryResponse>, tonic::Status> 2437 - { 2438 - self.inner.ready().await.map_err(|e| { 2439 - tonic::Status::unknown(format!("Service was not ready: {}", e.into())) 2440 - })?; 2807 + ) -> std::result::Result< 2808 + tonic::Response<super::PlayDirectoryResponse>, 2809 + tonic::Status, 2810 + > { 2811 + self.inner 2812 + .ready() 2813 + .await 2814 + .map_err(|e| { 2815 + tonic::Status::unknown( 2816 + format!("Service was not ready: {}", e.into()), 2817 + ) 2818 + })?; 2441 2819 let codec = tonic::codec::ProstCodec::default(); 2442 2820 let path = http::uri::PathAndQuery::from_static( 2443 2821 "/rockbox.v1alpha1.PlaybackService/PlayDirectory", 2444 2822 ); 2445 2823 let mut req = request.into_request(); 2446 - req.extensions_mut().insert(GrpcMethod::new( 2447 - "rockbox.v1alpha1.PlaybackService", 2448 - "PlayDirectory", 2449 - )); 2824 + req.extensions_mut() 2825 + .insert( 2826 + GrpcMethod::new("rockbox.v1alpha1.PlaybackService", "PlayDirectory"), 2827 + ); 2450 2828 self.inner.unary(req, path, codec).await 2451 2829 } 2452 2830 pub async fn play_music_directory( 2453 2831 &mut self, 2454 2832 request: impl tonic::IntoRequest<super::PlayMusicDirectoryRequest>, 2455 - ) -> std::result::Result<tonic::Response<super::PlayMusicDirectoryResponse>, tonic::Status> 2456 - { 2457 - self.inner.ready().await.map_err(|e| { 2458 - tonic::Status::unknown(format!("Service was not ready: {}", e.into())) 2459 - })?; 2833 + ) -> std::result::Result< 2834 + tonic::Response<super::PlayMusicDirectoryResponse>, 2835 + tonic::Status, 2836 + > { 2837 + self.inner 2838 + .ready() 2839 + .await 2840 + .map_err(|e| { 2841 + tonic::Status::unknown( 2842 + format!("Service was not ready: {}", e.into()), 2843 + ) 2844 + })?; 2460 2845 let codec = tonic::codec::ProstCodec::default(); 2461 2846 let path = http::uri::PathAndQuery::from_static( 2462 2847 "/rockbox.v1alpha1.PlaybackService/PlayMusicDirectory", 2463 2848 ); 2464 2849 let mut req = request.into_request(); 2465 - req.extensions_mut().insert(GrpcMethod::new( 2466 - "rockbox.v1alpha1.PlaybackService", 2467 - "PlayMusicDirectory", 2468 - )); 2850 + req.extensions_mut() 2851 + .insert( 2852 + GrpcMethod::new( 2853 + "rockbox.v1alpha1.PlaybackService", 2854 + "PlayMusicDirectory", 2855 + ), 2856 + ); 2469 2857 self.inner.unary(req, path, codec).await 2470 2858 } 2471 2859 pub async fn play_track( 2472 2860 &mut self, 2473 2861 request: impl tonic::IntoRequest<super::PlayTrackRequest>, 2474 - ) -> std::result::Result<tonic::Response<super::PlayTrackResponse>, tonic::Status> { 2475 - self.inner.ready().await.map_err(|e| { 2476 - tonic::Status::unknown(format!("Service was not ready: {}", e.into())) 2477 - })?; 2862 + ) -> std::result::Result< 2863 + tonic::Response<super::PlayTrackResponse>, 2864 + tonic::Status, 2865 + > { 2866 + self.inner 2867 + .ready() 2868 + .await 2869 + .map_err(|e| { 2870 + tonic::Status::unknown( 2871 + format!("Service was not ready: {}", e.into()), 2872 + ) 2873 + })?; 2478 2874 let codec = tonic::codec::ProstCodec::default(); 2479 - let path = 2480 - http::uri::PathAndQuery::from_static("/rockbox.v1alpha1.PlaybackService/PlayTrack"); 2875 + let path = http::uri::PathAndQuery::from_static( 2876 + "/rockbox.v1alpha1.PlaybackService/PlayTrack", 2877 + ); 2481 2878 let mut req = request.into_request(); 2482 - req.extensions_mut().insert(GrpcMethod::new( 2483 - "rockbox.v1alpha1.PlaybackService", 2484 - "PlayTrack", 2485 - )); 2879 + req.extensions_mut() 2880 + .insert( 2881 + GrpcMethod::new("rockbox.v1alpha1.PlaybackService", "PlayTrack"), 2882 + ); 2486 2883 self.inner.unary(req, path, codec).await 2487 2884 } 2488 2885 pub async fn play_liked_tracks( 2489 2886 &mut self, 2490 2887 request: impl tonic::IntoRequest<super::PlayLikedTracksRequest>, 2491 - ) -> std::result::Result<tonic::Response<super::PlayLikedTracksResponse>, tonic::Status> 2492 - { 2493 - self.inner.ready().await.map_err(|e| { 2494 - tonic::Status::unknown(format!("Service was not ready: {}", e.into())) 2495 - })?; 2888 + ) -> std::result::Result< 2889 + tonic::Response<super::PlayLikedTracksResponse>, 2890 + tonic::Status, 2891 + > { 2892 + self.inner 2893 + .ready() 2894 + .await 2895 + .map_err(|e| { 2896 + tonic::Status::unknown( 2897 + format!("Service was not ready: {}", e.into()), 2898 + ) 2899 + })?; 2496 2900 let codec = tonic::codec::ProstCodec::default(); 2497 2901 let path = http::uri::PathAndQuery::from_static( 2498 2902 "/rockbox.v1alpha1.PlaybackService/PlayLikedTracks", 2499 2903 ); 2500 2904 let mut req = request.into_request(); 2501 - req.extensions_mut().insert(GrpcMethod::new( 2502 - "rockbox.v1alpha1.PlaybackService", 2503 - "PlayLikedTracks", 2504 - )); 2905 + req.extensions_mut() 2906 + .insert( 2907 + GrpcMethod::new( 2908 + "rockbox.v1alpha1.PlaybackService", 2909 + "PlayLikedTracks", 2910 + ), 2911 + ); 2505 2912 self.inner.unary(req, path, codec).await 2506 2913 } 2507 2914 pub async fn play_all_tracks( 2508 2915 &mut self, 2509 2916 request: impl tonic::IntoRequest<super::PlayAllTracksRequest>, 2510 - ) -> std::result::Result<tonic::Response<super::PlayAllTracksResponse>, tonic::Status> 2511 - { 2512 - self.inner.ready().await.map_err(|e| { 2513 - tonic::Status::unknown(format!("Service was not ready: {}", e.into())) 2514 - })?; 2917 + ) -> std::result::Result< 2918 + tonic::Response<super::PlayAllTracksResponse>, 2919 + tonic::Status, 2920 + > { 2921 + self.inner 2922 + .ready() 2923 + .await 2924 + .map_err(|e| { 2925 + tonic::Status::unknown( 2926 + format!("Service was not ready: {}", e.into()), 2927 + ) 2928 + })?; 2515 2929 let codec = tonic::codec::ProstCodec::default(); 2516 2930 let path = http::uri::PathAndQuery::from_static( 2517 2931 "/rockbox.v1alpha1.PlaybackService/PlayAllTracks", 2518 2932 ); 2519 2933 let mut req = request.into_request(); 2520 - req.extensions_mut().insert(GrpcMethod::new( 2521 - "rockbox.v1alpha1.PlaybackService", 2522 - "PlayAllTracks", 2523 - )); 2934 + req.extensions_mut() 2935 + .insert( 2936 + GrpcMethod::new("rockbox.v1alpha1.PlaybackService", "PlayAllTracks"), 2937 + ); 2524 2938 self.inner.unary(req, path, codec).await 2525 2939 } 2526 2940 pub async fn stream_current_track( ··· 2530 2944 tonic::Response<tonic::codec::Streaming<super::CurrentTrackResponse>>, 2531 2945 tonic::Status, 2532 2946 > { 2533 - self.inner.ready().await.map_err(|e| { 2534 - tonic::Status::unknown(format!("Service was not ready: {}", e.into())) 2535 - })?; 2947 + self.inner 2948 + .ready() 2949 + .await 2950 + .map_err(|e| { 2951 + tonic::Status::unknown( 2952 + format!("Service was not ready: {}", e.into()), 2953 + ) 2954 + })?; 2536 2955 let codec = tonic::codec::ProstCodec::default(); 2537 2956 let path = http::uri::PathAndQuery::from_static( 2538 2957 "/rockbox.v1alpha1.PlaybackService/StreamCurrentTrack", 2539 2958 ); 2540 2959 let mut req = request.into_request(); 2541 - req.extensions_mut().insert(GrpcMethod::new( 2542 - "rockbox.v1alpha1.PlaybackService", 2543 - "StreamCurrentTrack", 2544 - )); 2960 + req.extensions_mut() 2961 + .insert( 2962 + GrpcMethod::new( 2963 + "rockbox.v1alpha1.PlaybackService", 2964 + "StreamCurrentTrack", 2965 + ), 2966 + ); 2545 2967 self.inner.server_streaming(req, path, codec).await 2546 2968 } 2547 2969 pub async fn stream_status( ··· 2551 2973 tonic::Response<tonic::codec::Streaming<super::StatusResponse>>, 2552 2974 tonic::Status, 2553 2975 > { 2554 - self.inner.ready().await.map_err(|e| { 2555 - tonic::Status::unknown(format!("Service was not ready: {}", e.into())) 2556 - })?; 2976 + self.inner 2977 + .ready() 2978 + .await 2979 + .map_err(|e| { 2980 + tonic::Status::unknown( 2981 + format!("Service was not ready: {}", e.into()), 2982 + ) 2983 + })?; 2557 2984 let codec = tonic::codec::ProstCodec::default(); 2558 2985 let path = http::uri::PathAndQuery::from_static( 2559 2986 "/rockbox.v1alpha1.PlaybackService/StreamStatus", 2560 2987 ); 2561 2988 let mut req = request.into_request(); 2562 - req.extensions_mut().insert(GrpcMethod::new( 2563 - "rockbox.v1alpha1.PlaybackService", 2564 - "StreamStatus", 2565 - )); 2989 + req.extensions_mut() 2990 + .insert( 2991 + GrpcMethod::new("rockbox.v1alpha1.PlaybackService", "StreamStatus"), 2992 + ); 2566 2993 self.inner.server_streaming(req, path, codec).await 2567 2994 } 2568 2995 pub async fn stream_playlist( ··· 2572 2999 tonic::Response<tonic::codec::Streaming<super::PlaylistResponse>>, 2573 3000 tonic::Status, 2574 3001 > { 2575 - self.inner.ready().await.map_err(|e| { 2576 - tonic::Status::unknown(format!("Service was not ready: {}", e.into())) 2577 - })?; 3002 + self.inner 3003 + .ready() 3004 + .await 3005 + .map_err(|e| { 3006 + tonic::Status::unknown( 3007 + format!("Service was not ready: {}", e.into()), 3008 + ) 3009 + })?; 2578 3010 let codec = tonic::codec::ProstCodec::default(); 2579 3011 let path = http::uri::PathAndQuery::from_static( 2580 3012 "/rockbox.v1alpha1.PlaybackService/StreamPlaylist", 2581 3013 ); 2582 3014 let mut req = request.into_request(); 2583 - req.extensions_mut().insert(GrpcMethod::new( 2584 - "rockbox.v1alpha1.PlaybackService", 2585 - "StreamPlaylist", 2586 - )); 3015 + req.extensions_mut() 3016 + .insert( 3017 + GrpcMethod::new("rockbox.v1alpha1.PlaybackService", "StreamPlaylist"), 3018 + ); 2587 3019 self.inner.server_streaming(req, path, codec).await 2588 3020 } 2589 3021 } ··· 2595 3027 dead_code, 2596 3028 missing_docs, 2597 3029 clippy::wildcard_imports, 2598 - clippy::let_unit_value 3030 + clippy::let_unit_value, 2599 3031 )] 2600 3032 use tonic::codegen::*; 2601 3033 /// Generated trait containing gRPC methods that should be implemented for use with PlaybackServiceServer. ··· 2612 3044 async fn play_or_pause( 2613 3045 &self, 2614 3046 request: tonic::Request<super::PlayOrPauseRequest>, 2615 - ) -> std::result::Result<tonic::Response<super::PlayOrPauseResponse>, tonic::Status>; 3047 + ) -> std::result::Result< 3048 + tonic::Response<super::PlayOrPauseResponse>, 3049 + tonic::Status, 3050 + >; 2616 3051 async fn resume( 2617 3052 &self, 2618 3053 request: tonic::Request<super::ResumeRequest>, ··· 2624 3059 async fn previous( 2625 3060 &self, 2626 3061 request: tonic::Request<super::PreviousRequest>, 2627 - ) -> std::result::Result<tonic::Response<super::PreviousResponse>, tonic::Status>; 3062 + ) -> std::result::Result< 3063 + tonic::Response<super::PreviousResponse>, 3064 + tonic::Status, 3065 + >; 2628 3066 async fn fast_forward_rewind( 2629 3067 &self, 2630 3068 request: tonic::Request<super::FastForwardRewindRequest>, 2631 - ) -> std::result::Result<tonic::Response<super::FastForwardRewindResponse>, tonic::Status>; 3069 + ) -> std::result::Result< 3070 + tonic::Response<super::FastForwardRewindResponse>, 3071 + tonic::Status, 3072 + >; 2632 3073 async fn status( 2633 3074 &self, 2634 3075 request: tonic::Request<super::StatusRequest>, ··· 2636 3077 async fn current_track( 2637 3078 &self, 2638 3079 request: tonic::Request<super::CurrentTrackRequest>, 2639 - ) -> std::result::Result<tonic::Response<super::CurrentTrackResponse>, tonic::Status>; 3080 + ) -> std::result::Result< 3081 + tonic::Response<super::CurrentTrackResponse>, 3082 + tonic::Status, 3083 + >; 2640 3084 async fn next_track( 2641 3085 &self, 2642 3086 request: tonic::Request<super::NextTrackRequest>, 2643 - ) -> std::result::Result<tonic::Response<super::NextTrackResponse>, tonic::Status>; 3087 + ) -> std::result::Result< 3088 + tonic::Response<super::NextTrackResponse>, 3089 + tonic::Status, 3090 + >; 2644 3091 async fn flush_and_reload_tracks( 2645 3092 &self, 2646 3093 request: tonic::Request<super::FlushAndReloadTracksRequest>, 2647 - ) -> std::result::Result<tonic::Response<super::FlushAndReloadTracksResponse>, tonic::Status>; 3094 + ) -> std::result::Result< 3095 + tonic::Response<super::FlushAndReloadTracksResponse>, 3096 + tonic::Status, 3097 + >; 2648 3098 async fn get_file_position( 2649 3099 &self, 2650 3100 request: tonic::Request<super::GetFilePositionRequest>, 2651 - ) -> std::result::Result<tonic::Response<super::GetFilePositionResponse>, tonic::Status>; 3101 + ) -> std::result::Result< 3102 + tonic::Response<super::GetFilePositionResponse>, 3103 + tonic::Status, 3104 + >; 2652 3105 async fn hard_stop( 2653 3106 &self, 2654 3107 request: tonic::Request<super::HardStopRequest>, 2655 - ) -> std::result::Result<tonic::Response<super::HardStopResponse>, tonic::Status>; 3108 + ) -> std::result::Result< 3109 + tonic::Response<super::HardStopResponse>, 3110 + tonic::Status, 3111 + >; 2656 3112 async fn play_album( 2657 3113 &self, 2658 3114 request: tonic::Request<super::PlayAlbumRequest>, 2659 - ) -> std::result::Result<tonic::Response<super::PlayAlbumResponse>, tonic::Status>; 3115 + ) -> std::result::Result< 3116 + tonic::Response<super::PlayAlbumResponse>, 3117 + tonic::Status, 3118 + >; 2660 3119 async fn play_artist_tracks( 2661 3120 &self, 2662 3121 request: tonic::Request<super::PlayArtistTracksRequest>, 2663 - ) -> std::result::Result<tonic::Response<super::PlayArtistTracksResponse>, tonic::Status>; 3122 + ) -> std::result::Result< 3123 + tonic::Response<super::PlayArtistTracksResponse>, 3124 + tonic::Status, 3125 + >; 2664 3126 async fn play_playlist( 2665 3127 &self, 2666 3128 request: tonic::Request<super::PlayPlaylistRequest>, 2667 - ) -> std::result::Result<tonic::Response<super::PlayPlaylistResponse>, tonic::Status>; 3129 + ) -> std::result::Result< 3130 + tonic::Response<super::PlayPlaylistResponse>, 3131 + tonic::Status, 3132 + >; 2668 3133 async fn play_directory( 2669 3134 &self, 2670 3135 request: tonic::Request<super::PlayDirectoryRequest>, 2671 - ) -> std::result::Result<tonic::Response<super::PlayDirectoryResponse>, tonic::Status>; 3136 + ) -> std::result::Result< 3137 + tonic::Response<super::PlayDirectoryResponse>, 3138 + tonic::Status, 3139 + >; 2672 3140 async fn play_music_directory( 2673 3141 &self, 2674 3142 request: tonic::Request<super::PlayMusicDirectoryRequest>, 2675 - ) -> std::result::Result<tonic::Response<super::PlayMusicDirectoryResponse>, tonic::Status>; 3143 + ) -> std::result::Result< 3144 + tonic::Response<super::PlayMusicDirectoryResponse>, 3145 + tonic::Status, 3146 + >; 2676 3147 async fn play_track( 2677 3148 &self, 2678 3149 request: tonic::Request<super::PlayTrackRequest>, 2679 - ) -> std::result::Result<tonic::Response<super::PlayTrackResponse>, tonic::Status>; 3150 + ) -> std::result::Result< 3151 + tonic::Response<super::PlayTrackResponse>, 3152 + tonic::Status, 3153 + >; 2680 3154 async fn play_liked_tracks( 2681 3155 &self, 2682 3156 request: tonic::Request<super::PlayLikedTracksRequest>, 2683 - ) -> std::result::Result<tonic::Response<super::PlayLikedTracksResponse>, tonic::Status>; 3157 + ) -> std::result::Result< 3158 + tonic::Response<super::PlayLikedTracksResponse>, 3159 + tonic::Status, 3160 + >; 2684 3161 async fn play_all_tracks( 2685 3162 &self, 2686 3163 request: tonic::Request<super::PlayAllTracksRequest>, 2687 - ) -> std::result::Result<tonic::Response<super::PlayAllTracksResponse>, tonic::Status>; 3164 + ) -> std::result::Result< 3165 + tonic::Response<super::PlayAllTracksResponse>, 3166 + tonic::Status, 3167 + >; 2688 3168 /// Server streaming response type for the StreamCurrentTrack method. 2689 3169 type StreamCurrentTrackStream: tonic::codegen::tokio_stream::Stream< 2690 3170 Item = std::result::Result<super::CurrentTrackResponse, tonic::Status>, 2691 - > + std::marker::Send 3171 + > 3172 + + std::marker::Send 2692 3173 + 'static; 2693 3174 async fn stream_current_track( 2694 3175 &self, 2695 3176 request: tonic::Request<super::StreamCurrentTrackRequest>, 2696 - ) -> std::result::Result<tonic::Response<Self::StreamCurrentTrackStream>, tonic::Status>; 3177 + ) -> std::result::Result< 3178 + tonic::Response<Self::StreamCurrentTrackStream>, 3179 + tonic::Status, 3180 + >; 2697 3181 /// Server streaming response type for the StreamStatus method. 2698 3182 type StreamStatusStream: tonic::codegen::tokio_stream::Stream< 2699 3183 Item = std::result::Result<super::StatusResponse, tonic::Status>, 2700 - > + std::marker::Send 3184 + > 3185 + + std::marker::Send 2701 3186 + 'static; 2702 3187 async fn stream_status( 2703 3188 &self, 2704 3189 request: tonic::Request<super::StreamStatusRequest>, 2705 - ) -> std::result::Result<tonic::Response<Self::StreamStatusStream>, tonic::Status>; 3190 + ) -> std::result::Result< 3191 + tonic::Response<Self::StreamStatusStream>, 3192 + tonic::Status, 3193 + >; 2706 3194 /// Server streaming response type for the StreamPlaylist method. 2707 3195 type StreamPlaylistStream: tonic::codegen::tokio_stream::Stream< 2708 3196 Item = std::result::Result<super::PlaylistResponse, tonic::Status>, 2709 - > + std::marker::Send 3197 + > 3198 + + std::marker::Send 2710 3199 + 'static; 2711 3200 async fn stream_playlist( 2712 3201 &self, 2713 3202 request: tonic::Request<super::StreamPlaylistRequest>, 2714 - ) -> std::result::Result<tonic::Response<Self::StreamPlaylistStream>, tonic::Status>; 3203 + ) -> std::result::Result< 3204 + tonic::Response<Self::StreamPlaylistStream>, 3205 + tonic::Status, 3206 + >; 2715 3207 } 2716 3208 #[derive(Debug)] 2717 3209 pub struct PlaybackServiceServer<T> { ··· 2734 3226 max_encoding_message_size: None, 2735 3227 } 2736 3228 } 2737 - pub fn with_interceptor<F>(inner: T, interceptor: F) -> InterceptedService<Self, F> 3229 + pub fn with_interceptor<F>( 3230 + inner: T, 3231 + interceptor: F, 3232 + ) -> InterceptedService<Self, F> 2738 3233 where 2739 3234 F: tonic::service::Interceptor, 2740 3235 { ··· 2789 3284 "/rockbox.v1alpha1.PlaybackService/Play" => { 2790 3285 #[allow(non_camel_case_types)] 2791 3286 struct PlaySvc<T: PlaybackService>(pub Arc<T>); 2792 - impl<T: PlaybackService> tonic::server::UnaryService<super::PlayRequest> for PlaySvc<T> { 3287 + impl< 3288 + T: PlaybackService, 3289 + > tonic::server::UnaryService<super::PlayRequest> for PlaySvc<T> { 2793 3290 type Response = super::PlayResponse; 2794 - type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>; 3291 + type Future = BoxFuture< 3292 + tonic::Response<Self::Response>, 3293 + tonic::Status, 3294 + >; 2795 3295 fn call( 2796 3296 &mut self, 2797 3297 request: tonic::Request<super::PlayRequest>, 2798 3298 ) -> Self::Future { 2799 3299 let inner = Arc::clone(&self.0); 2800 - let fut = 2801 - async move { <T as PlaybackService>::play(&inner, request).await }; 3300 + let fut = async move { 3301 + <T as PlaybackService>::play(&inner, request).await 3302 + }; 2802 3303 Box::pin(fut) 2803 3304 } 2804 3305 } ··· 2827 3328 "/rockbox.v1alpha1.PlaybackService/Pause" => { 2828 3329 #[allow(non_camel_case_types)] 2829 3330 struct PauseSvc<T: PlaybackService>(pub Arc<T>); 2830 - impl<T: PlaybackService> tonic::server::UnaryService<super::PauseRequest> for PauseSvc<T> { 3331 + impl< 3332 + T: PlaybackService, 3333 + > tonic::server::UnaryService<super::PauseRequest> for PauseSvc<T> { 2831 3334 type Response = super::PauseResponse; 2832 - type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>; 3335 + type Future = BoxFuture< 3336 + tonic::Response<Self::Response>, 3337 + tonic::Status, 3338 + >; 2833 3339 fn call( 2834 3340 &mut self, 2835 3341 request: tonic::Request<super::PauseRequest>, 2836 3342 ) -> Self::Future { 2837 3343 let inner = Arc::clone(&self.0); 2838 - let fut = 2839 - async move { <T as PlaybackService>::pause(&inner, request).await }; 3344 + let fut = async move { 3345 + <T as PlaybackService>::pause(&inner, request).await 3346 + }; 2840 3347 Box::pin(fut) 2841 3348 } 2842 3349 } ··· 2865 3372 "/rockbox.v1alpha1.PlaybackService/PlayOrPause" => { 2866 3373 #[allow(non_camel_case_types)] 2867 3374 struct PlayOrPauseSvc<T: PlaybackService>(pub Arc<T>); 2868 - impl<T: PlaybackService> tonic::server::UnaryService<super::PlayOrPauseRequest> 2869 - for PlayOrPauseSvc<T> 2870 - { 3375 + impl< 3376 + T: PlaybackService, 3377 + > tonic::server::UnaryService<super::PlayOrPauseRequest> 3378 + for PlayOrPauseSvc<T> { 2871 3379 type Response = super::PlayOrPauseResponse; 2872 - type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>; 3380 + type Future = BoxFuture< 3381 + tonic::Response<Self::Response>, 3382 + tonic::Status, 3383 + >; 2873 3384 fn call( 2874 3385 &mut self, 2875 3386 request: tonic::Request<super::PlayOrPauseRequest>, ··· 2906 3417 "/rockbox.v1alpha1.PlaybackService/Resume" => { 2907 3418 #[allow(non_camel_case_types)] 2908 3419 struct ResumeSvc<T: PlaybackService>(pub Arc<T>); 2909 - impl<T: PlaybackService> tonic::server::UnaryService<super::ResumeRequest> for ResumeSvc<T> { 3420 + impl< 3421 + T: PlaybackService, 3422 + > tonic::server::UnaryService<super::ResumeRequest> 3423 + for ResumeSvc<T> { 2910 3424 type Response = super::ResumeResponse; 2911 - type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>; 3425 + type Future = BoxFuture< 3426 + tonic::Response<Self::Response>, 3427 + tonic::Status, 3428 + >; 2912 3429 fn call( 2913 3430 &mut self, 2914 3431 request: tonic::Request<super::ResumeRequest>, ··· 2945 3462 "/rockbox.v1alpha1.PlaybackService/Next" => { 2946 3463 #[allow(non_camel_case_types)] 2947 3464 struct NextSvc<T: PlaybackService>(pub Arc<T>); 2948 - impl<T: PlaybackService> tonic::server::UnaryService<super::NextRequest> for NextSvc<T> { 3465 + impl< 3466 + T: PlaybackService, 3467 + > tonic::server::UnaryService<super::NextRequest> for NextSvc<T> { 2949 3468 type Response = super::NextResponse; 2950 - type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>; 3469 + type Future = BoxFuture< 3470 + tonic::Response<Self::Response>, 3471 + tonic::Status, 3472 + >; 2951 3473 fn call( 2952 3474 &mut self, 2953 3475 request: tonic::Request<super::NextRequest>, 2954 3476 ) -> Self::Future { 2955 3477 let inner = Arc::clone(&self.0); 2956 - let fut = 2957 - async move { <T as PlaybackService>::next(&inner, request).await }; 3478 + let fut = async move { 3479 + <T as PlaybackService>::next(&inner, request).await 3480 + }; 2958 3481 Box::pin(fut) 2959 3482 } 2960 3483 } ··· 2983 3506 "/rockbox.v1alpha1.PlaybackService/Previous" => { 2984 3507 #[allow(non_camel_case_types)] 2985 3508 struct PreviousSvc<T: PlaybackService>(pub Arc<T>); 2986 - impl<T: PlaybackService> tonic::server::UnaryService<super::PreviousRequest> for PreviousSvc<T> { 3509 + impl< 3510 + T: PlaybackService, 3511 + > tonic::server::UnaryService<super::PreviousRequest> 3512 + for PreviousSvc<T> { 2987 3513 type Response = super::PreviousResponse; 2988 - type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>; 3514 + type Future = BoxFuture< 3515 + tonic::Response<Self::Response>, 3516 + tonic::Status, 3517 + >; 2989 3518 fn call( 2990 3519 &mut self, 2991 3520 request: tonic::Request<super::PreviousRequest>, ··· 3022 3551 "/rockbox.v1alpha1.PlaybackService/FastForwardRewind" => { 3023 3552 #[allow(non_camel_case_types)] 3024 3553 struct FastForwardRewindSvc<T: PlaybackService>(pub Arc<T>); 3025 - impl<T: PlaybackService> 3026 - tonic::server::UnaryService<super::FastForwardRewindRequest> 3027 - for FastForwardRewindSvc<T> 3028 - { 3554 + impl< 3555 + T: PlaybackService, 3556 + > tonic::server::UnaryService<super::FastForwardRewindRequest> 3557 + for FastForwardRewindSvc<T> { 3029 3558 type Response = super::FastForwardRewindResponse; 3030 - type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>; 3559 + type Future = BoxFuture< 3560 + tonic::Response<Self::Response>, 3561 + tonic::Status, 3562 + >; 3031 3563 fn call( 3032 3564 &mut self, 3033 3565 request: tonic::Request<super::FastForwardRewindRequest>, 3034 3566 ) -> Self::Future { 3035 3567 let inner = Arc::clone(&self.0); 3036 3568 let fut = async move { 3037 - <T as PlaybackService>::fast_forward_rewind(&inner, request).await 3569 + <T as PlaybackService>::fast_forward_rewind(&inner, request) 3570 + .await 3038 3571 }; 3039 3572 Box::pin(fut) 3040 3573 } ··· 3064 3597 "/rockbox.v1alpha1.PlaybackService/Status" => { 3065 3598 #[allow(non_camel_case_types)] 3066 3599 struct StatusSvc<T: PlaybackService>(pub Arc<T>); 3067 - impl<T: PlaybackService> tonic::server::UnaryService<super::StatusRequest> for StatusSvc<T> { 3600 + impl< 3601 + T: PlaybackService, 3602 + > tonic::server::UnaryService<super::StatusRequest> 3603 + for StatusSvc<T> { 3068 3604 type Response = super::StatusResponse; 3069 - type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>; 3605 + type Future = BoxFuture< 3606 + tonic::Response<Self::Response>, 3607 + tonic::Status, 3608 + >; 3070 3609 fn call( 3071 3610 &mut self, 3072 3611 request: tonic::Request<super::StatusRequest>, ··· 3103 3642 "/rockbox.v1alpha1.PlaybackService/CurrentTrack" => { 3104 3643 #[allow(non_camel_case_types)] 3105 3644 struct CurrentTrackSvc<T: PlaybackService>(pub Arc<T>); 3106 - impl<T: PlaybackService> tonic::server::UnaryService<super::CurrentTrackRequest> 3107 - for CurrentTrackSvc<T> 3108 - { 3645 + impl< 3646 + T: PlaybackService, 3647 + > tonic::server::UnaryService<super::CurrentTrackRequest> 3648 + for CurrentTrackSvc<T> { 3109 3649 type Response = super::CurrentTrackResponse; 3110 - type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>; 3650 + type Future = BoxFuture< 3651 + tonic::Response<Self::Response>, 3652 + tonic::Status, 3653 + >; 3111 3654 fn call( 3112 3655 &mut self, 3113 3656 request: tonic::Request<super::CurrentTrackRequest>, ··· 3144 3687 "/rockbox.v1alpha1.PlaybackService/NextTrack" => { 3145 3688 #[allow(non_camel_case_types)] 3146 3689 struct NextTrackSvc<T: PlaybackService>(pub Arc<T>); 3147 - impl<T: PlaybackService> tonic::server::UnaryService<super::NextTrackRequest> for NextTrackSvc<T> { 3690 + impl< 3691 + T: PlaybackService, 3692 + > tonic::server::UnaryService<super::NextTrackRequest> 3693 + for NextTrackSvc<T> { 3148 3694 type Response = super::NextTrackResponse; 3149 - type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>; 3695 + type Future = BoxFuture< 3696 + tonic::Response<Self::Response>, 3697 + tonic::Status, 3698 + >; 3150 3699 fn call( 3151 3700 &mut self, 3152 3701 request: tonic::Request<super::NextTrackRequest>, ··· 3183 3732 "/rockbox.v1alpha1.PlaybackService/FlushAndReloadTracks" => { 3184 3733 #[allow(non_camel_case_types)] 3185 3734 struct FlushAndReloadTracksSvc<T: PlaybackService>(pub Arc<T>); 3186 - impl<T: PlaybackService> 3187 - tonic::server::UnaryService<super::FlushAndReloadTracksRequest> 3188 - for FlushAndReloadTracksSvc<T> 3189 - { 3735 + impl< 3736 + T: PlaybackService, 3737 + > tonic::server::UnaryService<super::FlushAndReloadTracksRequest> 3738 + for FlushAndReloadTracksSvc<T> { 3190 3739 type Response = super::FlushAndReloadTracksResponse; 3191 - type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>; 3740 + type Future = BoxFuture< 3741 + tonic::Response<Self::Response>, 3742 + tonic::Status, 3743 + >; 3192 3744 fn call( 3193 3745 &mut self, 3194 3746 request: tonic::Request<super::FlushAndReloadTracksRequest>, 3195 3747 ) -> Self::Future { 3196 3748 let inner = Arc::clone(&self.0); 3197 3749 let fut = async move { 3198 - <T as PlaybackService>::flush_and_reload_tracks(&inner, request) 3750 + <T as PlaybackService>::flush_and_reload_tracks( 3751 + &inner, 3752 + request, 3753 + ) 3199 3754 .await 3200 3755 }; 3201 3756 Box::pin(fut) ··· 3226 3781 "/rockbox.v1alpha1.PlaybackService/GetFilePosition" => { 3227 3782 #[allow(non_camel_case_types)] 3228 3783 struct GetFilePositionSvc<T: PlaybackService>(pub Arc<T>); 3229 - impl<T: PlaybackService> 3230 - tonic::server::UnaryService<super::GetFilePositionRequest> 3231 - for GetFilePositionSvc<T> 3232 - { 3784 + impl< 3785 + T: PlaybackService, 3786 + > tonic::server::UnaryService<super::GetFilePositionRequest> 3787 + for GetFilePositionSvc<T> { 3233 3788 type Response = super::GetFilePositionResponse; 3234 - type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>; 3789 + type Future = BoxFuture< 3790 + tonic::Response<Self::Response>, 3791 + tonic::Status, 3792 + >; 3235 3793 fn call( 3236 3794 &mut self, 3237 3795 request: tonic::Request<super::GetFilePositionRequest>, 3238 3796 ) -> Self::Future { 3239 3797 let inner = Arc::clone(&self.0); 3240 3798 let fut = async move { 3241 - <T as PlaybackService>::get_file_position(&inner, request).await 3799 + <T as PlaybackService>::get_file_position(&inner, request) 3800 + .await 3242 3801 }; 3243 3802 Box::pin(fut) 3244 3803 } ··· 3268 3827 "/rockbox.v1alpha1.PlaybackService/HardStop" => { 3269 3828 #[allow(non_camel_case_types)] 3270 3829 struct HardStopSvc<T: PlaybackService>(pub Arc<T>); 3271 - impl<T: PlaybackService> tonic::server::UnaryService<super::HardStopRequest> for HardStopSvc<T> { 3830 + impl< 3831 + T: PlaybackService, 3832 + > tonic::server::UnaryService<super::HardStopRequest> 3833 + for HardStopSvc<T> { 3272 3834 type Response = super::HardStopResponse; 3273 - type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>; 3835 + type Future = BoxFuture< 3836 + tonic::Response<Self::Response>, 3837 + tonic::Status, 3838 + >; 3274 3839 fn call( 3275 3840 &mut self, 3276 3841 request: tonic::Request<super::HardStopRequest>, ··· 3307 3872 "/rockbox.v1alpha1.PlaybackService/PlayAlbum" => { 3308 3873 #[allow(non_camel_case_types)] 3309 3874 struct PlayAlbumSvc<T: PlaybackService>(pub Arc<T>); 3310 - impl<T: PlaybackService> tonic::server::UnaryService<super::PlayAlbumRequest> for PlayAlbumSvc<T> { 3875 + impl< 3876 + T: PlaybackService, 3877 + > tonic::server::UnaryService<super::PlayAlbumRequest> 3878 + for PlayAlbumSvc<T> { 3311 3879 type Response = super::PlayAlbumResponse; 3312 - type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>; 3880 + type Future = BoxFuture< 3881 + tonic::Response<Self::Response>, 3882 + tonic::Status, 3883 + >; 3313 3884 fn call( 3314 3885 &mut self, 3315 3886 request: tonic::Request<super::PlayAlbumRequest>, ··· 3346 3917 "/rockbox.v1alpha1.PlaybackService/PlayArtistTracks" => { 3347 3918 #[allow(non_camel_case_types)] 3348 3919 struct PlayArtistTracksSvc<T: PlaybackService>(pub Arc<T>); 3349 - impl<T: PlaybackService> 3350 - tonic::server::UnaryService<super::PlayArtistTracksRequest> 3351 - for PlayArtistTracksSvc<T> 3352 - { 3920 + impl< 3921 + T: PlaybackService, 3922 + > tonic::server::UnaryService<super::PlayArtistTracksRequest> 3923 + for PlayArtistTracksSvc<T> { 3353 3924 type Response = super::PlayArtistTracksResponse; 3354 - type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>; 3925 + type Future = BoxFuture< 3926 + tonic::Response<Self::Response>, 3927 + tonic::Status, 3928 + >; 3355 3929 fn call( 3356 3930 &mut self, 3357 3931 request: tonic::Request<super::PlayArtistTracksRequest>, 3358 3932 ) -> Self::Future { 3359 3933 let inner = Arc::clone(&self.0); 3360 3934 let fut = async move { 3361 - <T as PlaybackService>::play_artist_tracks(&inner, request).await 3935 + <T as PlaybackService>::play_artist_tracks(&inner, request) 3936 + .await 3362 3937 }; 3363 3938 Box::pin(fut) 3364 3939 } ··· 3388 3963 "/rockbox.v1alpha1.PlaybackService/PlayPlaylist" => { 3389 3964 #[allow(non_camel_case_types)] 3390 3965 struct PlayPlaylistSvc<T: PlaybackService>(pub Arc<T>); 3391 - impl<T: PlaybackService> tonic::server::UnaryService<super::PlayPlaylistRequest> 3392 - for PlayPlaylistSvc<T> 3393 - { 3966 + impl< 3967 + T: PlaybackService, 3968 + > tonic::server::UnaryService<super::PlayPlaylistRequest> 3969 + for PlayPlaylistSvc<T> { 3394 3970 type Response = super::PlayPlaylistResponse; 3395 - type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>; 3971 + type Future = BoxFuture< 3972 + tonic::Response<Self::Response>, 3973 + tonic::Status, 3974 + >; 3396 3975 fn call( 3397 3976 &mut self, 3398 3977 request: tonic::Request<super::PlayPlaylistRequest>, ··· 3429 4008 "/rockbox.v1alpha1.PlaybackService/PlayDirectory" => { 3430 4009 #[allow(non_camel_case_types)] 3431 4010 struct PlayDirectorySvc<T: PlaybackService>(pub Arc<T>); 3432 - impl<T: PlaybackService> 3433 - tonic::server::UnaryService<super::PlayDirectoryRequest> 3434 - for PlayDirectorySvc<T> 3435 - { 4011 + impl< 4012 + T: PlaybackService, 4013 + > tonic::server::UnaryService<super::PlayDirectoryRequest> 4014 + for PlayDirectorySvc<T> { 3436 4015 type Response = super::PlayDirectoryResponse; 3437 - type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>; 4016 + type Future = BoxFuture< 4017 + tonic::Response<Self::Response>, 4018 + tonic::Status, 4019 + >; 3438 4020 fn call( 3439 4021 &mut self, 3440 4022 request: tonic::Request<super::PlayDirectoryRequest>, 3441 4023 ) -> Self::Future { 3442 4024 let inner = Arc::clone(&self.0); 3443 4025 let fut = async move { 3444 - <T as PlaybackService>::play_directory(&inner, request).await 4026 + <T as PlaybackService>::play_directory(&inner, request) 4027 + .await 3445 4028 }; 3446 4029 Box::pin(fut) 3447 4030 } ··· 3471 4054 "/rockbox.v1alpha1.PlaybackService/PlayMusicDirectory" => { 3472 4055 #[allow(non_camel_case_types)] 3473 4056 struct PlayMusicDirectorySvc<T: PlaybackService>(pub Arc<T>); 3474 - impl<T: PlaybackService> 3475 - tonic::server::UnaryService<super::PlayMusicDirectoryRequest> 3476 - for PlayMusicDirectorySvc<T> 3477 - { 4057 + impl< 4058 + T: PlaybackService, 4059 + > tonic::server::UnaryService<super::PlayMusicDirectoryRequest> 4060 + for PlayMusicDirectorySvc<T> { 3478 4061 type Response = super::PlayMusicDirectoryResponse; 3479 - type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>; 4062 + type Future = BoxFuture< 4063 + tonic::Response<Self::Response>, 4064 + tonic::Status, 4065 + >; 3480 4066 fn call( 3481 4067 &mut self, 3482 4068 request: tonic::Request<super::PlayMusicDirectoryRequest>, 3483 4069 ) -> Self::Future { 3484 4070 let inner = Arc::clone(&self.0); 3485 4071 let fut = async move { 3486 - <T as PlaybackService>::play_music_directory(&inner, request).await 4072 + <T as PlaybackService>::play_music_directory( 4073 + &inner, 4074 + request, 4075 + ) 4076 + .await 3487 4077 }; 3488 4078 Box::pin(fut) 3489 4079 } ··· 3513 4103 "/rockbox.v1alpha1.PlaybackService/PlayTrack" => { 3514 4104 #[allow(non_camel_case_types)] 3515 4105 struct PlayTrackSvc<T: PlaybackService>(pub Arc<T>); 3516 - impl<T: PlaybackService> tonic::server::UnaryService<super::PlayTrackRequest> for PlayTrackSvc<T> { 4106 + impl< 4107 + T: PlaybackService, 4108 + > tonic::server::UnaryService<super::PlayTrackRequest> 4109 + for PlayTrackSvc<T> { 3517 4110 type Response = super::PlayTrackResponse; 3518 - type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>; 4111 + type Future = BoxFuture< 4112 + tonic::Response<Self::Response>, 4113 + tonic::Status, 4114 + >; 3519 4115 fn call( 3520 4116 &mut self, 3521 4117 request: tonic::Request<super::PlayTrackRequest>, ··· 3552 4148 "/rockbox.v1alpha1.PlaybackService/PlayLikedTracks" => { 3553 4149 #[allow(non_camel_case_types)] 3554 4150 struct PlayLikedTracksSvc<T: PlaybackService>(pub Arc<T>); 3555 - impl<T: PlaybackService> 3556 - tonic::server::UnaryService<super::PlayLikedTracksRequest> 3557 - for PlayLikedTracksSvc<T> 3558 - { 4151 + impl< 4152 + T: PlaybackService, 4153 + > tonic::server::UnaryService<super::PlayLikedTracksRequest> 4154 + for PlayLikedTracksSvc<T> { 3559 4155 type Response = super::PlayLikedTracksResponse; 3560 - type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>; 4156 + type Future = BoxFuture< 4157 + tonic::Response<Self::Response>, 4158 + tonic::Status, 4159 + >; 3561 4160 fn call( 3562 4161 &mut self, 3563 4162 request: tonic::Request<super::PlayLikedTracksRequest>, 3564 4163 ) -> Self::Future { 3565 4164 let inner = Arc::clone(&self.0); 3566 4165 let fut = async move { 3567 - <T as PlaybackService>::play_liked_tracks(&inner, request).await 4166 + <T as PlaybackService>::play_liked_tracks(&inner, request) 4167 + .await 3568 4168 }; 3569 4169 Box::pin(fut) 3570 4170 } ··· 3594 4194 "/rockbox.v1alpha1.PlaybackService/PlayAllTracks" => { 3595 4195 #[allow(non_camel_case_types)] 3596 4196 struct PlayAllTracksSvc<T: PlaybackService>(pub Arc<T>); 3597 - impl<T: PlaybackService> 3598 - tonic::server::UnaryService<super::PlayAllTracksRequest> 3599 - for PlayAllTracksSvc<T> 3600 - { 4197 + impl< 4198 + T: PlaybackService, 4199 + > tonic::server::UnaryService<super::PlayAllTracksRequest> 4200 + for PlayAllTracksSvc<T> { 3601 4201 type Response = super::PlayAllTracksResponse; 3602 - type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>; 4202 + type Future = BoxFuture< 4203 + tonic::Response<Self::Response>, 4204 + tonic::Status, 4205 + >; 3603 4206 fn call( 3604 4207 &mut self, 3605 4208 request: tonic::Request<super::PlayAllTracksRequest>, 3606 4209 ) -> Self::Future { 3607 4210 let inner = Arc::clone(&self.0); 3608 4211 let fut = async move { 3609 - <T as PlaybackService>::play_all_tracks(&inner, request).await 4212 + <T as PlaybackService>::play_all_tracks(&inner, request) 4213 + .await 3610 4214 }; 3611 4215 Box::pin(fut) 3612 4216 } ··· 3636 4240 "/rockbox.v1alpha1.PlaybackService/StreamCurrentTrack" => { 3637 4241 #[allow(non_camel_case_types)] 3638 4242 struct StreamCurrentTrackSvc<T: PlaybackService>(pub Arc<T>); 3639 - impl<T: PlaybackService> 3640 - tonic::server::ServerStreamingService<super::StreamCurrentTrackRequest> 3641 - for StreamCurrentTrackSvc<T> 3642 - { 4243 + impl< 4244 + T: PlaybackService, 4245 + > tonic::server::ServerStreamingService< 4246 + super::StreamCurrentTrackRequest, 4247 + > for StreamCurrentTrackSvc<T> { 3643 4248 type Response = super::CurrentTrackResponse; 3644 4249 type ResponseStream = T::StreamCurrentTrackStream; 3645 - type Future = 3646 - BoxFuture<tonic::Response<Self::ResponseStream>, tonic::Status>; 4250 + type Future = BoxFuture< 4251 + tonic::Response<Self::ResponseStream>, 4252 + tonic::Status, 4253 + >; 3647 4254 fn call( 3648 4255 &mut self, 3649 4256 request: tonic::Request<super::StreamCurrentTrackRequest>, 3650 4257 ) -> Self::Future { 3651 4258 let inner = Arc::clone(&self.0); 3652 4259 let fut = async move { 3653 - <T as PlaybackService>::stream_current_track(&inner, request).await 4260 + <T as PlaybackService>::stream_current_track( 4261 + &inner, 4262 + request, 4263 + ) 4264 + .await 3654 4265 }; 3655 4266 Box::pin(fut) 3656 4267 } ··· 3680 4291 "/rockbox.v1alpha1.PlaybackService/StreamStatus" => { 3681 4292 #[allow(non_camel_case_types)] 3682 4293 struct StreamStatusSvc<T: PlaybackService>(pub Arc<T>); 3683 - impl<T: PlaybackService> 3684 - tonic::server::ServerStreamingService<super::StreamStatusRequest> 3685 - for StreamStatusSvc<T> 3686 - { 4294 + impl< 4295 + T: PlaybackService, 4296 + > tonic::server::ServerStreamingService<super::StreamStatusRequest> 4297 + for StreamStatusSvc<T> { 3687 4298 type Response = super::StatusResponse; 3688 4299 type ResponseStream = T::StreamStatusStream; 3689 - type Future = 3690 - BoxFuture<tonic::Response<Self::ResponseStream>, tonic::Status>; 4300 + type Future = BoxFuture< 4301 + tonic::Response<Self::ResponseStream>, 4302 + tonic::Status, 4303 + >; 3691 4304 fn call( 3692 4305 &mut self, 3693 4306 request: tonic::Request<super::StreamStatusRequest>, ··· 3724 4337 "/rockbox.v1alpha1.PlaybackService/StreamPlaylist" => { 3725 4338 #[allow(non_camel_case_types)] 3726 4339 struct StreamPlaylistSvc<T: PlaybackService>(pub Arc<T>); 3727 - impl<T: PlaybackService> 3728 - tonic::server::ServerStreamingService<super::StreamPlaylistRequest> 3729 - for StreamPlaylistSvc<T> 3730 - { 4340 + impl< 4341 + T: PlaybackService, 4342 + > tonic::server::ServerStreamingService<super::StreamPlaylistRequest> 4343 + for StreamPlaylistSvc<T> { 3731 4344 type Response = super::PlaylistResponse; 3732 4345 type ResponseStream = T::StreamPlaylistStream; 3733 - type Future = 3734 - BoxFuture<tonic::Response<Self::ResponseStream>, tonic::Status>; 4346 + type Future = BoxFuture< 4347 + tonic::Response<Self::ResponseStream>, 4348 + tonic::Status, 4349 + >; 3735 4350 fn call( 3736 4351 &mut self, 3737 4352 request: tonic::Request<super::StreamPlaylistRequest>, 3738 4353 ) -> Self::Future { 3739 4354 let inner = Arc::clone(&self.0); 3740 4355 let fut = async move { 3741 - <T as PlaybackService>::stream_playlist(&inner, request).await 4356 + <T as PlaybackService>::stream_playlist(&inner, request) 4357 + .await 3742 4358 }; 3743 4359 Box::pin(fut) 3744 4360 } ··· 3765 4381 }; 3766 4382 Box::pin(fut) 3767 4383 } 3768 - _ => Box::pin(async move { 3769 - let mut response = http::Response::new(empty_body()); 3770 - let headers = response.headers_mut(); 3771 - headers.insert( 3772 - tonic::Status::GRPC_STATUS, 3773 - (tonic::Code::Unimplemented as i32).into(), 3774 - ); 3775 - headers.insert( 3776 - http::header::CONTENT_TYPE, 3777 - tonic::metadata::GRPC_CONTENT_TYPE, 3778 - ); 3779 - Ok(response) 3780 - }), 4384 + _ => { 4385 + Box::pin(async move { 4386 + let mut response = http::Response::new(empty_body()); 4387 + let headers = response.headers_mut(); 4388 + headers 4389 + .insert( 4390 + tonic::Status::GRPC_STATUS, 4391 + (tonic::Code::Unimplemented as i32).into(), 4392 + ); 4393 + headers 4394 + .insert( 4395 + http::header::CONTENT_TYPE, 4396 + tonic::metadata::GRPC_CONTENT_TYPE, 4397 + ); 4398 + Ok(response) 4399 + }) 4400 + } 3781 4401 } 3782 4402 } 3783 4403 } ··· 3984 4604 dead_code, 3985 4605 missing_docs, 3986 4606 clippy::wildcard_imports, 3987 - clippy::let_unit_value 4607 + clippy::let_unit_value, 3988 4608 )] 3989 - use tonic::codegen::http::Uri; 3990 4609 use tonic::codegen::*; 4610 + use tonic::codegen::http::Uri; 3991 4611 #[derive(Debug, Clone)] 3992 4612 pub struct PlaylistServiceClient<T> { 3993 4613 inner: tonic::client::Grpc<T>, ··· 4031 4651 <T as tonic::client::GrpcService<tonic::body::BoxBody>>::ResponseBody, 4032 4652 >, 4033 4653 >, 4034 - <T as tonic::codegen::Service<http::Request<tonic::body::BoxBody>>>::Error: 4035 - Into<StdError> + std::marker::Send + std::marker::Sync, 4654 + <T as tonic::codegen::Service< 4655 + http::Request<tonic::body::BoxBody>, 4656 + >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync, 4036 4657 { 4037 4658 PlaylistServiceClient::new(InterceptedService::new(inner, interceptor)) 4038 4659 } ··· 4070 4691 pub async fn get_current( 4071 4692 &mut self, 4072 4693 request: impl tonic::IntoRequest<super::GetCurrentRequest>, 4073 - ) -> std::result::Result<tonic::Response<super::GetCurrentResponse>, tonic::Status> 4074 - { 4075 - self.inner.ready().await.map_err(|e| { 4076 - tonic::Status::unknown(format!("Service was not ready: {}", e.into())) 4077 - })?; 4694 + ) -> std::result::Result< 4695 + tonic::Response<super::GetCurrentResponse>, 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 + })?; 4078 4706 let codec = tonic::codec::ProstCodec::default(); 4079 4707 let path = http::uri::PathAndQuery::from_static( 4080 4708 "/rockbox.v1alpha1.PlaylistService/GetCurrent", 4081 4709 ); 4082 4710 let mut req = request.into_request(); 4083 - req.extensions_mut().insert(GrpcMethod::new( 4084 - "rockbox.v1alpha1.PlaylistService", 4085 - "GetCurrent", 4086 - )); 4711 + req.extensions_mut() 4712 + .insert( 4713 + GrpcMethod::new("rockbox.v1alpha1.PlaylistService", "GetCurrent"), 4714 + ); 4087 4715 self.inner.unary(req, path, codec).await 4088 4716 } 4089 4717 pub async fn get_resume_info( 4090 4718 &mut self, 4091 4719 request: impl tonic::IntoRequest<super::GetResumeInfoRequest>, 4092 - ) -> std::result::Result<tonic::Response<super::GetResumeInfoResponse>, tonic::Status> 4093 - { 4094 - self.inner.ready().await.map_err(|e| { 4095 - tonic::Status::unknown(format!("Service was not ready: {}", e.into())) 4096 - })?; 4720 + ) -> std::result::Result< 4721 + tonic::Response<super::GetResumeInfoResponse>, 4722 + tonic::Status, 4723 + > { 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 + })?; 4097 4732 let codec = tonic::codec::ProstCodec::default(); 4098 4733 let path = http::uri::PathAndQuery::from_static( 4099 4734 "/rockbox.v1alpha1.PlaylistService/GetResumeInfo", 4100 4735 ); 4101 4736 let mut req = request.into_request(); 4102 - req.extensions_mut().insert(GrpcMethod::new( 4103 - "rockbox.v1alpha1.PlaylistService", 4104 - "GetResumeInfo", 4105 - )); 4737 + req.extensions_mut() 4738 + .insert( 4739 + GrpcMethod::new("rockbox.v1alpha1.PlaylistService", "GetResumeInfo"), 4740 + ); 4106 4741 self.inner.unary(req, path, codec).await 4107 4742 } 4108 4743 pub async fn get_track_info( 4109 4744 &mut self, 4110 4745 request: impl tonic::IntoRequest<super::GetTrackInfoRequest>, 4111 - ) -> std::result::Result<tonic::Response<super::GetTrackInfoResponse>, tonic::Status> 4112 - { 4113 - self.inner.ready().await.map_err(|e| { 4114 - tonic::Status::unknown(format!("Service was not ready: {}", e.into())) 4115 - })?; 4746 + ) -> std::result::Result< 4747 + tonic::Response<super::GetTrackInfoResponse>, 4748 + tonic::Status, 4749 + > { 4750 + self.inner 4751 + .ready() 4752 + .await 4753 + .map_err(|e| { 4754 + tonic::Status::unknown( 4755 + format!("Service was not ready: {}", e.into()), 4756 + ) 4757 + })?; 4116 4758 let codec = tonic::codec::ProstCodec::default(); 4117 4759 let path = http::uri::PathAndQuery::from_static( 4118 4760 "/rockbox.v1alpha1.PlaylistService/GetTrackInfo", 4119 4761 ); 4120 4762 let mut req = request.into_request(); 4121 - req.extensions_mut().insert(GrpcMethod::new( 4122 - "rockbox.v1alpha1.PlaylistService", 4123 - "GetTrackInfo", 4124 - )); 4763 + req.extensions_mut() 4764 + .insert( 4765 + GrpcMethod::new("rockbox.v1alpha1.PlaylistService", "GetTrackInfo"), 4766 + ); 4125 4767 self.inner.unary(req, path, codec).await 4126 4768 } 4127 4769 pub async fn get_first_index( 4128 4770 &mut self, 4129 4771 request: impl tonic::IntoRequest<super::GetFirstIndexRequest>, 4130 - ) -> std::result::Result<tonic::Response<super::GetFirstIndexResponse>, tonic::Status> 4131 - { 4132 - self.inner.ready().await.map_err(|e| { 4133 - tonic::Status::unknown(format!("Service was not ready: {}", e.into())) 4134 - })?; 4772 + ) -> std::result::Result< 4773 + tonic::Response<super::GetFirstIndexResponse>, 4774 + tonic::Status, 4775 + > { 4776 + self.inner 4777 + .ready() 4778 + .await 4779 + .map_err(|e| { 4780 + tonic::Status::unknown( 4781 + format!("Service was not ready: {}", e.into()), 4782 + ) 4783 + })?; 4135 4784 let codec = tonic::codec::ProstCodec::default(); 4136 4785 let path = http::uri::PathAndQuery::from_static( 4137 4786 "/rockbox.v1alpha1.PlaylistService/GetFirstIndex", 4138 4787 ); 4139 4788 let mut req = request.into_request(); 4140 - req.extensions_mut().insert(GrpcMethod::new( 4141 - "rockbox.v1alpha1.PlaylistService", 4142 - "GetFirstIndex", 4143 - )); 4789 + req.extensions_mut() 4790 + .insert( 4791 + GrpcMethod::new("rockbox.v1alpha1.PlaylistService", "GetFirstIndex"), 4792 + ); 4144 4793 self.inner.unary(req, path, codec).await 4145 4794 } 4146 4795 pub async fn get_display_index( 4147 4796 &mut self, 4148 4797 request: impl tonic::IntoRequest<super::GetDisplayIndexRequest>, 4149 - ) -> std::result::Result<tonic::Response<super::GetDisplayIndexResponse>, tonic::Status> 4150 - { 4151 - self.inner.ready().await.map_err(|e| { 4152 - tonic::Status::unknown(format!("Service was not ready: {}", e.into())) 4153 - })?; 4798 + ) -> std::result::Result< 4799 + tonic::Response<super::GetDisplayIndexResponse>, 4800 + tonic::Status, 4801 + > { 4802 + self.inner 4803 + .ready() 4804 + .await 4805 + .map_err(|e| { 4806 + tonic::Status::unknown( 4807 + format!("Service was not ready: {}", e.into()), 4808 + ) 4809 + })?; 4154 4810 let codec = tonic::codec::ProstCodec::default(); 4155 4811 let path = http::uri::PathAndQuery::from_static( 4156 4812 "/rockbox.v1alpha1.PlaylistService/GetDisplayIndex", 4157 4813 ); 4158 4814 let mut req = request.into_request(); 4159 - req.extensions_mut().insert(GrpcMethod::new( 4160 - "rockbox.v1alpha1.PlaylistService", 4161 - "GetDisplayIndex", 4162 - )); 4815 + req.extensions_mut() 4816 + .insert( 4817 + GrpcMethod::new( 4818 + "rockbox.v1alpha1.PlaylistService", 4819 + "GetDisplayIndex", 4820 + ), 4821 + ); 4163 4822 self.inner.unary(req, path, codec).await 4164 4823 } 4165 4824 pub async fn amount( 4166 4825 &mut self, 4167 4826 request: impl tonic::IntoRequest<super::AmountRequest>, 4168 4827 ) -> std::result::Result<tonic::Response<super::AmountResponse>, tonic::Status> { 4169 - self.inner.ready().await.map_err(|e| { 4170 - tonic::Status::unknown(format!("Service was not ready: {}", e.into())) 4171 - })?; 4828 + self.inner 4829 + .ready() 4830 + .await 4831 + .map_err(|e| { 4832 + tonic::Status::unknown( 4833 + format!("Service was not ready: {}", e.into()), 4834 + ) 4835 + })?; 4172 4836 let codec = tonic::codec::ProstCodec::default(); 4173 - let path = 4174 - http::uri::PathAndQuery::from_static("/rockbox.v1alpha1.PlaylistService/Amount"); 4837 + let path = http::uri::PathAndQuery::from_static( 4838 + "/rockbox.v1alpha1.PlaylistService/Amount", 4839 + ); 4175 4840 let mut req = request.into_request(); 4176 - req.extensions_mut().insert(GrpcMethod::new( 4177 - "rockbox.v1alpha1.PlaylistService", 4178 - "Amount", 4179 - )); 4841 + req.extensions_mut() 4842 + .insert(GrpcMethod::new("rockbox.v1alpha1.PlaylistService", "Amount")); 4180 4843 self.inner.unary(req, path, codec).await 4181 4844 } 4182 4845 pub async fn playlist_resume( 4183 4846 &mut self, 4184 4847 request: impl tonic::IntoRequest<super::PlaylistResumeRequest>, 4185 - ) -> std::result::Result<tonic::Response<super::PlaylistResumeResponse>, tonic::Status> 4186 - { 4187 - self.inner.ready().await.map_err(|e| { 4188 - tonic::Status::unknown(format!("Service was not ready: {}", e.into())) 4189 - })?; 4848 + ) -> std::result::Result< 4849 + tonic::Response<super::PlaylistResumeResponse>, 4850 + tonic::Status, 4851 + > { 4852 + self.inner 4853 + .ready() 4854 + .await 4855 + .map_err(|e| { 4856 + tonic::Status::unknown( 4857 + format!("Service was not ready: {}", e.into()), 4858 + ) 4859 + })?; 4190 4860 let codec = tonic::codec::ProstCodec::default(); 4191 4861 let path = http::uri::PathAndQuery::from_static( 4192 4862 "/rockbox.v1alpha1.PlaylistService/PlaylistResume", 4193 4863 ); 4194 4864 let mut req = request.into_request(); 4195 - req.extensions_mut().insert(GrpcMethod::new( 4196 - "rockbox.v1alpha1.PlaylistService", 4197 - "PlaylistResume", 4198 - )); 4865 + req.extensions_mut() 4866 + .insert( 4867 + GrpcMethod::new("rockbox.v1alpha1.PlaylistService", "PlaylistResume"), 4868 + ); 4199 4869 self.inner.unary(req, path, codec).await 4200 4870 } 4201 4871 pub async fn resume_track( 4202 4872 &mut self, 4203 4873 request: impl tonic::IntoRequest<super::ResumeTrackRequest>, 4204 - ) -> std::result::Result<tonic::Response<super::ResumeTrackResponse>, tonic::Status> 4205 - { 4206 - self.inner.ready().await.map_err(|e| { 4207 - tonic::Status::unknown(format!("Service was not ready: {}", e.into())) 4208 - })?; 4874 + ) -> std::result::Result< 4875 + tonic::Response<super::ResumeTrackResponse>, 4876 + tonic::Status, 4877 + > { 4878 + self.inner 4879 + .ready() 4880 + .await 4881 + .map_err(|e| { 4882 + tonic::Status::unknown( 4883 + format!("Service was not ready: {}", e.into()), 4884 + ) 4885 + })?; 4209 4886 let codec = tonic::codec::ProstCodec::default(); 4210 4887 let path = http::uri::PathAndQuery::from_static( 4211 4888 "/rockbox.v1alpha1.PlaylistService/ResumeTrack", 4212 4889 ); 4213 4890 let mut req = request.into_request(); 4214 - req.extensions_mut().insert(GrpcMethod::new( 4215 - "rockbox.v1alpha1.PlaylistService", 4216 - "ResumeTrack", 4217 - )); 4891 + req.extensions_mut() 4892 + .insert( 4893 + GrpcMethod::new("rockbox.v1alpha1.PlaylistService", "ResumeTrack"), 4894 + ); 4218 4895 self.inner.unary(req, path, codec).await 4219 4896 } 4220 4897 pub async fn set_modified( 4221 4898 &mut self, 4222 4899 request: impl tonic::IntoRequest<super::SetModifiedRequest>, 4223 - ) -> std::result::Result<tonic::Response<super::SetModifiedResponse>, tonic::Status> 4224 - { 4225 - self.inner.ready().await.map_err(|e| { 4226 - tonic::Status::unknown(format!("Service was not ready: {}", e.into())) 4227 - })?; 4900 + ) -> std::result::Result< 4901 + tonic::Response<super::SetModifiedResponse>, 4902 + tonic::Status, 4903 + > { 4904 + self.inner 4905 + .ready() 4906 + .await 4907 + .map_err(|e| { 4908 + tonic::Status::unknown( 4909 + format!("Service was not ready: {}", e.into()), 4910 + ) 4911 + })?; 4228 4912 let codec = tonic::codec::ProstCodec::default(); 4229 4913 let path = http::uri::PathAndQuery::from_static( 4230 4914 "/rockbox.v1alpha1.PlaylistService/SetModified", 4231 4915 ); 4232 4916 let mut req = request.into_request(); 4233 - req.extensions_mut().insert(GrpcMethod::new( 4234 - "rockbox.v1alpha1.PlaylistService", 4235 - "SetModified", 4236 - )); 4917 + req.extensions_mut() 4918 + .insert( 4919 + GrpcMethod::new("rockbox.v1alpha1.PlaylistService", "SetModified"), 4920 + ); 4237 4921 self.inner.unary(req, path, codec).await 4238 4922 } 4239 4923 pub async fn start( 4240 4924 &mut self, 4241 4925 request: impl tonic::IntoRequest<super::StartRequest>, 4242 4926 ) -> std::result::Result<tonic::Response<super::StartResponse>, tonic::Status> { 4243 - self.inner.ready().await.map_err(|e| { 4244 - tonic::Status::unknown(format!("Service was not ready: {}", e.into())) 4245 - })?; 4927 + self.inner 4928 + .ready() 4929 + .await 4930 + .map_err(|e| { 4931 + tonic::Status::unknown( 4932 + format!("Service was not ready: {}", e.into()), 4933 + ) 4934 + })?; 4246 4935 let codec = tonic::codec::ProstCodec::default(); 4247 - let path = 4248 - http::uri::PathAndQuery::from_static("/rockbox.v1alpha1.PlaylistService/Start"); 4936 + let path = http::uri::PathAndQuery::from_static( 4937 + "/rockbox.v1alpha1.PlaylistService/Start", 4938 + ); 4249 4939 let mut req = request.into_request(); 4250 4940 req.extensions_mut() 4251 4941 .insert(GrpcMethod::new("rockbox.v1alpha1.PlaylistService", "Start")); ··· 4255 4945 &mut self, 4256 4946 request: impl tonic::IntoRequest<super::SyncRequest>, 4257 4947 ) -> std::result::Result<tonic::Response<super::SyncResponse>, tonic::Status> { 4258 - self.inner.ready().await.map_err(|e| { 4259 - tonic::Status::unknown(format!("Service was not ready: {}", e.into())) 4260 - })?; 4948 + self.inner 4949 + .ready() 4950 + .await 4951 + .map_err(|e| { 4952 + tonic::Status::unknown( 4953 + format!("Service was not ready: {}", e.into()), 4954 + ) 4955 + })?; 4261 4956 let codec = tonic::codec::ProstCodec::default(); 4262 - let path = 4263 - http::uri::PathAndQuery::from_static("/rockbox.v1alpha1.PlaylistService/Sync"); 4957 + let path = http::uri::PathAndQuery::from_static( 4958 + "/rockbox.v1alpha1.PlaylistService/Sync", 4959 + ); 4264 4960 let mut req = request.into_request(); 4265 4961 req.extensions_mut() 4266 4962 .insert(GrpcMethod::new("rockbox.v1alpha1.PlaylistService", "Sync")); ··· 4269 4965 pub async fn remove_all_tracks( 4270 4966 &mut self, 4271 4967 request: impl tonic::IntoRequest<super::RemoveAllTracksRequest>, 4272 - ) -> std::result::Result<tonic::Response<super::RemoveAllTracksResponse>, tonic::Status> 4273 - { 4274 - self.inner.ready().await.map_err(|e| { 4275 - tonic::Status::unknown(format!("Service was not ready: {}", e.into())) 4276 - })?; 4968 + ) -> std::result::Result< 4969 + tonic::Response<super::RemoveAllTracksResponse>, 4970 + tonic::Status, 4971 + > { 4972 + self.inner 4973 + .ready() 4974 + .await 4975 + .map_err(|e| { 4976 + tonic::Status::unknown( 4977 + format!("Service was not ready: {}", e.into()), 4978 + ) 4979 + })?; 4277 4980 let codec = tonic::codec::ProstCodec::default(); 4278 4981 let path = http::uri::PathAndQuery::from_static( 4279 4982 "/rockbox.v1alpha1.PlaylistService/RemoveAllTracks", 4280 4983 ); 4281 4984 let mut req = request.into_request(); 4282 - req.extensions_mut().insert(GrpcMethod::new( 4283 - "rockbox.v1alpha1.PlaylistService", 4284 - "RemoveAllTracks", 4285 - )); 4985 + req.extensions_mut() 4986 + .insert( 4987 + GrpcMethod::new( 4988 + "rockbox.v1alpha1.PlaylistService", 4989 + "RemoveAllTracks", 4990 + ), 4991 + ); 4286 4992 self.inner.unary(req, path, codec).await 4287 4993 } 4288 4994 pub async fn remove_tracks( 4289 4995 &mut self, 4290 4996 request: impl tonic::IntoRequest<super::RemoveTracksRequest>, 4291 - ) -> std::result::Result<tonic::Response<super::RemoveTracksResponse>, tonic::Status> 4292 - { 4293 - self.inner.ready().await.map_err(|e| { 4294 - tonic::Status::unknown(format!("Service was not ready: {}", e.into())) 4295 - })?; 4997 + ) -> std::result::Result< 4998 + tonic::Response<super::RemoveTracksResponse>, 4999 + tonic::Status, 5000 + > { 5001 + self.inner 5002 + .ready() 5003 + .await 5004 + .map_err(|e| { 5005 + tonic::Status::unknown( 5006 + format!("Service was not ready: {}", e.into()), 5007 + ) 5008 + })?; 4296 5009 let codec = tonic::codec::ProstCodec::default(); 4297 5010 let path = http::uri::PathAndQuery::from_static( 4298 5011 "/rockbox.v1alpha1.PlaylistService/RemoveTracks", 4299 5012 ); 4300 5013 let mut req = request.into_request(); 4301 - req.extensions_mut().insert(GrpcMethod::new( 4302 - "rockbox.v1alpha1.PlaylistService", 4303 - "RemoveTracks", 4304 - )); 5014 + req.extensions_mut() 5015 + .insert( 5016 + GrpcMethod::new("rockbox.v1alpha1.PlaylistService", "RemoveTracks"), 5017 + ); 4305 5018 self.inner.unary(req, path, codec).await 4306 5019 } 4307 5020 pub async fn create_playlist( 4308 5021 &mut self, 4309 5022 request: impl tonic::IntoRequest<super::CreatePlaylistRequest>, 4310 - ) -> std::result::Result<tonic::Response<super::CreatePlaylistResponse>, tonic::Status> 4311 - { 4312 - self.inner.ready().await.map_err(|e| { 4313 - tonic::Status::unknown(format!("Service was not ready: {}", e.into())) 4314 - })?; 5023 + ) -> std::result::Result< 5024 + tonic::Response<super::CreatePlaylistResponse>, 5025 + tonic::Status, 5026 + > { 5027 + self.inner 5028 + .ready() 5029 + .await 5030 + .map_err(|e| { 5031 + tonic::Status::unknown( 5032 + format!("Service was not ready: {}", e.into()), 5033 + ) 5034 + })?; 4315 5035 let codec = tonic::codec::ProstCodec::default(); 4316 5036 let path = http::uri::PathAndQuery::from_static( 4317 5037 "/rockbox.v1alpha1.PlaylistService/CreatePlaylist", 4318 5038 ); 4319 5039 let mut req = request.into_request(); 4320 - req.extensions_mut().insert(GrpcMethod::new( 4321 - "rockbox.v1alpha1.PlaylistService", 4322 - "CreatePlaylist", 4323 - )); 5040 + req.extensions_mut() 5041 + .insert( 5042 + GrpcMethod::new("rockbox.v1alpha1.PlaylistService", "CreatePlaylist"), 5043 + ); 4324 5044 self.inner.unary(req, path, codec).await 4325 5045 } 4326 5046 pub async fn insert_tracks( 4327 5047 &mut self, 4328 5048 request: impl tonic::IntoRequest<super::InsertTracksRequest>, 4329 - ) -> std::result::Result<tonic::Response<super::InsertTracksResponse>, tonic::Status> 4330 - { 4331 - self.inner.ready().await.map_err(|e| { 4332 - tonic::Status::unknown(format!("Service was not ready: {}", e.into())) 4333 - })?; 5049 + ) -> std::result::Result< 5050 + tonic::Response<super::InsertTracksResponse>, 5051 + tonic::Status, 5052 + > { 5053 + self.inner 5054 + .ready() 5055 + .await 5056 + .map_err(|e| { 5057 + tonic::Status::unknown( 5058 + format!("Service was not ready: {}", e.into()), 5059 + ) 5060 + })?; 4334 5061 let codec = tonic::codec::ProstCodec::default(); 4335 5062 let path = http::uri::PathAndQuery::from_static( 4336 5063 "/rockbox.v1alpha1.PlaylistService/InsertTracks", 4337 5064 ); 4338 5065 let mut req = request.into_request(); 4339 - req.extensions_mut().insert(GrpcMethod::new( 4340 - "rockbox.v1alpha1.PlaylistService", 4341 - "InsertTracks", 4342 - )); 5066 + req.extensions_mut() 5067 + .insert( 5068 + GrpcMethod::new("rockbox.v1alpha1.PlaylistService", "InsertTracks"), 5069 + ); 4343 5070 self.inner.unary(req, path, codec).await 4344 5071 } 4345 5072 pub async fn insert_directory( 4346 5073 &mut self, 4347 5074 request: impl tonic::IntoRequest<super::InsertDirectoryRequest>, 4348 - ) -> std::result::Result<tonic::Response<super::InsertDirectoryResponse>, tonic::Status> 4349 - { 4350 - self.inner.ready().await.map_err(|e| { 4351 - tonic::Status::unknown(format!("Service was not ready: {}", e.into())) 4352 - })?; 5075 + ) -> std::result::Result< 5076 + tonic::Response<super::InsertDirectoryResponse>, 5077 + tonic::Status, 5078 + > { 5079 + self.inner 5080 + .ready() 5081 + .await 5082 + .map_err(|e| { 5083 + tonic::Status::unknown( 5084 + format!("Service was not ready: {}", e.into()), 5085 + ) 5086 + })?; 4353 5087 let codec = tonic::codec::ProstCodec::default(); 4354 5088 let path = http::uri::PathAndQuery::from_static( 4355 5089 "/rockbox.v1alpha1.PlaylistService/InsertDirectory", 4356 5090 ); 4357 5091 let mut req = request.into_request(); 4358 - req.extensions_mut().insert(GrpcMethod::new( 4359 - "rockbox.v1alpha1.PlaylistService", 4360 - "InsertDirectory", 4361 - )); 5092 + req.extensions_mut() 5093 + .insert( 5094 + GrpcMethod::new( 5095 + "rockbox.v1alpha1.PlaylistService", 5096 + "InsertDirectory", 5097 + ), 5098 + ); 4362 5099 self.inner.unary(req, path, codec).await 4363 5100 } 4364 5101 pub async fn insert_playlist( 4365 5102 &mut self, 4366 5103 request: impl tonic::IntoRequest<super::InsertPlaylistRequest>, 4367 - ) -> std::result::Result<tonic::Response<super::InsertPlaylistResponse>, tonic::Status> 4368 - { 4369 - self.inner.ready().await.map_err(|e| { 4370 - tonic::Status::unknown(format!("Service was not ready: {}", e.into())) 4371 - })?; 5104 + ) -> std::result::Result< 5105 + tonic::Response<super::InsertPlaylistResponse>, 5106 + tonic::Status, 5107 + > { 5108 + self.inner 5109 + .ready() 5110 + .await 5111 + .map_err(|e| { 5112 + tonic::Status::unknown( 5113 + format!("Service was not ready: {}", e.into()), 5114 + ) 5115 + })?; 4372 5116 let codec = tonic::codec::ProstCodec::default(); 4373 5117 let path = http::uri::PathAndQuery::from_static( 4374 5118 "/rockbox.v1alpha1.PlaylistService/InsertPlaylist", 4375 5119 ); 4376 5120 let mut req = request.into_request(); 4377 - req.extensions_mut().insert(GrpcMethod::new( 4378 - "rockbox.v1alpha1.PlaylistService", 4379 - "InsertPlaylist", 4380 - )); 5121 + req.extensions_mut() 5122 + .insert( 5123 + GrpcMethod::new("rockbox.v1alpha1.PlaylistService", "InsertPlaylist"), 5124 + ); 4381 5125 self.inner.unary(req, path, codec).await 4382 5126 } 4383 5127 pub async fn insert_album( 4384 5128 &mut self, 4385 5129 request: impl tonic::IntoRequest<super::InsertAlbumRequest>, 4386 - ) -> std::result::Result<tonic::Response<super::InsertAlbumResponse>, tonic::Status> 4387 - { 4388 - self.inner.ready().await.map_err(|e| { 4389 - tonic::Status::unknown(format!("Service was not ready: {}", e.into())) 4390 - })?; 5130 + ) -> std::result::Result< 5131 + tonic::Response<super::InsertAlbumResponse>, 5132 + tonic::Status, 5133 + > { 5134 + self.inner 5135 + .ready() 5136 + .await 5137 + .map_err(|e| { 5138 + tonic::Status::unknown( 5139 + format!("Service was not ready: {}", e.into()), 5140 + ) 5141 + })?; 4391 5142 let codec = tonic::codec::ProstCodec::default(); 4392 5143 let path = http::uri::PathAndQuery::from_static( 4393 5144 "/rockbox.v1alpha1.PlaylistService/InsertAlbum", 4394 5145 ); 4395 5146 let mut req = request.into_request(); 4396 - req.extensions_mut().insert(GrpcMethod::new( 4397 - "rockbox.v1alpha1.PlaylistService", 4398 - "InsertAlbum", 4399 - )); 5147 + req.extensions_mut() 5148 + .insert( 5149 + GrpcMethod::new("rockbox.v1alpha1.PlaylistService", "InsertAlbum"), 5150 + ); 4400 5151 self.inner.unary(req, path, codec).await 4401 5152 } 4402 5153 pub async fn insert_artist_tracks( 4403 5154 &mut self, 4404 5155 request: impl tonic::IntoRequest<super::InsertArtistTracksRequest>, 4405 - ) -> std::result::Result<tonic::Response<super::InsertArtistTracksResponse>, tonic::Status> 4406 - { 4407 - self.inner.ready().await.map_err(|e| { 4408 - tonic::Status::unknown(format!("Service was not ready: {}", e.into())) 4409 - })?; 5156 + ) -> std::result::Result< 5157 + tonic::Response<super::InsertArtistTracksResponse>, 5158 + tonic::Status, 5159 + > { 5160 + self.inner 5161 + .ready() 5162 + .await 5163 + .map_err(|e| { 5164 + tonic::Status::unknown( 5165 + format!("Service was not ready: {}", e.into()), 5166 + ) 5167 + })?; 4410 5168 let codec = tonic::codec::ProstCodec::default(); 4411 5169 let path = http::uri::PathAndQuery::from_static( 4412 5170 "/rockbox.v1alpha1.PlaylistService/InsertArtistTracks", 4413 5171 ); 4414 5172 let mut req = request.into_request(); 4415 - req.extensions_mut().insert(GrpcMethod::new( 4416 - "rockbox.v1alpha1.PlaylistService", 4417 - "InsertArtistTracks", 4418 - )); 5173 + req.extensions_mut() 5174 + .insert( 5175 + GrpcMethod::new( 5176 + "rockbox.v1alpha1.PlaylistService", 5177 + "InsertArtistTracks", 5178 + ), 5179 + ); 4419 5180 self.inner.unary(req, path, codec).await 4420 5181 } 4421 5182 pub async fn shuffle_playlist( 4422 5183 &mut self, 4423 5184 request: impl tonic::IntoRequest<super::ShufflePlaylistRequest>, 4424 - ) -> std::result::Result<tonic::Response<super::ShufflePlaylistResponse>, tonic::Status> 4425 - { 4426 - self.inner.ready().await.map_err(|e| { 4427 - tonic::Status::unknown(format!("Service was not ready: {}", e.into())) 4428 - })?; 5185 + ) -> std::result::Result< 5186 + tonic::Response<super::ShufflePlaylistResponse>, 5187 + tonic::Status, 5188 + > { 5189 + self.inner 5190 + .ready() 5191 + .await 5192 + .map_err(|e| { 5193 + tonic::Status::unknown( 5194 + format!("Service was not ready: {}", e.into()), 5195 + ) 5196 + })?; 4429 5197 let codec = tonic::codec::ProstCodec::default(); 4430 5198 let path = http::uri::PathAndQuery::from_static( 4431 5199 "/rockbox.v1alpha1.PlaylistService/ShufflePlaylist", 4432 5200 ); 4433 5201 let mut req = request.into_request(); 4434 - req.extensions_mut().insert(GrpcMethod::new( 4435 - "rockbox.v1alpha1.PlaylistService", 4436 - "ShufflePlaylist", 4437 - )); 5202 + req.extensions_mut() 5203 + .insert( 5204 + GrpcMethod::new( 5205 + "rockbox.v1alpha1.PlaylistService", 5206 + "ShufflePlaylist", 5207 + ), 5208 + ); 4438 5209 self.inner.unary(req, path, codec).await 4439 5210 } 4440 5211 } ··· 4446 5217 dead_code, 4447 5218 missing_docs, 4448 5219 clippy::wildcard_imports, 4449 - clippy::let_unit_value 5220 + clippy::let_unit_value, 4450 5221 )] 4451 5222 use tonic::codegen::*; 4452 5223 /// Generated trait containing gRPC methods that should be implemented for use with PlaylistServiceServer. ··· 4455 5226 async fn get_current( 4456 5227 &self, 4457 5228 request: tonic::Request<super::GetCurrentRequest>, 4458 - ) -> std::result::Result<tonic::Response<super::GetCurrentResponse>, tonic::Status>; 5229 + ) -> std::result::Result< 5230 + tonic::Response<super::GetCurrentResponse>, 5231 + tonic::Status, 5232 + >; 4459 5233 async fn get_resume_info( 4460 5234 &self, 4461 5235 request: tonic::Request<super::GetResumeInfoRequest>, 4462 - ) -> std::result::Result<tonic::Response<super::GetResumeInfoResponse>, tonic::Status>; 5236 + ) -> std::result::Result< 5237 + tonic::Response<super::GetResumeInfoResponse>, 5238 + tonic::Status, 5239 + >; 4463 5240 async fn get_track_info( 4464 5241 &self, 4465 5242 request: tonic::Request<super::GetTrackInfoRequest>, 4466 - ) -> std::result::Result<tonic::Response<super::GetTrackInfoResponse>, tonic::Status>; 5243 + ) -> std::result::Result< 5244 + tonic::Response<super::GetTrackInfoResponse>, 5245 + tonic::Status, 5246 + >; 4467 5247 async fn get_first_index( 4468 5248 &self, 4469 5249 request: tonic::Request<super::GetFirstIndexRequest>, 4470 - ) -> std::result::Result<tonic::Response<super::GetFirstIndexResponse>, tonic::Status>; 5250 + ) -> std::result::Result< 5251 + tonic::Response<super::GetFirstIndexResponse>, 5252 + tonic::Status, 5253 + >; 4471 5254 async fn get_display_index( 4472 5255 &self, 4473 5256 request: tonic::Request<super::GetDisplayIndexRequest>, 4474 - ) -> std::result::Result<tonic::Response<super::GetDisplayIndexResponse>, tonic::Status>; 5257 + ) -> std::result::Result< 5258 + tonic::Response<super::GetDisplayIndexResponse>, 5259 + tonic::Status, 5260 + >; 4475 5261 async fn amount( 4476 5262 &self, 4477 5263 request: tonic::Request<super::AmountRequest>, ··· 4479 5265 async fn playlist_resume( 4480 5266 &self, 4481 5267 request: tonic::Request<super::PlaylistResumeRequest>, 4482 - ) -> std::result::Result<tonic::Response<super::PlaylistResumeResponse>, tonic::Status>; 5268 + ) -> std::result::Result< 5269 + tonic::Response<super::PlaylistResumeResponse>, 5270 + tonic::Status, 5271 + >; 4483 5272 async fn resume_track( 4484 5273 &self, 4485 5274 request: tonic::Request<super::ResumeTrackRequest>, 4486 - ) -> std::result::Result<tonic::Response<super::ResumeTrackResponse>, tonic::Status>; 5275 + ) -> std::result::Result< 5276 + tonic::Response<super::ResumeTrackResponse>, 5277 + tonic::Status, 5278 + >; 4487 5279 async fn set_modified( 4488 5280 &self, 4489 5281 request: tonic::Request<super::SetModifiedRequest>, 4490 - ) -> std::result::Result<tonic::Response<super::SetModifiedResponse>, tonic::Status>; 5282 + ) -> std::result::Result< 5283 + tonic::Response<super::SetModifiedResponse>, 5284 + tonic::Status, 5285 + >; 4491 5286 async fn start( 4492 5287 &self, 4493 5288 request: tonic::Request<super::StartRequest>, ··· 4499 5294 async fn remove_all_tracks( 4500 5295 &self, 4501 5296 request: tonic::Request<super::RemoveAllTracksRequest>, 4502 - ) -> std::result::Result<tonic::Response<super::RemoveAllTracksResponse>, tonic::Status>; 5297 + ) -> std::result::Result< 5298 + tonic::Response<super::RemoveAllTracksResponse>, 5299 + tonic::Status, 5300 + >; 4503 5301 async fn remove_tracks( 4504 5302 &self, 4505 5303 request: tonic::Request<super::RemoveTracksRequest>, 4506 - ) -> std::result::Result<tonic::Response<super::RemoveTracksResponse>, tonic::Status>; 5304 + ) -> std::result::Result< 5305 + tonic::Response<super::RemoveTracksResponse>, 5306 + tonic::Status, 5307 + >; 4507 5308 async fn create_playlist( 4508 5309 &self, 4509 5310 request: tonic::Request<super::CreatePlaylistRequest>, 4510 - ) -> std::result::Result<tonic::Response<super::CreatePlaylistResponse>, tonic::Status>; 5311 + ) -> std::result::Result< 5312 + tonic::Response<super::CreatePlaylistResponse>, 5313 + tonic::Status, 5314 + >; 4511 5315 async fn insert_tracks( 4512 5316 &self, 4513 5317 request: tonic::Request<super::InsertTracksRequest>, 4514 - ) -> std::result::Result<tonic::Response<super::InsertTracksResponse>, tonic::Status>; 5318 + ) -> std::result::Result< 5319 + tonic::Response<super::InsertTracksResponse>, 5320 + tonic::Status, 5321 + >; 4515 5322 async fn insert_directory( 4516 5323 &self, 4517 5324 request: tonic::Request<super::InsertDirectoryRequest>, 4518 - ) -> std::result::Result<tonic::Response<super::InsertDirectoryResponse>, tonic::Status>; 5325 + ) -> std::result::Result< 5326 + tonic::Response<super::InsertDirectoryResponse>, 5327 + tonic::Status, 5328 + >; 4519 5329 async fn insert_playlist( 4520 5330 &self, 4521 5331 request: tonic::Request<super::InsertPlaylistRequest>, 4522 - ) -> std::result::Result<tonic::Response<super::InsertPlaylistResponse>, tonic::Status>; 5332 + ) -> std::result::Result< 5333 + tonic::Response<super::InsertPlaylistResponse>, 5334 + tonic::Status, 5335 + >; 4523 5336 async fn insert_album( 4524 5337 &self, 4525 5338 request: tonic::Request<super::InsertAlbumRequest>, 4526 - ) -> std::result::Result<tonic::Response<super::InsertAlbumResponse>, tonic::Status>; 5339 + ) -> std::result::Result< 5340 + tonic::Response<super::InsertAlbumResponse>, 5341 + tonic::Status, 5342 + >; 4527 5343 async fn insert_artist_tracks( 4528 5344 &self, 4529 5345 request: tonic::Request<super::InsertArtistTracksRequest>, 4530 - ) -> std::result::Result<tonic::Response<super::InsertArtistTracksResponse>, tonic::Status>; 5346 + ) -> std::result::Result< 5347 + tonic::Response<super::InsertArtistTracksResponse>, 5348 + tonic::Status, 5349 + >; 4531 5350 async fn shuffle_playlist( 4532 5351 &self, 4533 5352 request: tonic::Request<super::ShufflePlaylistRequest>, 4534 - ) -> std::result::Result<tonic::Response<super::ShufflePlaylistResponse>, tonic::Status>; 5353 + ) -> std::result::Result< 5354 + tonic::Response<super::ShufflePlaylistResponse>, 5355 + tonic::Status, 5356 + >; 4535 5357 } 4536 5358 #[derive(Debug)] 4537 5359 pub struct PlaylistServiceServer<T> { ··· 4554 5376 max_encoding_message_size: None, 4555 5377 } 4556 5378 } 4557 - pub fn with_interceptor<F>(inner: T, interceptor: F) -> InterceptedService<Self, F> 5379 + pub fn with_interceptor<F>( 5380 + inner: T, 5381 + interceptor: F, 5382 + ) -> InterceptedService<Self, F> 4558 5383 where 4559 5384 F: tonic::service::Interceptor, 4560 5385 { ··· 4609 5434 "/rockbox.v1alpha1.PlaylistService/GetCurrent" => { 4610 5435 #[allow(non_camel_case_types)] 4611 5436 struct GetCurrentSvc<T: PlaylistService>(pub Arc<T>); 4612 - impl<T: PlaylistService> tonic::server::UnaryService<super::GetCurrentRequest> 4613 - for GetCurrentSvc<T> 4614 - { 5437 + impl< 5438 + T: PlaylistService, 5439 + > tonic::server::UnaryService<super::GetCurrentRequest> 5440 + for GetCurrentSvc<T> { 4615 5441 type Response = super::GetCurrentResponse; 4616 - type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>; 5442 + type Future = BoxFuture< 5443 + tonic::Response<Self::Response>, 5444 + tonic::Status, 5445 + >; 4617 5446 fn call( 4618 5447 &mut self, 4619 5448 request: tonic::Request<super::GetCurrentRequest>, ··· 4650 5479 "/rockbox.v1alpha1.PlaylistService/GetResumeInfo" => { 4651 5480 #[allow(non_camel_case_types)] 4652 5481 struct GetResumeInfoSvc<T: PlaylistService>(pub Arc<T>); 4653 - impl<T: PlaylistService> 4654 - tonic::server::UnaryService<super::GetResumeInfoRequest> 4655 - for GetResumeInfoSvc<T> 4656 - { 5482 + impl< 5483 + T: PlaylistService, 5484 + > tonic::server::UnaryService<super::GetResumeInfoRequest> 5485 + for GetResumeInfoSvc<T> { 4657 5486 type Response = super::GetResumeInfoResponse; 4658 - type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>; 5487 + type Future = BoxFuture< 5488 + tonic::Response<Self::Response>, 5489 + tonic::Status, 5490 + >; 4659 5491 fn call( 4660 5492 &mut self, 4661 5493 request: tonic::Request<super::GetResumeInfoRequest>, 4662 5494 ) -> Self::Future { 4663 5495 let inner = Arc::clone(&self.0); 4664 5496 let fut = async move { 4665 - <T as PlaylistService>::get_resume_info(&inner, request).await 5497 + <T as PlaylistService>::get_resume_info(&inner, request) 5498 + .await 4666 5499 }; 4667 5500 Box::pin(fut) 4668 5501 } ··· 4692 5525 "/rockbox.v1alpha1.PlaylistService/GetTrackInfo" => { 4693 5526 #[allow(non_camel_case_types)] 4694 5527 struct GetTrackInfoSvc<T: PlaylistService>(pub Arc<T>); 4695 - impl<T: PlaylistService> tonic::server::UnaryService<super::GetTrackInfoRequest> 4696 - for GetTrackInfoSvc<T> 4697 - { 5528 + impl< 5529 + T: PlaylistService, 5530 + > tonic::server::UnaryService<super::GetTrackInfoRequest> 5531 + for GetTrackInfoSvc<T> { 4698 5532 type Response = super::GetTrackInfoResponse; 4699 - type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>; 5533 + type Future = BoxFuture< 5534 + tonic::Response<Self::Response>, 5535 + tonic::Status, 5536 + >; 4700 5537 fn call( 4701 5538 &mut self, 4702 5539 request: tonic::Request<super::GetTrackInfoRequest>, 4703 5540 ) -> Self::Future { 4704 5541 let inner = Arc::clone(&self.0); 4705 5542 let fut = async move { 4706 - <T as PlaylistService>::get_track_info(&inner, request).await 5543 + <T as PlaylistService>::get_track_info(&inner, request) 5544 + .await 4707 5545 }; 4708 5546 Box::pin(fut) 4709 5547 } ··· 4733 5571 "/rockbox.v1alpha1.PlaylistService/GetFirstIndex" => { 4734 5572 #[allow(non_camel_case_types)] 4735 5573 struct GetFirstIndexSvc<T: PlaylistService>(pub Arc<T>); 4736 - impl<T: PlaylistService> 4737 - tonic::server::UnaryService<super::GetFirstIndexRequest> 4738 - for GetFirstIndexSvc<T> 4739 - { 5574 + impl< 5575 + T: PlaylistService, 5576 + > tonic::server::UnaryService<super::GetFirstIndexRequest> 5577 + for GetFirstIndexSvc<T> { 4740 5578 type Response = super::GetFirstIndexResponse; 4741 - type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>; 5579 + type Future = BoxFuture< 5580 + tonic::Response<Self::Response>, 5581 + tonic::Status, 5582 + >; 4742 5583 fn call( 4743 5584 &mut self, 4744 5585 request: tonic::Request<super::GetFirstIndexRequest>, 4745 5586 ) -> Self::Future { 4746 5587 let inner = Arc::clone(&self.0); 4747 5588 let fut = async move { 4748 - <T as PlaylistService>::get_first_index(&inner, request).await 5589 + <T as PlaylistService>::get_first_index(&inner, request) 5590 + .await 4749 5591 }; 4750 5592 Box::pin(fut) 4751 5593 } ··· 4775 5617 "/rockbox.v1alpha1.PlaylistService/GetDisplayIndex" => { 4776 5618 #[allow(non_camel_case_types)] 4777 5619 struct GetDisplayIndexSvc<T: PlaylistService>(pub Arc<T>); 4778 - impl<T: PlaylistService> 4779 - tonic::server::UnaryService<super::GetDisplayIndexRequest> 4780 - for GetDisplayIndexSvc<T> 4781 - { 5620 + impl< 5621 + T: PlaylistService, 5622 + > tonic::server::UnaryService<super::GetDisplayIndexRequest> 5623 + for GetDisplayIndexSvc<T> { 4782 5624 type Response = super::GetDisplayIndexResponse; 4783 - type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>; 5625 + type Future = BoxFuture< 5626 + tonic::Response<Self::Response>, 5627 + tonic::Status, 5628 + >; 4784 5629 fn call( 4785 5630 &mut self, 4786 5631 request: tonic::Request<super::GetDisplayIndexRequest>, 4787 5632 ) -> Self::Future { 4788 5633 let inner = Arc::clone(&self.0); 4789 5634 let fut = async move { 4790 - <T as PlaylistService>::get_display_index(&inner, request).await 5635 + <T as PlaylistService>::get_display_index(&inner, request) 5636 + .await 4791 5637 }; 4792 5638 Box::pin(fut) 4793 5639 } ··· 4817 5663 "/rockbox.v1alpha1.PlaylistService/Amount" => { 4818 5664 #[allow(non_camel_case_types)] 4819 5665 struct AmountSvc<T: PlaylistService>(pub Arc<T>); 4820 - impl<T: PlaylistService> tonic::server::UnaryService<super::AmountRequest> for AmountSvc<T> { 5666 + impl< 5667 + T: PlaylistService, 5668 + > tonic::server::UnaryService<super::AmountRequest> 5669 + for AmountSvc<T> { 4821 5670 type Response = super::AmountResponse; 4822 - type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>; 5671 + type Future = BoxFuture< 5672 + tonic::Response<Self::Response>, 5673 + tonic::Status, 5674 + >; 4823 5675 fn call( 4824 5676 &mut self, 4825 5677 request: tonic::Request<super::AmountRequest>, ··· 4856 5708 "/rockbox.v1alpha1.PlaylistService/PlaylistResume" => { 4857 5709 #[allow(non_camel_case_types)] 4858 5710 struct PlaylistResumeSvc<T: PlaylistService>(pub Arc<T>); 4859 - impl<T: PlaylistService> 4860 - tonic::server::UnaryService<super::PlaylistResumeRequest> 4861 - for PlaylistResumeSvc<T> 4862 - { 5711 + impl< 5712 + T: PlaylistService, 5713 + > tonic::server::UnaryService<super::PlaylistResumeRequest> 5714 + for PlaylistResumeSvc<T> { 4863 5715 type Response = super::PlaylistResumeResponse; 4864 - type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>; 5716 + type Future = BoxFuture< 5717 + tonic::Response<Self::Response>, 5718 + tonic::Status, 5719 + >; 4865 5720 fn call( 4866 5721 &mut self, 4867 5722 request: tonic::Request<super::PlaylistResumeRequest>, 4868 5723 ) -> Self::Future { 4869 5724 let inner = Arc::clone(&self.0); 4870 5725 let fut = async move { 4871 - <T as PlaylistService>::playlist_resume(&inner, request).await 5726 + <T as PlaylistService>::playlist_resume(&inner, request) 5727 + .await 4872 5728 }; 4873 5729 Box::pin(fut) 4874 5730 } ··· 4898 5754 "/rockbox.v1alpha1.PlaylistService/ResumeTrack" => { 4899 5755 #[allow(non_camel_case_types)] 4900 5756 struct ResumeTrackSvc<T: PlaylistService>(pub Arc<T>); 4901 - impl<T: PlaylistService> tonic::server::UnaryService<super::ResumeTrackRequest> 4902 - for ResumeTrackSvc<T> 4903 - { 5757 + impl< 5758 + T: PlaylistService, 5759 + > tonic::server::UnaryService<super::ResumeTrackRequest> 5760 + for ResumeTrackSvc<T> { 4904 5761 type Response = super::ResumeTrackResponse; 4905 - type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>; 5762 + type Future = BoxFuture< 5763 + tonic::Response<Self::Response>, 5764 + tonic::Status, 5765 + >; 4906 5766 fn call( 4907 5767 &mut self, 4908 5768 request: tonic::Request<super::ResumeTrackRequest>, ··· 4939 5799 "/rockbox.v1alpha1.PlaylistService/SetModified" => { 4940 5800 #[allow(non_camel_case_types)] 4941 5801 struct SetModifiedSvc<T: PlaylistService>(pub Arc<T>); 4942 - impl<T: PlaylistService> tonic::server::UnaryService<super::SetModifiedRequest> 4943 - for SetModifiedSvc<T> 4944 - { 5802 + impl< 5803 + T: PlaylistService, 5804 + > tonic::server::UnaryService<super::SetModifiedRequest> 5805 + for SetModifiedSvc<T> { 4945 5806 type Response = super::SetModifiedResponse; 4946 - type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>; 5807 + type Future = BoxFuture< 5808 + tonic::Response<Self::Response>, 5809 + tonic::Status, 5810 + >; 4947 5811 fn call( 4948 5812 &mut self, 4949 5813 request: tonic::Request<super::SetModifiedRequest>, ··· 4980 5844 "/rockbox.v1alpha1.PlaylistService/Start" => { 4981 5845 #[allow(non_camel_case_types)] 4982 5846 struct StartSvc<T: PlaylistService>(pub Arc<T>); 4983 - impl<T: PlaylistService> tonic::server::UnaryService<super::StartRequest> for StartSvc<T> { 5847 + impl< 5848 + T: PlaylistService, 5849 + > tonic::server::UnaryService<super::StartRequest> for StartSvc<T> { 4984 5850 type Response = super::StartResponse; 4985 - type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>; 5851 + type Future = BoxFuture< 5852 + tonic::Response<Self::Response>, 5853 + tonic::Status, 5854 + >; 4986 5855 fn call( 4987 5856 &mut self, 4988 5857 request: tonic::Request<super::StartRequest>, 4989 5858 ) -> Self::Future { 4990 5859 let inner = Arc::clone(&self.0); 4991 - let fut = 4992 - async move { <T as PlaylistService>::start(&inner, request).await }; 5860 + let fut = async move { 5861 + <T as PlaylistService>::start(&inner, request).await 5862 + }; 4993 5863 Box::pin(fut) 4994 5864 } 4995 5865 } ··· 5018 5888 "/rockbox.v1alpha1.PlaylistService/Sync" => { 5019 5889 #[allow(non_camel_case_types)] 5020 5890 struct SyncSvc<T: PlaylistService>(pub Arc<T>); 5021 - impl<T: PlaylistService> tonic::server::UnaryService<super::SyncRequest> for SyncSvc<T> { 5891 + impl< 5892 + T: PlaylistService, 5893 + > tonic::server::UnaryService<super::SyncRequest> for SyncSvc<T> { 5022 5894 type Response = super::SyncResponse; 5023 - type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>; 5895 + type Future = BoxFuture< 5896 + tonic::Response<Self::Response>, 5897 + tonic::Status, 5898 + >; 5024 5899 fn call( 5025 5900 &mut self, 5026 5901 request: tonic::Request<super::SyncRequest>, 5027 5902 ) -> Self::Future { 5028 5903 let inner = Arc::clone(&self.0); 5029 - let fut = 5030 - async move { <T as PlaylistService>::sync(&inner, request).await }; 5904 + let fut = async move { 5905 + <T as PlaylistService>::sync(&inner, request).await 5906 + }; 5031 5907 Box::pin(fut) 5032 5908 } 5033 5909 } ··· 5056 5932 "/rockbox.v1alpha1.PlaylistService/RemoveAllTracks" => { 5057 5933 #[allow(non_camel_case_types)] 5058 5934 struct RemoveAllTracksSvc<T: PlaylistService>(pub Arc<T>); 5059 - impl<T: PlaylistService> 5060 - tonic::server::UnaryService<super::RemoveAllTracksRequest> 5061 - for RemoveAllTracksSvc<T> 5062 - { 5935 + impl< 5936 + T: PlaylistService, 5937 + > tonic::server::UnaryService<super::RemoveAllTracksRequest> 5938 + for RemoveAllTracksSvc<T> { 5063 5939 type Response = super::RemoveAllTracksResponse; 5064 - type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>; 5940 + type Future = BoxFuture< 5941 + tonic::Response<Self::Response>, 5942 + tonic::Status, 5943 + >; 5065 5944 fn call( 5066 5945 &mut self, 5067 5946 request: tonic::Request<super::RemoveAllTracksRequest>, 5068 5947 ) -> Self::Future { 5069 5948 let inner = Arc::clone(&self.0); 5070 5949 let fut = async move { 5071 - <T as PlaylistService>::remove_all_tracks(&inner, request).await 5950 + <T as PlaylistService>::remove_all_tracks(&inner, request) 5951 + .await 5072 5952 }; 5073 5953 Box::pin(fut) 5074 5954 } ··· 5098 5978 "/rockbox.v1alpha1.PlaylistService/RemoveTracks" => { 5099 5979 #[allow(non_camel_case_types)] 5100 5980 struct RemoveTracksSvc<T: PlaylistService>(pub Arc<T>); 5101 - impl<T: PlaylistService> tonic::server::UnaryService<super::RemoveTracksRequest> 5102 - for RemoveTracksSvc<T> 5103 - { 5981 + impl< 5982 + T: PlaylistService, 5983 + > tonic::server::UnaryService<super::RemoveTracksRequest> 5984 + for RemoveTracksSvc<T> { 5104 5985 type Response = super::RemoveTracksResponse; 5105 - type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>; 5986 + type Future = BoxFuture< 5987 + tonic::Response<Self::Response>, 5988 + tonic::Status, 5989 + >; 5106 5990 fn call( 5107 5991 &mut self, 5108 5992 request: tonic::Request<super::RemoveTracksRequest>, ··· 5139 6023 "/rockbox.v1alpha1.PlaylistService/CreatePlaylist" => { 5140 6024 #[allow(non_camel_case_types)] 5141 6025 struct CreatePlaylistSvc<T: PlaylistService>(pub Arc<T>); 5142 - impl<T: PlaylistService> 5143 - tonic::server::UnaryService<super::CreatePlaylistRequest> 5144 - for CreatePlaylistSvc<T> 5145 - { 6026 + impl< 6027 + T: PlaylistService, 6028 + > tonic::server::UnaryService<super::CreatePlaylistRequest> 6029 + for CreatePlaylistSvc<T> { 5146 6030 type Response = super::CreatePlaylistResponse; 5147 - type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>; 6031 + type Future = BoxFuture< 6032 + tonic::Response<Self::Response>, 6033 + tonic::Status, 6034 + >; 5148 6035 fn call( 5149 6036 &mut self, 5150 6037 request: tonic::Request<super::CreatePlaylistRequest>, 5151 6038 ) -> Self::Future { 5152 6039 let inner = Arc::clone(&self.0); 5153 6040 let fut = async move { 5154 - <T as PlaylistService>::create_playlist(&inner, request).await 6041 + <T as PlaylistService>::create_playlist(&inner, request) 6042 + .await 5155 6043 }; 5156 6044 Box::pin(fut) 5157 6045 } ··· 5181 6069 "/rockbox.v1alpha1.PlaylistService/InsertTracks" => { 5182 6070 #[allow(non_camel_case_types)] 5183 6071 struct InsertTracksSvc<T: PlaylistService>(pub Arc<T>); 5184 - impl<T: PlaylistService> tonic::server::UnaryService<super::InsertTracksRequest> 5185 - for InsertTracksSvc<T> 5186 - { 6072 + impl< 6073 + T: PlaylistService, 6074 + > tonic::server::UnaryService<super::InsertTracksRequest> 6075 + for InsertTracksSvc<T> { 5187 6076 type Response = super::InsertTracksResponse; 5188 - type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>; 6077 + type Future = BoxFuture< 6078 + tonic::Response<Self::Response>, 6079 + tonic::Status, 6080 + >; 5189 6081 fn call( 5190 6082 &mut self, 5191 6083 request: tonic::Request<super::InsertTracksRequest>, ··· 5222 6114 "/rockbox.v1alpha1.PlaylistService/InsertDirectory" => { 5223 6115 #[allow(non_camel_case_types)] 5224 6116 struct InsertDirectorySvc<T: PlaylistService>(pub Arc<T>); 5225 - impl<T: PlaylistService> 5226 - tonic::server::UnaryService<super::InsertDirectoryRequest> 5227 - for InsertDirectorySvc<T> 5228 - { 6117 + impl< 6118 + T: PlaylistService, 6119 + > tonic::server::UnaryService<super::InsertDirectoryRequest> 6120 + for InsertDirectorySvc<T> { 5229 6121 type Response = super::InsertDirectoryResponse; 5230 - type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>; 6122 + type Future = BoxFuture< 6123 + tonic::Response<Self::Response>, 6124 + tonic::Status, 6125 + >; 5231 6126 fn call( 5232 6127 &mut self, 5233 6128 request: tonic::Request<super::InsertDirectoryRequest>, 5234 6129 ) -> Self::Future { 5235 6130 let inner = Arc::clone(&self.0); 5236 6131 let fut = async move { 5237 - <T as PlaylistService>::insert_directory(&inner, request).await 6132 + <T as PlaylistService>::insert_directory(&inner, request) 6133 + .await 5238 6134 }; 5239 6135 Box::pin(fut) 5240 6136 } ··· 5264 6160 "/rockbox.v1alpha1.PlaylistService/InsertPlaylist" => { 5265 6161 #[allow(non_camel_case_types)] 5266 6162 struct InsertPlaylistSvc<T: PlaylistService>(pub Arc<T>); 5267 - impl<T: PlaylistService> 5268 - tonic::server::UnaryService<super::InsertPlaylistRequest> 5269 - for InsertPlaylistSvc<T> 5270 - { 6163 + impl< 6164 + T: PlaylistService, 6165 + > tonic::server::UnaryService<super::InsertPlaylistRequest> 6166 + for InsertPlaylistSvc<T> { 5271 6167 type Response = super::InsertPlaylistResponse; 5272 - type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>; 6168 + type Future = BoxFuture< 6169 + tonic::Response<Self::Response>, 6170 + tonic::Status, 6171 + >; 5273 6172 fn call( 5274 6173 &mut self, 5275 6174 request: tonic::Request<super::InsertPlaylistRequest>, 5276 6175 ) -> Self::Future { 5277 6176 let inner = Arc::clone(&self.0); 5278 6177 let fut = async move { 5279 - <T as PlaylistService>::insert_playlist(&inner, request).await 6178 + <T as PlaylistService>::insert_playlist(&inner, request) 6179 + .await 5280 6180 }; 5281 6181 Box::pin(fut) 5282 6182 } ··· 5306 6206 "/rockbox.v1alpha1.PlaylistService/InsertAlbum" => { 5307 6207 #[allow(non_camel_case_types)] 5308 6208 struct InsertAlbumSvc<T: PlaylistService>(pub Arc<T>); 5309 - impl<T: PlaylistService> tonic::server::UnaryService<super::InsertAlbumRequest> 5310 - for InsertAlbumSvc<T> 5311 - { 6209 + impl< 6210 + T: PlaylistService, 6211 + > tonic::server::UnaryService<super::InsertAlbumRequest> 6212 + for InsertAlbumSvc<T> { 5312 6213 type Response = super::InsertAlbumResponse; 5313 - type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>; 6214 + type Future = BoxFuture< 6215 + tonic::Response<Self::Response>, 6216 + tonic::Status, 6217 + >; 5314 6218 fn call( 5315 6219 &mut self, 5316 6220 request: tonic::Request<super::InsertAlbumRequest>, ··· 5347 6251 "/rockbox.v1alpha1.PlaylistService/InsertArtistTracks" => { 5348 6252 #[allow(non_camel_case_types)] 5349 6253 struct InsertArtistTracksSvc<T: PlaylistService>(pub Arc<T>); 5350 - impl<T: PlaylistService> 5351 - tonic::server::UnaryService<super::InsertArtistTracksRequest> 5352 - for InsertArtistTracksSvc<T> 5353 - { 6254 + impl< 6255 + T: PlaylistService, 6256 + > tonic::server::UnaryService<super::InsertArtistTracksRequest> 6257 + for InsertArtistTracksSvc<T> { 5354 6258 type Response = super::InsertArtistTracksResponse; 5355 - type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>; 6259 + type Future = BoxFuture< 6260 + tonic::Response<Self::Response>, 6261 + tonic::Status, 6262 + >; 5356 6263 fn call( 5357 6264 &mut self, 5358 6265 request: tonic::Request<super::InsertArtistTracksRequest>, 5359 6266 ) -> Self::Future { 5360 6267 let inner = Arc::clone(&self.0); 5361 6268 let fut = async move { 5362 - <T as PlaylistService>::insert_artist_tracks(&inner, request).await 6269 + <T as PlaylistService>::insert_artist_tracks( 6270 + &inner, 6271 + request, 6272 + ) 6273 + .await 5363 6274 }; 5364 6275 Box::pin(fut) 5365 6276 } ··· 5389 6300 "/rockbox.v1alpha1.PlaylistService/ShufflePlaylist" => { 5390 6301 #[allow(non_camel_case_types)] 5391 6302 struct ShufflePlaylistSvc<T: PlaylistService>(pub Arc<T>); 5392 - impl<T: PlaylistService> 5393 - tonic::server::UnaryService<super::ShufflePlaylistRequest> 5394 - for ShufflePlaylistSvc<T> 5395 - { 6303 + impl< 6304 + T: PlaylistService, 6305 + > tonic::server::UnaryService<super::ShufflePlaylistRequest> 6306 + for ShufflePlaylistSvc<T> { 5396 6307 type Response = super::ShufflePlaylistResponse; 5397 - type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>; 6308 + type Future = BoxFuture< 6309 + tonic::Response<Self::Response>, 6310 + tonic::Status, 6311 + >; 5398 6312 fn call( 5399 6313 &mut self, 5400 6314 request: tonic::Request<super::ShufflePlaylistRequest>, 5401 6315 ) -> Self::Future { 5402 6316 let inner = Arc::clone(&self.0); 5403 6317 let fut = async move { 5404 - <T as PlaylistService>::shuffle_playlist(&inner, request).await 6318 + <T as PlaylistService>::shuffle_playlist(&inner, request) 6319 + .await 5405 6320 }; 5406 6321 Box::pin(fut) 5407 6322 } ··· 5428 6343 }; 5429 6344 Box::pin(fut) 5430 6345 } 5431 - _ => Box::pin(async move { 5432 - let mut response = http::Response::new(empty_body()); 5433 - let headers = response.headers_mut(); 5434 - headers.insert( 5435 - tonic::Status::GRPC_STATUS, 5436 - (tonic::Code::Unimplemented as i32).into(), 5437 - ); 5438 - headers.insert( 5439 - http::header::CONTENT_TYPE, 5440 - tonic::metadata::GRPC_CONTENT_TYPE, 5441 - ); 5442 - Ok(response) 5443 - }), 6346 + _ => { 6347 + Box::pin(async move { 6348 + let mut response = http::Response::new(empty_body()); 6349 + let headers = response.headers_mut(); 6350 + headers 6351 + .insert( 6352 + tonic::Status::GRPC_STATUS, 6353 + (tonic::Code::Unimplemented as i32).into(), 6354 + ); 6355 + headers 6356 + .insert( 6357 + http::header::CONTENT_TYPE, 6358 + tonic::metadata::GRPC_CONTENT_TYPE, 6359 + ); 6360 + Ok(response) 6361 + }) 6362 + } 5444 6363 } 5445 6364 } 5446 6365 } ··· 5950 6869 dead_code, 5951 6870 missing_docs, 5952 6871 clippy::wildcard_imports, 5953 - clippy::let_unit_value 6872 + clippy::let_unit_value, 5954 6873 )] 5955 - use tonic::codegen::http::Uri; 5956 6874 use tonic::codegen::*; 6875 + use tonic::codegen::http::Uri; 5957 6876 #[derive(Debug, Clone)] 5958 6877 pub struct SettingsServiceClient<T> { 5959 6878 inner: tonic::client::Grpc<T>, ··· 5997 6916 <T as tonic::client::GrpcService<tonic::body::BoxBody>>::ResponseBody, 5998 6917 >, 5999 6918 >, 6000 - <T as tonic::codegen::Service<http::Request<tonic::body::BoxBody>>>::Error: 6001 - Into<StdError> + std::marker::Send + std::marker::Sync, 6919 + <T as tonic::codegen::Service< 6920 + http::Request<tonic::body::BoxBody>, 6921 + >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync, 6002 6922 { 6003 6923 SettingsServiceClient::new(InterceptedService::new(inner, interceptor)) 6004 6924 } ··· 6036 6956 pub async fn get_settings_list( 6037 6957 &mut self, 6038 6958 request: impl tonic::IntoRequest<super::GetSettingsListRequest>, 6039 - ) -> std::result::Result<tonic::Response<super::GetSettingsListResponse>, tonic::Status> 6040 - { 6041 - self.inner.ready().await.map_err(|e| { 6042 - tonic::Status::unknown(format!("Service was not ready: {}", e.into())) 6043 - })?; 6959 + ) -> std::result::Result< 6960 + tonic::Response<super::GetSettingsListResponse>, 6961 + tonic::Status, 6962 + > { 6963 + self.inner 6964 + .ready() 6965 + .await 6966 + .map_err(|e| { 6967 + tonic::Status::unknown( 6968 + format!("Service was not ready: {}", e.into()), 6969 + ) 6970 + })?; 6044 6971 let codec = tonic::codec::ProstCodec::default(); 6045 6972 let path = http::uri::PathAndQuery::from_static( 6046 6973 "/rockbox.v1alpha1.SettingsService/GetSettingsList", 6047 6974 ); 6048 6975 let mut req = request.into_request(); 6049 - req.extensions_mut().insert(GrpcMethod::new( 6050 - "rockbox.v1alpha1.SettingsService", 6051 - "GetSettingsList", 6052 - )); 6976 + req.extensions_mut() 6977 + .insert( 6978 + GrpcMethod::new( 6979 + "rockbox.v1alpha1.SettingsService", 6980 + "GetSettingsList", 6981 + ), 6982 + ); 6053 6983 self.inner.unary(req, path, codec).await 6054 6984 } 6055 6985 pub async fn get_global_settings( 6056 6986 &mut self, 6057 6987 request: impl tonic::IntoRequest<super::GetGlobalSettingsRequest>, 6058 - ) -> std::result::Result<tonic::Response<super::GetGlobalSettingsResponse>, tonic::Status> 6059 - { 6060 - self.inner.ready().await.map_err(|e| { 6061 - tonic::Status::unknown(format!("Service was not ready: {}", e.into())) 6062 - })?; 6988 + ) -> std::result::Result< 6989 + tonic::Response<super::GetGlobalSettingsResponse>, 6990 + tonic::Status, 6991 + > { 6992 + self.inner 6993 + .ready() 6994 + .await 6995 + .map_err(|e| { 6996 + tonic::Status::unknown( 6997 + format!("Service was not ready: {}", e.into()), 6998 + ) 6999 + })?; 6063 7000 let codec = tonic::codec::ProstCodec::default(); 6064 7001 let path = http::uri::PathAndQuery::from_static( 6065 7002 "/rockbox.v1alpha1.SettingsService/GetGlobalSettings", 6066 7003 ); 6067 7004 let mut req = request.into_request(); 6068 - req.extensions_mut().insert(GrpcMethod::new( 6069 - "rockbox.v1alpha1.SettingsService", 6070 - "GetGlobalSettings", 6071 - )); 7005 + req.extensions_mut() 7006 + .insert( 7007 + GrpcMethod::new( 7008 + "rockbox.v1alpha1.SettingsService", 7009 + "GetGlobalSettings", 7010 + ), 7011 + ); 6072 7012 self.inner.unary(req, path, codec).await 6073 7013 } 6074 7014 pub async fn save_settings( 6075 7015 &mut self, 6076 7016 request: impl tonic::IntoRequest<super::SaveSettingsRequest>, 6077 - ) -> std::result::Result<tonic::Response<super::SaveSettingsResponse>, tonic::Status> 6078 - { 6079 - self.inner.ready().await.map_err(|e| { 6080 - tonic::Status::unknown(format!("Service was not ready: {}", e.into())) 6081 - })?; 7017 + ) -> std::result::Result< 7018 + tonic::Response<super::SaveSettingsResponse>, 7019 + tonic::Status, 7020 + > { 7021 + self.inner 7022 + .ready() 7023 + .await 7024 + .map_err(|e| { 7025 + tonic::Status::unknown( 7026 + format!("Service was not ready: {}", e.into()), 7027 + ) 7028 + })?; 6082 7029 let codec = tonic::codec::ProstCodec::default(); 6083 7030 let path = http::uri::PathAndQuery::from_static( 6084 7031 "/rockbox.v1alpha1.SettingsService/SaveSettings", 6085 7032 ); 6086 7033 let mut req = request.into_request(); 6087 - req.extensions_mut().insert(GrpcMethod::new( 6088 - "rockbox.v1alpha1.SettingsService", 6089 - "SaveSettings", 6090 - )); 7034 + req.extensions_mut() 7035 + .insert( 7036 + GrpcMethod::new("rockbox.v1alpha1.SettingsService", "SaveSettings"), 7037 + ); 6091 7038 self.inner.unary(req, path, codec).await 6092 7039 } 6093 7040 } ··· 6099 7046 dead_code, 6100 7047 missing_docs, 6101 7048 clippy::wildcard_imports, 6102 - clippy::let_unit_value 7049 + clippy::let_unit_value, 6103 7050 )] 6104 7051 use tonic::codegen::*; 6105 7052 /// Generated trait containing gRPC methods that should be implemented for use with SettingsServiceServer. ··· 6108 7055 async fn get_settings_list( 6109 7056 &self, 6110 7057 request: tonic::Request<super::GetSettingsListRequest>, 6111 - ) -> std::result::Result<tonic::Response<super::GetSettingsListResponse>, tonic::Status>; 7058 + ) -> std::result::Result< 7059 + tonic::Response<super::GetSettingsListResponse>, 7060 + tonic::Status, 7061 + >; 6112 7062 async fn get_global_settings( 6113 7063 &self, 6114 7064 request: tonic::Request<super::GetGlobalSettingsRequest>, 6115 - ) -> std::result::Result<tonic::Response<super::GetGlobalSettingsResponse>, tonic::Status>; 7065 + ) -> std::result::Result< 7066 + tonic::Response<super::GetGlobalSettingsResponse>, 7067 + tonic::Status, 7068 + >; 6116 7069 async fn save_settings( 6117 7070 &self, 6118 7071 request: tonic::Request<super::SaveSettingsRequest>, 6119 - ) -> std::result::Result<tonic::Response<super::SaveSettingsResponse>, tonic::Status>; 7072 + ) -> std::result::Result< 7073 + tonic::Response<super::SaveSettingsResponse>, 7074 + tonic::Status, 7075 + >; 6120 7076 } 6121 7077 #[derive(Debug)] 6122 7078 pub struct SettingsServiceServer<T> { ··· 6139 7095 max_encoding_message_size: None, 6140 7096 } 6141 7097 } 6142 - pub fn with_interceptor<F>(inner: T, interceptor: F) -> InterceptedService<Self, F> 7098 + pub fn with_interceptor<F>( 7099 + inner: T, 7100 + interceptor: F, 7101 + ) -> InterceptedService<Self, F> 6143 7102 where 6144 7103 F: tonic::service::Interceptor, 6145 7104 { ··· 6194 7153 "/rockbox.v1alpha1.SettingsService/GetSettingsList" => { 6195 7154 #[allow(non_camel_case_types)] 6196 7155 struct GetSettingsListSvc<T: SettingsService>(pub Arc<T>); 6197 - impl<T: SettingsService> 6198 - tonic::server::UnaryService<super::GetSettingsListRequest> 6199 - for GetSettingsListSvc<T> 6200 - { 7156 + impl< 7157 + T: SettingsService, 7158 + > tonic::server::UnaryService<super::GetSettingsListRequest> 7159 + for GetSettingsListSvc<T> { 6201 7160 type Response = super::GetSettingsListResponse; 6202 - type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>; 7161 + type Future = BoxFuture< 7162 + tonic::Response<Self::Response>, 7163 + tonic::Status, 7164 + >; 6203 7165 fn call( 6204 7166 &mut self, 6205 7167 request: tonic::Request<super::GetSettingsListRequest>, 6206 7168 ) -> Self::Future { 6207 7169 let inner = Arc::clone(&self.0); 6208 7170 let fut = async move { 6209 - <T as SettingsService>::get_settings_list(&inner, request).await 7171 + <T as SettingsService>::get_settings_list(&inner, request) 7172 + .await 6210 7173 }; 6211 7174 Box::pin(fut) 6212 7175 } ··· 6236 7199 "/rockbox.v1alpha1.SettingsService/GetGlobalSettings" => { 6237 7200 #[allow(non_camel_case_types)] 6238 7201 struct GetGlobalSettingsSvc<T: SettingsService>(pub Arc<T>); 6239 - impl<T: SettingsService> 6240 - tonic::server::UnaryService<super::GetGlobalSettingsRequest> 6241 - for GetGlobalSettingsSvc<T> 6242 - { 7202 + impl< 7203 + T: SettingsService, 7204 + > tonic::server::UnaryService<super::GetGlobalSettingsRequest> 7205 + for GetGlobalSettingsSvc<T> { 6243 7206 type Response = super::GetGlobalSettingsResponse; 6244 - type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>; 7207 + type Future = BoxFuture< 7208 + tonic::Response<Self::Response>, 7209 + tonic::Status, 7210 + >; 6245 7211 fn call( 6246 7212 &mut self, 6247 7213 request: tonic::Request<super::GetGlobalSettingsRequest>, 6248 7214 ) -> Self::Future { 6249 7215 let inner = Arc::clone(&self.0); 6250 7216 let fut = async move { 6251 - <T as SettingsService>::get_global_settings(&inner, request).await 7217 + <T as SettingsService>::get_global_settings(&inner, request) 7218 + .await 6252 7219 }; 6253 7220 Box::pin(fut) 6254 7221 } ··· 6278 7245 "/rockbox.v1alpha1.SettingsService/SaveSettings" => { 6279 7246 #[allow(non_camel_case_types)] 6280 7247 struct SaveSettingsSvc<T: SettingsService>(pub Arc<T>); 6281 - impl<T: SettingsService> tonic::server::UnaryService<super::SaveSettingsRequest> 6282 - for SaveSettingsSvc<T> 6283 - { 7248 + impl< 7249 + T: SettingsService, 7250 + > tonic::server::UnaryService<super::SaveSettingsRequest> 7251 + for SaveSettingsSvc<T> { 6284 7252 type Response = super::SaveSettingsResponse; 6285 - type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>; 7253 + type Future = BoxFuture< 7254 + tonic::Response<Self::Response>, 7255 + tonic::Status, 7256 + >; 6286 7257 fn call( 6287 7258 &mut self, 6288 7259 request: tonic::Request<super::SaveSettingsRequest>, ··· 6316 7287 }; 6317 7288 Box::pin(fut) 6318 7289 } 6319 - _ => Box::pin(async move { 6320 - let mut response = http::Response::new(empty_body()); 6321 - let headers = response.headers_mut(); 6322 - headers.insert( 6323 - tonic::Status::GRPC_STATUS, 6324 - (tonic::Code::Unimplemented as i32).into(), 6325 - ); 6326 - headers.insert( 6327 - http::header::CONTENT_TYPE, 6328 - tonic::metadata::GRPC_CONTENT_TYPE, 6329 - ); 6330 - Ok(response) 6331 - }), 7290 + _ => { 7291 + Box::pin(async move { 7292 + let mut response = http::Response::new(empty_body()); 7293 + let headers = response.headers_mut(); 7294 + headers 7295 + .insert( 7296 + tonic::Status::GRPC_STATUS, 7297 + (tonic::Code::Unimplemented as i32).into(), 7298 + ); 7299 + headers 7300 + .insert( 7301 + http::header::CONTENT_TYPE, 7302 + tonic::metadata::GRPC_CONTENT_TYPE, 7303 + ); 7304 + Ok(response) 7305 + }) 7306 + } 6332 7307 } 6333 7308 } 6334 7309 } ··· 6486 7461 dead_code, 6487 7462 missing_docs, 6488 7463 clippy::wildcard_imports, 6489 - clippy::let_unit_value 7464 + clippy::let_unit_value, 6490 7465 )] 6491 - use tonic::codegen::http::Uri; 6492 7466 use tonic::codegen::*; 7467 + use tonic::codegen::http::Uri; 6493 7468 #[derive(Debug, Clone)] 6494 7469 pub struct SoundServiceClient<T> { 6495 7470 inner: tonic::client::Grpc<T>, ··· 6533 7508 <T as tonic::client::GrpcService<tonic::body::BoxBody>>::ResponseBody, 6534 7509 >, 6535 7510 >, 6536 - <T as tonic::codegen::Service<http::Request<tonic::body::BoxBody>>>::Error: 6537 - Into<StdError> + std::marker::Send + std::marker::Sync, 7511 + <T as tonic::codegen::Service< 7512 + http::Request<tonic::body::BoxBody>, 7513 + >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync, 6538 7514 { 6539 7515 SoundServiceClient::new(InterceptedService::new(inner, interceptor)) 6540 7516 } ··· 6572 7548 pub async fn adjust_volume( 6573 7549 &mut self, 6574 7550 request: impl tonic::IntoRequest<super::AdjustVolumeRequest>, 6575 - ) -> std::result::Result<tonic::Response<super::AdjustVolumeResponse>, tonic::Status> 6576 - { 6577 - self.inner.ready().await.map_err(|e| { 6578 - tonic::Status::unknown(format!("Service was not ready: {}", e.into())) 6579 - })?; 7551 + ) -> std::result::Result< 7552 + tonic::Response<super::AdjustVolumeResponse>, 7553 + tonic::Status, 7554 + > { 7555 + self.inner 7556 + .ready() 7557 + .await 7558 + .map_err(|e| { 7559 + tonic::Status::unknown( 7560 + format!("Service was not ready: {}", e.into()), 7561 + ) 7562 + })?; 6580 7563 let codec = tonic::codec::ProstCodec::default(); 6581 - let path = 6582 - http::uri::PathAndQuery::from_static("/rockbox.v1alpha1.SoundService/AdjustVolume"); 7564 + let path = http::uri::PathAndQuery::from_static( 7565 + "/rockbox.v1alpha1.SoundService/AdjustVolume", 7566 + ); 6583 7567 let mut req = request.into_request(); 6584 - req.extensions_mut().insert(GrpcMethod::new( 6585 - "rockbox.v1alpha1.SoundService", 6586 - "AdjustVolume", 6587 - )); 7568 + req.extensions_mut() 7569 + .insert( 7570 + GrpcMethod::new("rockbox.v1alpha1.SoundService", "AdjustVolume"), 7571 + ); 6588 7572 self.inner.unary(req, path, codec).await 6589 7573 } 6590 7574 pub async fn sound_set( 6591 7575 &mut self, 6592 7576 request: impl tonic::IntoRequest<super::SoundSetRequest>, 6593 - ) -> std::result::Result<tonic::Response<super::SoundSetResponse>, tonic::Status> { 6594 - self.inner.ready().await.map_err(|e| { 6595 - tonic::Status::unknown(format!("Service was not ready: {}", e.into())) 6596 - })?; 7577 + ) -> std::result::Result< 7578 + tonic::Response<super::SoundSetResponse>, 7579 + tonic::Status, 7580 + > { 7581 + self.inner 7582 + .ready() 7583 + .await 7584 + .map_err(|e| { 7585 + tonic::Status::unknown( 7586 + format!("Service was not ready: {}", e.into()), 7587 + ) 7588 + })?; 6597 7589 let codec = tonic::codec::ProstCodec::default(); 6598 - let path = 6599 - http::uri::PathAndQuery::from_static("/rockbox.v1alpha1.SoundService/SoundSet"); 7590 + let path = http::uri::PathAndQuery::from_static( 7591 + "/rockbox.v1alpha1.SoundService/SoundSet", 7592 + ); 6600 7593 let mut req = request.into_request(); 6601 7594 req.extensions_mut() 6602 7595 .insert(GrpcMethod::new("rockbox.v1alpha1.SoundService", "SoundSet")); ··· 6605 7598 pub async fn sound_current( 6606 7599 &mut self, 6607 7600 request: impl tonic::IntoRequest<super::SoundCurrentRequest>, 6608 - ) -> std::result::Result<tonic::Response<super::SoundCurrentResponse>, tonic::Status> 6609 - { 6610 - self.inner.ready().await.map_err(|e| { 6611 - tonic::Status::unknown(format!("Service was not ready: {}", e.into())) 6612 - })?; 7601 + ) -> std::result::Result< 7602 + tonic::Response<super::SoundCurrentResponse>, 7603 + tonic::Status, 7604 + > { 7605 + self.inner 7606 + .ready() 7607 + .await 7608 + .map_err(|e| { 7609 + tonic::Status::unknown( 7610 + format!("Service was not ready: {}", e.into()), 7611 + ) 7612 + })?; 6613 7613 let codec = tonic::codec::ProstCodec::default(); 6614 - let path = 6615 - http::uri::PathAndQuery::from_static("/rockbox.v1alpha1.SoundService/SoundCurrent"); 7614 + let path = http::uri::PathAndQuery::from_static( 7615 + "/rockbox.v1alpha1.SoundService/SoundCurrent", 7616 + ); 6616 7617 let mut req = request.into_request(); 6617 - req.extensions_mut().insert(GrpcMethod::new( 6618 - "rockbox.v1alpha1.SoundService", 6619 - "SoundCurrent", 6620 - )); 7618 + req.extensions_mut() 7619 + .insert( 7620 + GrpcMethod::new("rockbox.v1alpha1.SoundService", "SoundCurrent"), 7621 + ); 6621 7622 self.inner.unary(req, path, codec).await 6622 7623 } 6623 7624 pub async fn sound_default( 6624 7625 &mut self, 6625 7626 request: impl tonic::IntoRequest<super::SoundDefaultRequest>, 6626 - ) -> std::result::Result<tonic::Response<super::SoundDefaultResponse>, tonic::Status> 6627 - { 6628 - self.inner.ready().await.map_err(|e| { 6629 - tonic::Status::unknown(format!("Service was not ready: {}", e.into())) 6630 - })?; 7627 + ) -> std::result::Result< 7628 + tonic::Response<super::SoundDefaultResponse>, 7629 + tonic::Status, 7630 + > { 7631 + self.inner 7632 + .ready() 7633 + .await 7634 + .map_err(|e| { 7635 + tonic::Status::unknown( 7636 + format!("Service was not ready: {}", e.into()), 7637 + ) 7638 + })?; 6631 7639 let codec = tonic::codec::ProstCodec::default(); 6632 - let path = 6633 - http::uri::PathAndQuery::from_static("/rockbox.v1alpha1.SoundService/SoundDefault"); 7640 + let path = http::uri::PathAndQuery::from_static( 7641 + "/rockbox.v1alpha1.SoundService/SoundDefault", 7642 + ); 6634 7643 let mut req = request.into_request(); 6635 - req.extensions_mut().insert(GrpcMethod::new( 6636 - "rockbox.v1alpha1.SoundService", 6637 - "SoundDefault", 6638 - )); 7644 + req.extensions_mut() 7645 + .insert( 7646 + GrpcMethod::new("rockbox.v1alpha1.SoundService", "SoundDefault"), 7647 + ); 6639 7648 self.inner.unary(req, path, codec).await 6640 7649 } 6641 7650 pub async fn sound_min( 6642 7651 &mut self, 6643 7652 request: impl tonic::IntoRequest<super::SoundMinRequest>, 6644 - ) -> std::result::Result<tonic::Response<super::SoundMinResponse>, tonic::Status> { 6645 - self.inner.ready().await.map_err(|e| { 6646 - tonic::Status::unknown(format!("Service was not ready: {}", e.into())) 6647 - })?; 7653 + ) -> std::result::Result< 7654 + tonic::Response<super::SoundMinResponse>, 7655 + tonic::Status, 7656 + > { 7657 + self.inner 7658 + .ready() 7659 + .await 7660 + .map_err(|e| { 7661 + tonic::Status::unknown( 7662 + format!("Service was not ready: {}", e.into()), 7663 + ) 7664 + })?; 6648 7665 let codec = tonic::codec::ProstCodec::default(); 6649 - let path = 6650 - http::uri::PathAndQuery::from_static("/rockbox.v1alpha1.SoundService/SoundMin"); 7666 + let path = http::uri::PathAndQuery::from_static( 7667 + "/rockbox.v1alpha1.SoundService/SoundMin", 7668 + ); 6651 7669 let mut req = request.into_request(); 6652 7670 req.extensions_mut() 6653 7671 .insert(GrpcMethod::new("rockbox.v1alpha1.SoundService", "SoundMin")); ··· 6656 7674 pub async fn sound_max( 6657 7675 &mut self, 6658 7676 request: impl tonic::IntoRequest<super::SoundMaxRequest>, 6659 - ) -> std::result::Result<tonic::Response<super::SoundMaxResponse>, tonic::Status> { 6660 - self.inner.ready().await.map_err(|e| { 6661 - tonic::Status::unknown(format!("Service was not ready: {}", e.into())) 6662 - })?; 7677 + ) -> std::result::Result< 7678 + tonic::Response<super::SoundMaxResponse>, 7679 + tonic::Status, 7680 + > { 7681 + self.inner 7682 + .ready() 7683 + .await 7684 + .map_err(|e| { 7685 + tonic::Status::unknown( 7686 + format!("Service was not ready: {}", e.into()), 7687 + ) 7688 + })?; 6663 7689 let codec = tonic::codec::ProstCodec::default(); 6664 - let path = 6665 - http::uri::PathAndQuery::from_static("/rockbox.v1alpha1.SoundService/SoundMax"); 7690 + let path = http::uri::PathAndQuery::from_static( 7691 + "/rockbox.v1alpha1.SoundService/SoundMax", 7692 + ); 6666 7693 let mut req = request.into_request(); 6667 7694 req.extensions_mut() 6668 7695 .insert(GrpcMethod::new("rockbox.v1alpha1.SoundService", "SoundMax")); ··· 6671 7698 pub async fn sound_unit( 6672 7699 &mut self, 6673 7700 request: impl tonic::IntoRequest<super::SoundUnitRequest>, 6674 - ) -> std::result::Result<tonic::Response<super::SoundUnitResponse>, tonic::Status> { 6675 - self.inner.ready().await.map_err(|e| { 6676 - tonic::Status::unknown(format!("Service was not ready: {}", e.into())) 6677 - })?; 7701 + ) -> std::result::Result< 7702 + tonic::Response<super::SoundUnitResponse>, 7703 + tonic::Status, 7704 + > { 7705 + self.inner 7706 + .ready() 7707 + .await 7708 + .map_err(|e| { 7709 + tonic::Status::unknown( 7710 + format!("Service was not ready: {}", e.into()), 7711 + ) 7712 + })?; 6678 7713 let codec = tonic::codec::ProstCodec::default(); 6679 - let path = 6680 - http::uri::PathAndQuery::from_static("/rockbox.v1alpha1.SoundService/SoundUnit"); 7714 + let path = http::uri::PathAndQuery::from_static( 7715 + "/rockbox.v1alpha1.SoundService/SoundUnit", 7716 + ); 6681 7717 let mut req = request.into_request(); 6682 - req.extensions_mut().insert(GrpcMethod::new( 6683 - "rockbox.v1alpha1.SoundService", 6684 - "SoundUnit", 6685 - )); 7718 + req.extensions_mut() 7719 + .insert(GrpcMethod::new("rockbox.v1alpha1.SoundService", "SoundUnit")); 6686 7720 self.inner.unary(req, path, codec).await 6687 7721 } 6688 7722 pub async fn sound_val2_phys( 6689 7723 &mut self, 6690 7724 request: impl tonic::IntoRequest<super::SoundVal2PhysRequest>, 6691 - ) -> std::result::Result<tonic::Response<super::SoundVal2PhysResponse>, tonic::Status> 6692 - { 6693 - self.inner.ready().await.map_err(|e| { 6694 - tonic::Status::unknown(format!("Service was not ready: {}", e.into())) 6695 - })?; 7725 + ) -> std::result::Result< 7726 + tonic::Response<super::SoundVal2PhysResponse>, 7727 + tonic::Status, 7728 + > { 7729 + self.inner 7730 + .ready() 7731 + .await 7732 + .map_err(|e| { 7733 + tonic::Status::unknown( 7734 + format!("Service was not ready: {}", e.into()), 7735 + ) 7736 + })?; 6696 7737 let codec = tonic::codec::ProstCodec::default(); 6697 7738 let path = http::uri::PathAndQuery::from_static( 6698 7739 "/rockbox.v1alpha1.SoundService/SoundVal2Phys", 6699 7740 ); 6700 7741 let mut req = request.into_request(); 6701 - req.extensions_mut().insert(GrpcMethod::new( 6702 - "rockbox.v1alpha1.SoundService", 6703 - "SoundVal2Phys", 6704 - )); 7742 + req.extensions_mut() 7743 + .insert( 7744 + GrpcMethod::new("rockbox.v1alpha1.SoundService", "SoundVal2Phys"), 7745 + ); 6705 7746 self.inner.unary(req, path, codec).await 6706 7747 } 6707 7748 pub async fn get_pitch( 6708 7749 &mut self, 6709 7750 request: impl tonic::IntoRequest<super::GetPitchRequest>, 6710 - ) -> std::result::Result<tonic::Response<super::GetPitchResponse>, tonic::Status> { 6711 - self.inner.ready().await.map_err(|e| { 6712 - tonic::Status::unknown(format!("Service was not ready: {}", e.into())) 6713 - })?; 7751 + ) -> std::result::Result< 7752 + tonic::Response<super::GetPitchResponse>, 7753 + tonic::Status, 7754 + > { 7755 + self.inner 7756 + .ready() 7757 + .await 7758 + .map_err(|e| { 7759 + tonic::Status::unknown( 7760 + format!("Service was not ready: {}", e.into()), 7761 + ) 7762 + })?; 6714 7763 let codec = tonic::codec::ProstCodec::default(); 6715 - let path = 6716 - http::uri::PathAndQuery::from_static("/rockbox.v1alpha1.SoundService/GetPitch"); 7764 + let path = http::uri::PathAndQuery::from_static( 7765 + "/rockbox.v1alpha1.SoundService/GetPitch", 7766 + ); 6717 7767 let mut req = request.into_request(); 6718 7768 req.extensions_mut() 6719 7769 .insert(GrpcMethod::new("rockbox.v1alpha1.SoundService", "GetPitch")); ··· 6722 7772 pub async fn set_pitch( 6723 7773 &mut self, 6724 7774 request: impl tonic::IntoRequest<super::SetPitchRequest>, 6725 - ) -> std::result::Result<tonic::Response<super::SetPitchResponse>, tonic::Status> { 6726 - self.inner.ready().await.map_err(|e| { 6727 - tonic::Status::unknown(format!("Service was not ready: {}", e.into())) 6728 - })?; 7775 + ) -> std::result::Result< 7776 + tonic::Response<super::SetPitchResponse>, 7777 + tonic::Status, 7778 + > { 7779 + self.inner 7780 + .ready() 7781 + .await 7782 + .map_err(|e| { 7783 + tonic::Status::unknown( 7784 + format!("Service was not ready: {}", e.into()), 7785 + ) 7786 + })?; 6729 7787 let codec = tonic::codec::ProstCodec::default(); 6730 - let path = 6731 - http::uri::PathAndQuery::from_static("/rockbox.v1alpha1.SoundService/SetPitch"); 7788 + let path = http::uri::PathAndQuery::from_static( 7789 + "/rockbox.v1alpha1.SoundService/SetPitch", 7790 + ); 6732 7791 let mut req = request.into_request(); 6733 7792 req.extensions_mut() 6734 7793 .insert(GrpcMethod::new("rockbox.v1alpha1.SoundService", "SetPitch")); ··· 6737 7796 pub async fn beep_play( 6738 7797 &mut self, 6739 7798 request: impl tonic::IntoRequest<super::BeepPlayRequest>, 6740 - ) -> std::result::Result<tonic::Response<super::BeepPlayResponse>, tonic::Status> { 6741 - self.inner.ready().await.map_err(|e| { 6742 - tonic::Status::unknown(format!("Service was not ready: {}", e.into())) 6743 - })?; 7799 + ) -> std::result::Result< 7800 + tonic::Response<super::BeepPlayResponse>, 7801 + tonic::Status, 7802 + > { 7803 + self.inner 7804 + .ready() 7805 + .await 7806 + .map_err(|e| { 7807 + tonic::Status::unknown( 7808 + format!("Service was not ready: {}", e.into()), 7809 + ) 7810 + })?; 6744 7811 let codec = tonic::codec::ProstCodec::default(); 6745 - let path = 6746 - http::uri::PathAndQuery::from_static("/rockbox.v1alpha1.SoundService/BeepPlay"); 7812 + let path = http::uri::PathAndQuery::from_static( 7813 + "/rockbox.v1alpha1.SoundService/BeepPlay", 7814 + ); 6747 7815 let mut req = request.into_request(); 6748 7816 req.extensions_mut() 6749 7817 .insert(GrpcMethod::new("rockbox.v1alpha1.SoundService", "BeepPlay")); ··· 6752 7820 pub async fn pcmbuf_fade( 6753 7821 &mut self, 6754 7822 request: impl tonic::IntoRequest<super::PcmbufFadeRequest>, 6755 - ) -> std::result::Result<tonic::Response<super::PcmbufFadeResponse>, tonic::Status> 6756 - { 6757 - self.inner.ready().await.map_err(|e| { 6758 - tonic::Status::unknown(format!("Service was not ready: {}", e.into())) 6759 - })?; 7823 + ) -> std::result::Result< 7824 + tonic::Response<super::PcmbufFadeResponse>, 7825 + tonic::Status, 7826 + > { 7827 + self.inner 7828 + .ready() 7829 + .await 7830 + .map_err(|e| { 7831 + tonic::Status::unknown( 7832 + format!("Service was not ready: {}", e.into()), 7833 + ) 7834 + })?; 6760 7835 let codec = tonic::codec::ProstCodec::default(); 6761 - let path = 6762 - http::uri::PathAndQuery::from_static("/rockbox.v1alpha1.SoundService/PcmbufFade"); 7836 + let path = http::uri::PathAndQuery::from_static( 7837 + "/rockbox.v1alpha1.SoundService/PcmbufFade", 7838 + ); 6763 7839 let mut req = request.into_request(); 6764 - req.extensions_mut().insert(GrpcMethod::new( 6765 - "rockbox.v1alpha1.SoundService", 6766 - "PcmbufFade", 6767 - )); 7840 + req.extensions_mut() 7841 + .insert(GrpcMethod::new("rockbox.v1alpha1.SoundService", "PcmbufFade")); 6768 7842 self.inner.unary(req, path, codec).await 6769 7843 } 6770 7844 pub async fn pcmbuf_set_low_latency( 6771 7845 &mut self, 6772 7846 request: impl tonic::IntoRequest<super::PcmbufSetLowLatencyRequest>, 6773 - ) -> std::result::Result<tonic::Response<super::PcmbufSetLowLatencyResponse>, tonic::Status> 6774 - { 6775 - self.inner.ready().await.map_err(|e| { 6776 - tonic::Status::unknown(format!("Service was not ready: {}", e.into())) 6777 - })?; 7847 + ) -> std::result::Result< 7848 + tonic::Response<super::PcmbufSetLowLatencyResponse>, 7849 + tonic::Status, 7850 + > { 7851 + self.inner 7852 + .ready() 7853 + .await 7854 + .map_err(|e| { 7855 + tonic::Status::unknown( 7856 + format!("Service was not ready: {}", e.into()), 7857 + ) 7858 + })?; 6778 7859 let codec = tonic::codec::ProstCodec::default(); 6779 7860 let path = http::uri::PathAndQuery::from_static( 6780 7861 "/rockbox.v1alpha1.SoundService/PcmbufSetLowLatency", 6781 7862 ); 6782 7863 let mut req = request.into_request(); 6783 - req.extensions_mut().insert(GrpcMethod::new( 6784 - "rockbox.v1alpha1.SoundService", 6785 - "PcmbufSetLowLatency", 6786 - )); 7864 + req.extensions_mut() 7865 + .insert( 7866 + GrpcMethod::new( 7867 + "rockbox.v1alpha1.SoundService", 7868 + "PcmbufSetLowLatency", 7869 + ), 7870 + ); 6787 7871 self.inner.unary(req, path, codec).await 6788 7872 } 6789 7873 pub async fn system_sound_play( 6790 7874 &mut self, 6791 7875 request: impl tonic::IntoRequest<super::SystemSoundPlayRequest>, 6792 - ) -> std::result::Result<tonic::Response<super::SystemSoundPlayResponse>, tonic::Status> 6793 - { 6794 - self.inner.ready().await.map_err(|e| { 6795 - tonic::Status::unknown(format!("Service was not ready: {}", e.into())) 6796 - })?; 7876 + ) -> std::result::Result< 7877 + tonic::Response<super::SystemSoundPlayResponse>, 7878 + tonic::Status, 7879 + > { 7880 + self.inner 7881 + .ready() 7882 + .await 7883 + .map_err(|e| { 7884 + tonic::Status::unknown( 7885 + format!("Service was not ready: {}", e.into()), 7886 + ) 7887 + })?; 6797 7888 let codec = tonic::codec::ProstCodec::default(); 6798 7889 let path = http::uri::PathAndQuery::from_static( 6799 7890 "/rockbox.v1alpha1.SoundService/SystemSoundPlay", 6800 7891 ); 6801 7892 let mut req = request.into_request(); 6802 - req.extensions_mut().insert(GrpcMethod::new( 6803 - "rockbox.v1alpha1.SoundService", 6804 - "SystemSoundPlay", 6805 - )); 7893 + req.extensions_mut() 7894 + .insert( 7895 + GrpcMethod::new("rockbox.v1alpha1.SoundService", "SystemSoundPlay"), 7896 + ); 6806 7897 self.inner.unary(req, path, codec).await 6807 7898 } 6808 7899 pub async fn keyclick_click( 6809 7900 &mut self, 6810 7901 request: impl tonic::IntoRequest<super::KeyclickClickRequest>, 6811 - ) -> std::result::Result<tonic::Response<super::KeyclickClickResponse>, tonic::Status> 6812 - { 6813 - self.inner.ready().await.map_err(|e| { 6814 - tonic::Status::unknown(format!("Service was not ready: {}", e.into())) 6815 - })?; 7902 + ) -> std::result::Result< 7903 + tonic::Response<super::KeyclickClickResponse>, 7904 + tonic::Status, 7905 + > { 7906 + self.inner 7907 + .ready() 7908 + .await 7909 + .map_err(|e| { 7910 + tonic::Status::unknown( 7911 + format!("Service was not ready: {}", e.into()), 7912 + ) 7913 + })?; 6816 7914 let codec = tonic::codec::ProstCodec::default(); 6817 7915 let path = http::uri::PathAndQuery::from_static( 6818 7916 "/rockbox.v1alpha1.SoundService/KeyclickClick", 6819 7917 ); 6820 7918 let mut req = request.into_request(); 6821 - req.extensions_mut().insert(GrpcMethod::new( 6822 - "rockbox.v1alpha1.SoundService", 6823 - "KeyclickClick", 6824 - )); 7919 + req.extensions_mut() 7920 + .insert( 7921 + GrpcMethod::new("rockbox.v1alpha1.SoundService", "KeyclickClick"), 7922 + ); 6825 7923 self.inner.unary(req, path, codec).await 6826 7924 } 6827 7925 } ··· 6833 7931 dead_code, 6834 7932 missing_docs, 6835 7933 clippy::wildcard_imports, 6836 - clippy::let_unit_value 7934 + clippy::let_unit_value, 6837 7935 )] 6838 7936 use tonic::codegen::*; 6839 7937 /// Generated trait containing gRPC methods that should be implemented for use with SoundServiceServer. ··· 6842 7940 async fn adjust_volume( 6843 7941 &self, 6844 7942 request: tonic::Request<super::AdjustVolumeRequest>, 6845 - ) -> std::result::Result<tonic::Response<super::AdjustVolumeResponse>, tonic::Status>; 7943 + ) -> std::result::Result< 7944 + tonic::Response<super::AdjustVolumeResponse>, 7945 + tonic::Status, 7946 + >; 6846 7947 async fn sound_set( 6847 7948 &self, 6848 7949 request: tonic::Request<super::SoundSetRequest>, 6849 - ) -> std::result::Result<tonic::Response<super::SoundSetResponse>, tonic::Status>; 7950 + ) -> std::result::Result< 7951 + tonic::Response<super::SoundSetResponse>, 7952 + tonic::Status, 7953 + >; 6850 7954 async fn sound_current( 6851 7955 &self, 6852 7956 request: tonic::Request<super::SoundCurrentRequest>, 6853 - ) -> std::result::Result<tonic::Response<super::SoundCurrentResponse>, tonic::Status>; 7957 + ) -> std::result::Result< 7958 + tonic::Response<super::SoundCurrentResponse>, 7959 + tonic::Status, 7960 + >; 6854 7961 async fn sound_default( 6855 7962 &self, 6856 7963 request: tonic::Request<super::SoundDefaultRequest>, 6857 - ) -> std::result::Result<tonic::Response<super::SoundDefaultResponse>, tonic::Status>; 7964 + ) -> std::result::Result< 7965 + tonic::Response<super::SoundDefaultResponse>, 7966 + tonic::Status, 7967 + >; 6858 7968 async fn sound_min( 6859 7969 &self, 6860 7970 request: tonic::Request<super::SoundMinRequest>, 6861 - ) -> std::result::Result<tonic::Response<super::SoundMinResponse>, tonic::Status>; 7971 + ) -> std::result::Result< 7972 + tonic::Response<super::SoundMinResponse>, 7973 + tonic::Status, 7974 + >; 6862 7975 async fn sound_max( 6863 7976 &self, 6864 7977 request: tonic::Request<super::SoundMaxRequest>, 6865 - ) -> std::result::Result<tonic::Response<super::SoundMaxResponse>, tonic::Status>; 7978 + ) -> std::result::Result< 7979 + tonic::Response<super::SoundMaxResponse>, 7980 + tonic::Status, 7981 + >; 6866 7982 async fn sound_unit( 6867 7983 &self, 6868 7984 request: tonic::Request<super::SoundUnitRequest>, 6869 - ) -> std::result::Result<tonic::Response<super::SoundUnitResponse>, tonic::Status>; 7985 + ) -> std::result::Result< 7986 + tonic::Response<super::SoundUnitResponse>, 7987 + tonic::Status, 7988 + >; 6870 7989 async fn sound_val2_phys( 6871 7990 &self, 6872 7991 request: tonic::Request<super::SoundVal2PhysRequest>, 6873 - ) -> std::result::Result<tonic::Response<super::SoundVal2PhysResponse>, tonic::Status>; 7992 + ) -> std::result::Result< 7993 + tonic::Response<super::SoundVal2PhysResponse>, 7994 + tonic::Status, 7995 + >; 6874 7996 async fn get_pitch( 6875 7997 &self, 6876 7998 request: tonic::Request<super::GetPitchRequest>, 6877 - ) -> std::result::Result<tonic::Response<super::GetPitchResponse>, tonic::Status>; 7999 + ) -> std::result::Result< 8000 + tonic::Response<super::GetPitchResponse>, 8001 + tonic::Status, 8002 + >; 6878 8003 async fn set_pitch( 6879 8004 &self, 6880 8005 request: tonic::Request<super::SetPitchRequest>, 6881 - ) -> std::result::Result<tonic::Response<super::SetPitchResponse>, tonic::Status>; 8006 + ) -> std::result::Result< 8007 + tonic::Response<super::SetPitchResponse>, 8008 + tonic::Status, 8009 + >; 6882 8010 async fn beep_play( 6883 8011 &self, 6884 8012 request: tonic::Request<super::BeepPlayRequest>, 6885 - ) -> std::result::Result<tonic::Response<super::BeepPlayResponse>, tonic::Status>; 8013 + ) -> std::result::Result< 8014 + tonic::Response<super::BeepPlayResponse>, 8015 + tonic::Status, 8016 + >; 6886 8017 async fn pcmbuf_fade( 6887 8018 &self, 6888 8019 request: tonic::Request<super::PcmbufFadeRequest>, 6889 - ) -> std::result::Result<tonic::Response<super::PcmbufFadeResponse>, tonic::Status>; 8020 + ) -> std::result::Result< 8021 + tonic::Response<super::PcmbufFadeResponse>, 8022 + tonic::Status, 8023 + >; 6890 8024 async fn pcmbuf_set_low_latency( 6891 8025 &self, 6892 8026 request: tonic::Request<super::PcmbufSetLowLatencyRequest>, 6893 - ) -> std::result::Result<tonic::Response<super::PcmbufSetLowLatencyResponse>, tonic::Status>; 8027 + ) -> std::result::Result< 8028 + tonic::Response<super::PcmbufSetLowLatencyResponse>, 8029 + tonic::Status, 8030 + >; 6894 8031 async fn system_sound_play( 6895 8032 &self, 6896 8033 request: tonic::Request<super::SystemSoundPlayRequest>, 6897 - ) -> std::result::Result<tonic::Response<super::SystemSoundPlayResponse>, tonic::Status>; 8034 + ) -> std::result::Result< 8035 + tonic::Response<super::SystemSoundPlayResponse>, 8036 + tonic::Status, 8037 + >; 6898 8038 async fn keyclick_click( 6899 8039 &self, 6900 8040 request: tonic::Request<super::KeyclickClickRequest>, 6901 - ) -> std::result::Result<tonic::Response<super::KeyclickClickResponse>, tonic::Status>; 8041 + ) -> std::result::Result< 8042 + tonic::Response<super::KeyclickClickResponse>, 8043 + tonic::Status, 8044 + >; 6902 8045 } 6903 8046 #[derive(Debug)] 6904 8047 pub struct SoundServiceServer<T> { ··· 6921 8064 max_encoding_message_size: None, 6922 8065 } 6923 8066 } 6924 - pub fn with_interceptor<F>(inner: T, interceptor: F) -> InterceptedService<Self, F> 8067 + pub fn with_interceptor<F>( 8068 + inner: T, 8069 + interceptor: F, 8070 + ) -> InterceptedService<Self, F> 6925 8071 where 6926 8072 F: tonic::service::Interceptor, 6927 8073 { ··· 6976 8122 "/rockbox.v1alpha1.SoundService/AdjustVolume" => { 6977 8123 #[allow(non_camel_case_types)] 6978 8124 struct AdjustVolumeSvc<T: SoundService>(pub Arc<T>); 6979 - impl<T: SoundService> tonic::server::UnaryService<super::AdjustVolumeRequest> 6980 - for AdjustVolumeSvc<T> 6981 - { 8125 + impl< 8126 + T: SoundService, 8127 + > tonic::server::UnaryService<super::AdjustVolumeRequest> 8128 + for AdjustVolumeSvc<T> { 6982 8129 type Response = super::AdjustVolumeResponse; 6983 - type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>; 8130 + type Future = BoxFuture< 8131 + tonic::Response<Self::Response>, 8132 + tonic::Status, 8133 + >; 6984 8134 fn call( 6985 8135 &mut self, 6986 8136 request: tonic::Request<super::AdjustVolumeRequest>, ··· 7017 8167 "/rockbox.v1alpha1.SoundService/SoundSet" => { 7018 8168 #[allow(non_camel_case_types)] 7019 8169 struct SoundSetSvc<T: SoundService>(pub Arc<T>); 7020 - impl<T: SoundService> tonic::server::UnaryService<super::SoundSetRequest> for SoundSetSvc<T> { 8170 + impl< 8171 + T: SoundService, 8172 + > tonic::server::UnaryService<super::SoundSetRequest> 8173 + for SoundSetSvc<T> { 7021 8174 type Response = super::SoundSetResponse; 7022 - type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>; 8175 + type Future = BoxFuture< 8176 + tonic::Response<Self::Response>, 8177 + tonic::Status, 8178 + >; 7023 8179 fn call( 7024 8180 &mut self, 7025 8181 request: tonic::Request<super::SoundSetRequest>, ··· 7056 8212 "/rockbox.v1alpha1.SoundService/SoundCurrent" => { 7057 8213 #[allow(non_camel_case_types)] 7058 8214 struct SoundCurrentSvc<T: SoundService>(pub Arc<T>); 7059 - impl<T: SoundService> tonic::server::UnaryService<super::SoundCurrentRequest> 7060 - for SoundCurrentSvc<T> 7061 - { 8215 + impl< 8216 + T: SoundService, 8217 + > tonic::server::UnaryService<super::SoundCurrentRequest> 8218 + for SoundCurrentSvc<T> { 7062 8219 type Response = super::SoundCurrentResponse; 7063 - type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>; 8220 + type Future = BoxFuture< 8221 + tonic::Response<Self::Response>, 8222 + tonic::Status, 8223 + >; 7064 8224 fn call( 7065 8225 &mut self, 7066 8226 request: tonic::Request<super::SoundCurrentRequest>, ··· 7097 8257 "/rockbox.v1alpha1.SoundService/SoundDefault" => { 7098 8258 #[allow(non_camel_case_types)] 7099 8259 struct SoundDefaultSvc<T: SoundService>(pub Arc<T>); 7100 - impl<T: SoundService> tonic::server::UnaryService<super::SoundDefaultRequest> 7101 - for SoundDefaultSvc<T> 7102 - { 8260 + impl< 8261 + T: SoundService, 8262 + > tonic::server::UnaryService<super::SoundDefaultRequest> 8263 + for SoundDefaultSvc<T> { 7103 8264 type Response = super::SoundDefaultResponse; 7104 - type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>; 8265 + type Future = BoxFuture< 8266 + tonic::Response<Self::Response>, 8267 + tonic::Status, 8268 + >; 7105 8269 fn call( 7106 8270 &mut self, 7107 8271 request: tonic::Request<super::SoundDefaultRequest>, ··· 7138 8302 "/rockbox.v1alpha1.SoundService/SoundMin" => { 7139 8303 #[allow(non_camel_case_types)] 7140 8304 struct SoundMinSvc<T: SoundService>(pub Arc<T>); 7141 - impl<T: SoundService> tonic::server::UnaryService<super::SoundMinRequest> for SoundMinSvc<T> { 8305 + impl< 8306 + T: SoundService, 8307 + > tonic::server::UnaryService<super::SoundMinRequest> 8308 + for SoundMinSvc<T> { 7142 8309 type Response = super::SoundMinResponse; 7143 - type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>; 8310 + type Future = BoxFuture< 8311 + tonic::Response<Self::Response>, 8312 + tonic::Status, 8313 + >; 7144 8314 fn call( 7145 8315 &mut self, 7146 8316 request: tonic::Request<super::SoundMinRequest>, ··· 7177 8347 "/rockbox.v1alpha1.SoundService/SoundMax" => { 7178 8348 #[allow(non_camel_case_types)] 7179 8349 struct SoundMaxSvc<T: SoundService>(pub Arc<T>); 7180 - impl<T: SoundService> tonic::server::UnaryService<super::SoundMaxRequest> for SoundMaxSvc<T> { 8350 + impl< 8351 + T: SoundService, 8352 + > tonic::server::UnaryService<super::SoundMaxRequest> 8353 + for SoundMaxSvc<T> { 7181 8354 type Response = super::SoundMaxResponse; 7182 - type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>; 8355 + type Future = BoxFuture< 8356 + tonic::Response<Self::Response>, 8357 + tonic::Status, 8358 + >; 7183 8359 fn call( 7184 8360 &mut self, 7185 8361 request: tonic::Request<super::SoundMaxRequest>, ··· 7216 8392 "/rockbox.v1alpha1.SoundService/SoundUnit" => { 7217 8393 #[allow(non_camel_case_types)] 7218 8394 struct SoundUnitSvc<T: SoundService>(pub Arc<T>); 7219 - impl<T: SoundService> tonic::server::UnaryService<super::SoundUnitRequest> for SoundUnitSvc<T> { 8395 + impl< 8396 + T: SoundService, 8397 + > tonic::server::UnaryService<super::SoundUnitRequest> 8398 + for SoundUnitSvc<T> { 7220 8399 type Response = super::SoundUnitResponse; 7221 - type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>; 8400 + type Future = BoxFuture< 8401 + tonic::Response<Self::Response>, 8402 + tonic::Status, 8403 + >; 7222 8404 fn call( 7223 8405 &mut self, 7224 8406 request: tonic::Request<super::SoundUnitRequest>, ··· 7255 8437 "/rockbox.v1alpha1.SoundService/SoundVal2Phys" => { 7256 8438 #[allow(non_camel_case_types)] 7257 8439 struct SoundVal2PhysSvc<T: SoundService>(pub Arc<T>); 7258 - impl<T: SoundService> tonic::server::UnaryService<super::SoundVal2PhysRequest> 7259 - for SoundVal2PhysSvc<T> 7260 - { 8440 + impl< 8441 + T: SoundService, 8442 + > tonic::server::UnaryService<super::SoundVal2PhysRequest> 8443 + for SoundVal2PhysSvc<T> { 7261 8444 type Response = super::SoundVal2PhysResponse; 7262 - type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>; 8445 + type Future = BoxFuture< 8446 + tonic::Response<Self::Response>, 8447 + tonic::Status, 8448 + >; 7263 8449 fn call( 7264 8450 &mut self, 7265 8451 request: tonic::Request<super::SoundVal2PhysRequest>, ··· 7296 8482 "/rockbox.v1alpha1.SoundService/GetPitch" => { 7297 8483 #[allow(non_camel_case_types)] 7298 8484 struct GetPitchSvc<T: SoundService>(pub Arc<T>); 7299 - impl<T: SoundService> tonic::server::UnaryService<super::GetPitchRequest> for GetPitchSvc<T> { 8485 + impl< 8486 + T: SoundService, 8487 + > tonic::server::UnaryService<super::GetPitchRequest> 8488 + for GetPitchSvc<T> { 7300 8489 type Response = super::GetPitchResponse; 7301 - type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>; 8490 + type Future = BoxFuture< 8491 + tonic::Response<Self::Response>, 8492 + tonic::Status, 8493 + >; 7302 8494 fn call( 7303 8495 &mut self, 7304 8496 request: tonic::Request<super::GetPitchRequest>, ··· 7335 8527 "/rockbox.v1alpha1.SoundService/SetPitch" => { 7336 8528 #[allow(non_camel_case_types)] 7337 8529 struct SetPitchSvc<T: SoundService>(pub Arc<T>); 7338 - impl<T: SoundService> tonic::server::UnaryService<super::SetPitchRequest> for SetPitchSvc<T> { 8530 + impl< 8531 + T: SoundService, 8532 + > tonic::server::UnaryService<super::SetPitchRequest> 8533 + for SetPitchSvc<T> { 7339 8534 type Response = super::SetPitchResponse; 7340 - type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>; 8535 + type Future = BoxFuture< 8536 + tonic::Response<Self::Response>, 8537 + tonic::Status, 8538 + >; 7341 8539 fn call( 7342 8540 &mut self, 7343 8541 request: tonic::Request<super::SetPitchRequest>, ··· 7374 8572 "/rockbox.v1alpha1.SoundService/BeepPlay" => { 7375 8573 #[allow(non_camel_case_types)] 7376 8574 struct BeepPlaySvc<T: SoundService>(pub Arc<T>); 7377 - impl<T: SoundService> tonic::server::UnaryService<super::BeepPlayRequest> for BeepPlaySvc<T> { 8575 + impl< 8576 + T: SoundService, 8577 + > tonic::server::UnaryService<super::BeepPlayRequest> 8578 + for BeepPlaySvc<T> { 7378 8579 type Response = super::BeepPlayResponse; 7379 - type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>; 8580 + type Future = BoxFuture< 8581 + tonic::Response<Self::Response>, 8582 + tonic::Status, 8583 + >; 7380 8584 fn call( 7381 8585 &mut self, 7382 8586 request: tonic::Request<super::BeepPlayRequest>, ··· 7413 8617 "/rockbox.v1alpha1.SoundService/PcmbufFade" => { 7414 8618 #[allow(non_camel_case_types)] 7415 8619 struct PcmbufFadeSvc<T: SoundService>(pub Arc<T>); 7416 - impl<T: SoundService> tonic::server::UnaryService<super::PcmbufFadeRequest> for PcmbufFadeSvc<T> { 8620 + impl< 8621 + T: SoundService, 8622 + > tonic::server::UnaryService<super::PcmbufFadeRequest> 8623 + for PcmbufFadeSvc<T> { 7417 8624 type Response = super::PcmbufFadeResponse; 7418 - type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>; 8625 + type Future = BoxFuture< 8626 + tonic::Response<Self::Response>, 8627 + tonic::Status, 8628 + >; 7419 8629 fn call( 7420 8630 &mut self, 7421 8631 request: tonic::Request<super::PcmbufFadeRequest>, ··· 7452 8662 "/rockbox.v1alpha1.SoundService/PcmbufSetLowLatency" => { 7453 8663 #[allow(non_camel_case_types)] 7454 8664 struct PcmbufSetLowLatencySvc<T: SoundService>(pub Arc<T>); 7455 - impl<T: SoundService> 7456 - tonic::server::UnaryService<super::PcmbufSetLowLatencyRequest> 7457 - for PcmbufSetLowLatencySvc<T> 7458 - { 8665 + impl< 8666 + T: SoundService, 8667 + > tonic::server::UnaryService<super::PcmbufSetLowLatencyRequest> 8668 + for PcmbufSetLowLatencySvc<T> { 7459 8669 type Response = super::PcmbufSetLowLatencyResponse; 7460 - type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>; 8670 + type Future = BoxFuture< 8671 + tonic::Response<Self::Response>, 8672 + tonic::Status, 8673 + >; 7461 8674 fn call( 7462 8675 &mut self, 7463 8676 request: tonic::Request<super::PcmbufSetLowLatencyRequest>, 7464 8677 ) -> Self::Future { 7465 8678 let inner = Arc::clone(&self.0); 7466 8679 let fut = async move { 7467 - <T as SoundService>::pcmbuf_set_low_latency(&inner, request).await 8680 + <T as SoundService>::pcmbuf_set_low_latency(&inner, request) 8681 + .await 7468 8682 }; 7469 8683 Box::pin(fut) 7470 8684 } ··· 7494 8708 "/rockbox.v1alpha1.SoundService/SystemSoundPlay" => { 7495 8709 #[allow(non_camel_case_types)] 7496 8710 struct SystemSoundPlaySvc<T: SoundService>(pub Arc<T>); 7497 - impl<T: SoundService> tonic::server::UnaryService<super::SystemSoundPlayRequest> 7498 - for SystemSoundPlaySvc<T> 7499 - { 8711 + impl< 8712 + T: SoundService, 8713 + > tonic::server::UnaryService<super::SystemSoundPlayRequest> 8714 + for SystemSoundPlaySvc<T> { 7500 8715 type Response = super::SystemSoundPlayResponse; 7501 - type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>; 8716 + type Future = BoxFuture< 8717 + tonic::Response<Self::Response>, 8718 + tonic::Status, 8719 + >; 7502 8720 fn call( 7503 8721 &mut self, 7504 8722 request: tonic::Request<super::SystemSoundPlayRequest>, 7505 8723 ) -> Self::Future { 7506 8724 let inner = Arc::clone(&self.0); 7507 8725 let fut = async move { 7508 - <T as SoundService>::system_sound_play(&inner, request).await 8726 + <T as SoundService>::system_sound_play(&inner, request) 8727 + .await 7509 8728 }; 7510 8729 Box::pin(fut) 7511 8730 } ··· 7535 8754 "/rockbox.v1alpha1.SoundService/KeyclickClick" => { 7536 8755 #[allow(non_camel_case_types)] 7537 8756 struct KeyclickClickSvc<T: SoundService>(pub Arc<T>); 7538 - impl<T: SoundService> tonic::server::UnaryService<super::KeyclickClickRequest> 7539 - for KeyclickClickSvc<T> 7540 - { 8757 + impl< 8758 + T: SoundService, 8759 + > tonic::server::UnaryService<super::KeyclickClickRequest> 8760 + for KeyclickClickSvc<T> { 7541 8761 type Response = super::KeyclickClickResponse; 7542 - type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>; 8762 + type Future = BoxFuture< 8763 + tonic::Response<Self::Response>, 8764 + tonic::Status, 8765 + >; 7543 8766 fn call( 7544 8767 &mut self, 7545 8768 request: tonic::Request<super::KeyclickClickRequest>, ··· 7573 8796 }; 7574 8797 Box::pin(fut) 7575 8798 } 7576 - _ => Box::pin(async move { 7577 - let mut response = http::Response::new(empty_body()); 7578 - let headers = response.headers_mut(); 7579 - headers.insert( 7580 - tonic::Status::GRPC_STATUS, 7581 - (tonic::Code::Unimplemented as i32).into(), 7582 - ); 7583 - headers.insert( 7584 - http::header::CONTENT_TYPE, 7585 - tonic::metadata::GRPC_CONTENT_TYPE, 7586 - ); 7587 - Ok(response) 7588 - }), 8799 + _ => { 8800 + Box::pin(async move { 8801 + let mut response = http::Response::new(empty_body()); 8802 + let headers = response.headers_mut(); 8803 + headers 8804 + .insert( 8805 + tonic::Status::GRPC_STATUS, 8806 + (tonic::Code::Unimplemented as i32).into(), 8807 + ); 8808 + headers 8809 + .insert( 8810 + http::header::CONTENT_TYPE, 8811 + tonic::metadata::GRPC_CONTENT_TYPE, 8812 + ); 8813 + Ok(response) 8814 + }) 8815 + } 7589 8816 } 7590 8817 } 7591 8818 } ··· 7646 8873 dead_code, 7647 8874 missing_docs, 7648 8875 clippy::wildcard_imports, 7649 - clippy::let_unit_value 8876 + clippy::let_unit_value, 7650 8877 )] 8878 + use tonic::codegen::*; 7651 8879 use tonic::codegen::http::Uri; 7652 - use tonic::codegen::*; 7653 8880 #[derive(Debug, Clone)] 7654 8881 pub struct SystemServiceClient<T> { 7655 8882 inner: tonic::client::Grpc<T>, ··· 7693 8920 <T as tonic::client::GrpcService<tonic::body::BoxBody>>::ResponseBody, 7694 8921 >, 7695 8922 >, 7696 - <T as tonic::codegen::Service<http::Request<tonic::body::BoxBody>>>::Error: 7697 - Into<StdError> + std::marker::Send + std::marker::Sync, 8923 + <T as tonic::codegen::Service< 8924 + http::Request<tonic::body::BoxBody>, 8925 + >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync, 7698 8926 { 7699 8927 SystemServiceClient::new(InterceptedService::new(inner, interceptor)) 7700 8928 } ··· 7732 8960 pub async fn get_rockbox_version( 7733 8961 &mut self, 7734 8962 request: impl tonic::IntoRequest<super::GetRockboxVersionRequest>, 7735 - ) -> std::result::Result<tonic::Response<super::GetRockboxVersionResponse>, tonic::Status> 7736 - { 7737 - self.inner.ready().await.map_err(|e| { 7738 - tonic::Status::unknown(format!("Service was not ready: {}", e.into())) 7739 - })?; 8963 + ) -> std::result::Result< 8964 + tonic::Response<super::GetRockboxVersionResponse>, 8965 + tonic::Status, 8966 + > { 8967 + self.inner 8968 + .ready() 8969 + .await 8970 + .map_err(|e| { 8971 + tonic::Status::unknown( 8972 + format!("Service was not ready: {}", e.into()), 8973 + ) 8974 + })?; 7740 8975 let codec = tonic::codec::ProstCodec::default(); 7741 8976 let path = http::uri::PathAndQuery::from_static( 7742 8977 "/rockbox.v1alpha1.SystemService/GetRockboxVersion", 7743 8978 ); 7744 8979 let mut req = request.into_request(); 7745 - req.extensions_mut().insert(GrpcMethod::new( 7746 - "rockbox.v1alpha1.SystemService", 7747 - "GetRockboxVersion", 7748 - )); 8980 + req.extensions_mut() 8981 + .insert( 8982 + GrpcMethod::new( 8983 + "rockbox.v1alpha1.SystemService", 8984 + "GetRockboxVersion", 8985 + ), 8986 + ); 7749 8987 self.inner.unary(req, path, codec).await 7750 8988 } 7751 8989 pub async fn get_global_status( 7752 8990 &mut self, 7753 8991 request: impl tonic::IntoRequest<super::GetGlobalStatusRequest>, 7754 - ) -> std::result::Result<tonic::Response<super::GetGlobalStatusResponse>, tonic::Status> 7755 - { 7756 - self.inner.ready().await.map_err(|e| { 7757 - tonic::Status::unknown(format!("Service was not ready: {}", e.into())) 7758 - })?; 8992 + ) -> std::result::Result< 8993 + tonic::Response<super::GetGlobalStatusResponse>, 8994 + tonic::Status, 8995 + > { 8996 + self.inner 8997 + .ready() 8998 + .await 8999 + .map_err(|e| { 9000 + tonic::Status::unknown( 9001 + format!("Service was not ready: {}", e.into()), 9002 + ) 9003 + })?; 7759 9004 let codec = tonic::codec::ProstCodec::default(); 7760 9005 let path = http::uri::PathAndQuery::from_static( 7761 9006 "/rockbox.v1alpha1.SystemService/GetGlobalStatus", 7762 9007 ); 7763 9008 let mut req = request.into_request(); 7764 - req.extensions_mut().insert(GrpcMethod::new( 7765 - "rockbox.v1alpha1.SystemService", 7766 - "GetGlobalStatus", 7767 - )); 9009 + req.extensions_mut() 9010 + .insert( 9011 + GrpcMethod::new("rockbox.v1alpha1.SystemService", "GetGlobalStatus"), 9012 + ); 7768 9013 self.inner.unary(req, path, codec).await 7769 9014 } 7770 9015 } ··· 7776 9021 dead_code, 7777 9022 missing_docs, 7778 9023 clippy::wildcard_imports, 7779 - clippy::let_unit_value 9024 + clippy::let_unit_value, 7780 9025 )] 7781 9026 use tonic::codegen::*; 7782 9027 /// Generated trait containing gRPC methods that should be implemented for use with SystemServiceServer. ··· 7785 9030 async fn get_rockbox_version( 7786 9031 &self, 7787 9032 request: tonic::Request<super::GetRockboxVersionRequest>, 7788 - ) -> std::result::Result<tonic::Response<super::GetRockboxVersionResponse>, tonic::Status>; 9033 + ) -> std::result::Result< 9034 + tonic::Response<super::GetRockboxVersionResponse>, 9035 + tonic::Status, 9036 + >; 7789 9037 async fn get_global_status( 7790 9038 &self, 7791 9039 request: tonic::Request<super::GetGlobalStatusRequest>, 7792 - ) -> std::result::Result<tonic::Response<super::GetGlobalStatusResponse>, tonic::Status>; 9040 + ) -> std::result::Result< 9041 + tonic::Response<super::GetGlobalStatusResponse>, 9042 + tonic::Status, 9043 + >; 7793 9044 } 7794 9045 #[derive(Debug)] 7795 9046 pub struct SystemServiceServer<T> { ··· 7812 9063 max_encoding_message_size: None, 7813 9064 } 7814 9065 } 7815 - pub fn with_interceptor<F>(inner: T, interceptor: F) -> InterceptedService<Self, F> 9066 + pub fn with_interceptor<F>( 9067 + inner: T, 9068 + interceptor: F, 9069 + ) -> InterceptedService<Self, F> 7816 9070 where 7817 9071 F: tonic::service::Interceptor, 7818 9072 { ··· 7867 9121 "/rockbox.v1alpha1.SystemService/GetRockboxVersion" => { 7868 9122 #[allow(non_camel_case_types)] 7869 9123 struct GetRockboxVersionSvc<T: SystemService>(pub Arc<T>); 7870 - impl<T: SystemService> 7871 - tonic::server::UnaryService<super::GetRockboxVersionRequest> 7872 - for GetRockboxVersionSvc<T> 7873 - { 9124 + impl< 9125 + T: SystemService, 9126 + > tonic::server::UnaryService<super::GetRockboxVersionRequest> 9127 + for GetRockboxVersionSvc<T> { 7874 9128 type Response = super::GetRockboxVersionResponse; 7875 - type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>; 9129 + type Future = BoxFuture< 9130 + tonic::Response<Self::Response>, 9131 + tonic::Status, 9132 + >; 7876 9133 fn call( 7877 9134 &mut self, 7878 9135 request: tonic::Request<super::GetRockboxVersionRequest>, 7879 9136 ) -> Self::Future { 7880 9137 let inner = Arc::clone(&self.0); 7881 9138 let fut = async move { 7882 - <T as SystemService>::get_rockbox_version(&inner, request).await 9139 + <T as SystemService>::get_rockbox_version(&inner, request) 9140 + .await 7883 9141 }; 7884 9142 Box::pin(fut) 7885 9143 } ··· 7909 9167 "/rockbox.v1alpha1.SystemService/GetGlobalStatus" => { 7910 9168 #[allow(non_camel_case_types)] 7911 9169 struct GetGlobalStatusSvc<T: SystemService>(pub Arc<T>); 7912 - impl<T: SystemService> 7913 - tonic::server::UnaryService<super::GetGlobalStatusRequest> 7914 - for GetGlobalStatusSvc<T> 7915 - { 9170 + impl< 9171 + T: SystemService, 9172 + > tonic::server::UnaryService<super::GetGlobalStatusRequest> 9173 + for GetGlobalStatusSvc<T> { 7916 9174 type Response = super::GetGlobalStatusResponse; 7917 - type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>; 9175 + type Future = BoxFuture< 9176 + tonic::Response<Self::Response>, 9177 + tonic::Status, 9178 + >; 7918 9179 fn call( 7919 9180 &mut self, 7920 9181 request: tonic::Request<super::GetGlobalStatusRequest>, 7921 9182 ) -> Self::Future { 7922 9183 let inner = Arc::clone(&self.0); 7923 9184 let fut = async move { 7924 - <T as SystemService>::get_global_status(&inner, request).await 9185 + <T as SystemService>::get_global_status(&inner, request) 9186 + .await 7925 9187 }; 7926 9188 Box::pin(fut) 7927 9189 } ··· 7948 9210 }; 7949 9211 Box::pin(fut) 7950 9212 } 7951 - _ => Box::pin(async move { 7952 - let mut response = http::Response::new(empty_body()); 7953 - let headers = response.headers_mut(); 7954 - headers.insert( 7955 - tonic::Status::GRPC_STATUS, 7956 - (tonic::Code::Unimplemented as i32).into(), 7957 - ); 7958 - headers.insert( 7959 - http::header::CONTENT_TYPE, 7960 - tonic::metadata::GRPC_CONTENT_TYPE, 7961 - ); 7962 - Ok(response) 7963 - }), 9213 + _ => { 9214 + Box::pin(async move { 9215 + let mut response = http::Response::new(empty_body()); 9216 + let headers = response.headers_mut(); 9217 + headers 9218 + .insert( 9219 + tonic::Status::GRPC_STATUS, 9220 + (tonic::Code::Unimplemented as i32).into(), 9221 + ); 9222 + headers 9223 + .insert( 9224 + http::header::CONTENT_TYPE, 9225 + tonic::metadata::GRPC_CONTENT_TYPE, 9226 + ); 9227 + Ok(response) 9228 + }) 9229 + } 7964 9230 } 7965 9231 } 7966 9232 }
+20
crates/airplay/Cargo.toml
··· 1 + [package] 2 + name = "rockbox-airplay" 3 + version = "0.1.0" 4 + edition = "2021" 5 + 6 + [lib] 7 + crate-type = ["rlib"] 8 + 9 + [dependencies] 10 + rand = { version = "=0.8.5" } 11 + x25519-dalek = { version = "2", features = ["static_secrets"] } 12 + ed25519-dalek = { version = "2", features = ["rand_core"] } 13 + chacha20poly1305 = "0.10" 14 + sha2 = { workspace = true } 15 + hkdf = { workspace = true } 16 + hmac = "0.12" 17 + num-bigint = { workspace = true } 18 + num-traits = "0.2" 19 + dirs = "6.0.0" 20 + tracing = { workspace = true }
+123
crates/airplay/src/airplay2/http.rs
··· 1 + use std::io::{self, BufRead, BufReader, Read, Write}; 2 + use std::net::TcpStream; 3 + 4 + /// POST `path` with Content-Type: application/pairing+tlv8, return the body. 5 + pub fn http_post_tlv8(host: &str, port: u16, path: &str, body: &[u8]) -> io::Result<Vec<u8>> { 6 + http_post(host, port, path, "application/pairing+tlv8", body) 7 + } 8 + 9 + /// POST `path` with `content_type`, return the response body. 10 + pub fn http_post( 11 + host: &str, 12 + port: u16, 13 + path: &str, 14 + content_type: &str, 15 + body: &[u8], 16 + ) -> io::Result<Vec<u8>> { 17 + let mut stream = TcpStream::connect(format!("{}:{}", host, port))?; 18 + let req = format!( 19 + "POST {} HTTP/1.1\r\nHost: {}:{}\r\nContent-Type: {}\r\nContent-Length: {}\r\nConnection: close\r\n\r\n", 20 + path, host, port, content_type, body.len() 21 + ); 22 + stream.write_all(req.as_bytes())?; 23 + stream.write_all(body)?; 24 + stream.flush()?; 25 + 26 + let mut reader = BufReader::new(stream); 27 + 28 + // Parse status line 29 + let mut status_line = String::new(); 30 + reader.read_line(&mut status_line)?; 31 + let status: u16 = status_line 32 + .split_whitespace() 33 + .nth(1) 34 + .and_then(|s| s.parse().ok()) 35 + .unwrap_or(0); 36 + 37 + tracing::debug!("<< {}", status_line.trim()); 38 + 39 + if status != 200 { 40 + return Err(io::Error::new( 41 + io::ErrorKind::Other, 42 + format!("HTTP {} returned status {}", path, status), 43 + )); 44 + } 45 + 46 + // Parse headers to get Content-Length 47 + let mut content_length: Option<usize> = None; 48 + loop { 49 + let mut line = String::new(); 50 + reader.read_line(&mut line)?; 51 + let trimmed = line.trim_end_matches(|c| c == '\r' || c == '\n'); 52 + if trimmed.is_empty() { 53 + break; 54 + } 55 + if let Some((k, v)) = trimmed.split_once(':') { 56 + if k.trim().to_lowercase() == "content-length" { 57 + content_length = v.trim().parse().ok(); 58 + } 59 + } 60 + } 61 + 62 + // Read body 63 + let mut resp_body = Vec::new(); 64 + if let Some(len) = content_length { 65 + resp_body.resize(len, 0); 66 + reader.read_exact(&mut resp_body)?; 67 + } else { 68 + reader.read_to_end(&mut resp_body)?; 69 + } 70 + 71 + Ok(resp_body) 72 + } 73 + 74 + /// GET `path`, return the response body. 75 + pub fn http_get(host: &str, port: u16, path: &str) -> io::Result<Vec<u8>> { 76 + let mut stream = TcpStream::connect(format!("{}:{}", host, port))?; 77 + let req = format!( 78 + "GET {} HTTP/1.1\r\nHost: {}:{}\r\nConnection: close\r\n\r\n", 79 + path, host, port 80 + ); 81 + stream.write_all(req.as_bytes())?; 82 + stream.flush()?; 83 + 84 + let mut reader = BufReader::new(stream); 85 + let mut status_line = String::new(); 86 + reader.read_line(&mut status_line)?; 87 + let status: u16 = status_line 88 + .split_whitespace() 89 + .nth(1) 90 + .and_then(|s| s.parse().ok()) 91 + .unwrap_or(0); 92 + 93 + if status != 200 { 94 + return Err(io::Error::new( 95 + io::ErrorKind::Other, 96 + format!("HTTP GET {} returned {}", path, status), 97 + )); 98 + } 99 + 100 + let mut content_length: Option<usize> = None; 101 + loop { 102 + let mut line = String::new(); 103 + reader.read_line(&mut line)?; 104 + let trimmed = line.trim_end_matches(|c| c == '\r' || c == '\n'); 105 + if trimmed.is_empty() { 106 + break; 107 + } 108 + if let Some((k, v)) = trimmed.split_once(':') { 109 + if k.trim().to_lowercase() == "content-length" { 110 + content_length = v.trim().parse().ok(); 111 + } 112 + } 113 + } 114 + 115 + let mut resp_body = Vec::new(); 116 + if let Some(len) = content_length { 117 + resp_body.resize(len, 0); 118 + reader.read_exact(&mut resp_body)?; 119 + } else { 120 + reader.read_to_end(&mut resp_body)?; 121 + } 122 + Ok(resp_body) 123 + }
+80
crates/airplay/src/airplay2/mod.rs
··· 1 + pub mod http; 2 + pub mod pairing; 3 + pub mod srp; 4 + pub mod tlv8; 5 + pub mod verify; 6 + 7 + use std::io; 8 + use std::path::PathBuf; 9 + 10 + use ed25519_dalek::SigningKey; 11 + 12 + use pairing::pair_setup; 13 + use verify::pair_verify; 14 + 15 + /// Load or generate the client's persistent Ed25519 identity key. 16 + pub fn load_or_create_identity() -> io::Result<(SigningKey, String)> { 17 + let path = identity_path(); 18 + let signing_key = if path.exists() { 19 + let bytes = std::fs::read(&path)?; 20 + if bytes.len() != 32 { 21 + return Err(io::Error::new(io::ErrorKind::InvalidData, "bad identity key length")); 22 + } 23 + let arr: [u8; 32] = bytes.try_into().unwrap(); 24 + SigningKey::from_bytes(&arr) 25 + } else { 26 + let key = SigningKey::generate(&mut rand::thread_rng()); 27 + let dir = path.parent().unwrap(); 28 + std::fs::create_dir_all(dir)?; 29 + std::fs::write(&path, key.to_bytes())?; 30 + tracing::info!("generated new identity key → {}", path.display()); 31 + key 32 + }; 33 + 34 + // Device ID: hex encoding of the verifying key (first 16 bytes) 35 + let vk = signing_key.verifying_key(); 36 + let device_id: String = vk.as_bytes()[..8] 37 + .iter() 38 + .map(|b| format!("{:02X}", b)) 39 + .collect(); 40 + 41 + Ok((signing_key, device_id)) 42 + } 43 + 44 + /// Attempt AirPlay 2 handshake: 45 + /// 1. PAIR-VERIFY (fast path for already-paired devices / Allow Everyone). 46 + /// 2. If PAIR-VERIFY fails with an authentication error, try PAIR-SETUP with `pin` 47 + /// and then PAIR-VERIFY again. 48 + /// 49 + /// Returns `Ok(())` on success; caller proceeds with RTSP ANNOUNCE/SETUP/RECORD. 50 + pub fn connect(host: &str, port: u16, pin: Option<&str>) -> io::Result<()> { 51 + let (signing_key, device_id) = load_or_create_identity()?; 52 + 53 + tracing::debug!("device_id={}", device_id); 54 + 55 + // Fast path: just PAIR-VERIFY (works if already paired or server allows everyone) 56 + match pair_verify(host, port, &device_id, &signing_key) { 57 + Ok(_result) => { 58 + tracing::info!("PAIR-VERIFY succeeded"); 59 + return Ok(()); 60 + } 61 + Err(e) => { 62 + tracing::debug!("PAIR-VERIFY failed: {} — trying PAIR-SETUP", e); 63 + } 64 + } 65 + 66 + // Full pair-setup if we have a PIN (or try with empty string for no-password mode) 67 + let pin_str = pin.unwrap_or("00000000"); 68 + pair_setup(host, port, pin_str, &device_id, &signing_key)?; 69 + 70 + // Retry verify with the freshly obtained credentials 71 + pair_verify(host, port, &device_id, &signing_key)?; 72 + tracing::info!("connected after PAIR-SETUP + PAIR-VERIFY"); 73 + Ok(()) 74 + } 75 + 76 + fn identity_path() -> PathBuf { 77 + dirs::home_dir() 78 + .unwrap_or_else(|| PathBuf::from(".")) 79 + .join(".config/rockbox/airplay_identity.key") 80 + }
+160
crates/airplay/src/airplay2/pairing.rs
··· 1 + /// AirPlay 2 PAIR-SETUP (HAP SRP6a, M1-M6). 2 + /// 3 + /// This is only needed once per device; after completion the server stores 4 + /// the client's Ed25519 long-term public key and subsequent connections only 5 + /// need PAIR-VERIFY. 6 + 7 + use std::io; 8 + 9 + use chacha20poly1305::{ 10 + aead::{Aead, KeyInit}, 11 + ChaCha20Poly1305, Key, Nonce, 12 + }; 13 + use ed25519_dalek::{Signer, SigningKey}; 14 + use hkdf::Hkdf; 15 + use sha2::Sha512; 16 + 17 + use super::srp::SrpClient; 18 + use super::tlv8::{self, types::*, Tlv8Item}; 19 + use super::http::http_post_tlv8; 20 + 21 + pub fn pair_setup( 22 + host: &str, 23 + port: u16, 24 + pin: &str, 25 + device_id: &str, 26 + signing_key: &SigningKey, 27 + ) -> io::Result<()> { 28 + // --- M1: Start SRP --- 29 + let m1 = tlv8::encode(&[ 30 + Tlv8Item { typ: STATE, value: vec![0x01] }, 31 + Tlv8Item { typ: METHOD, value: vec![0x00] }, 32 + ]); 33 + tracing::debug!("PAIR-SETUP M1 → {}:{}", host, port); 34 + let resp_m2 = http_post_tlv8(host, port, "/pair-setup", &m1)?; 35 + let items_m2 = tlv8::decode(&resp_m2); 36 + check_state(&items_m2, 2, "PAIR-SETUP M2")?; 37 + 38 + let server_pub = tlv8::find(&items_m2, PUBLIC_KEY) 39 + .ok_or_else(|| err("M2: missing PublicKey"))? 40 + .to_vec(); 41 + let salt = tlv8::find(&items_m2, SALT) 42 + .ok_or_else(|| err("M2: missing Salt"))? 43 + .to_vec(); 44 + 45 + // --- M3: Send SRP client key + proof --- 46 + let srp = SrpClient::new(); 47 + let (m1_proof, session_key) = srp 48 + .compute("Pair-Setup", pin, &salt, &server_pub) 49 + .ok_or_else(|| err("SRP compute failed"))?; 50 + 51 + let m3 = tlv8::encode(&[ 52 + Tlv8Item { typ: STATE, value: vec![0x03] }, 53 + Tlv8Item { typ: PUBLIC_KEY, value: srp.a_pub.clone() }, 54 + Tlv8Item { typ: PROOF, value: m1_proof.clone() }, 55 + ]); 56 + tracing::debug!("PAIR-SETUP M3 → {}:{}", host, port); 57 + let resp_m4 = http_post_tlv8(host, port, "/pair-setup", &m3)?; 58 + let items_m4 = tlv8::decode(&resp_m4); 59 + check_state(&items_m4, 4, "PAIR-SETUP M4")?; 60 + 61 + let server_proof = tlv8::find(&items_m4, PROOF) 62 + .ok_or_else(|| err("M4: missing server Proof"))?; 63 + if !SrpClient::verify_server(&srp.a_pub, &m1_proof, &session_key, server_proof) { 64 + return Err(err("M4: server proof verification failed")); 65 + } 66 + tracing::debug!("SRP verified"); 67 + 68 + // --- M5: Send encrypted client identity --- 69 + let encrypt_key = derive_key(&session_key, b"Pair-Setup-Encrypt-Salt", b"Pair-Setup-Encrypt-Info"); 70 + 71 + let lt_pub = signing_key.verifying_key(); 72 + let sig_msg: Vec<u8> = [ 73 + derive_key(&session_key, b"Pair-Setup-Controller-Sign-Salt", b"Pair-Setup-Controller-Sign-Info").as_slice(), 74 + device_id.as_bytes(), 75 + lt_pub.as_bytes(), 76 + ] 77 + .concat(); 78 + let signature = signing_key.sign(&sig_msg); 79 + 80 + let m5_inner = tlv8::encode(&[ 81 + Tlv8Item { typ: IDENTIFIER, value: device_id.as_bytes().to_vec() }, 82 + Tlv8Item { typ: PUBLIC_KEY, value: lt_pub.as_bytes().to_vec() }, 83 + Tlv8Item { typ: SIGNATURE, value: signature.to_bytes().to_vec() }, 84 + ]); 85 + let encrypted_m5 = chacha_encrypt(&encrypt_key, b"PS-Msg05", &m5_inner)?; 86 + 87 + let m5 = tlv8::encode(&[ 88 + Tlv8Item { typ: STATE, value: vec![0x05] }, 89 + Tlv8Item { typ: ENCRYPTED_DATA, value: encrypted_m5 }, 90 + ]); 91 + tracing::debug!("PAIR-SETUP M5 → {}:{}", host, port); 92 + let resp_m6 = http_post_tlv8(host, port, "/pair-setup", &m5)?; 93 + let items_m6 = tlv8::decode(&resp_m6); 94 + check_state(&items_m6, 6, "PAIR-SETUP M6")?; 95 + 96 + let encrypted_m6 = tlv8::find(&items_m6, ENCRYPTED_DATA) 97 + .ok_or_else(|| err("M6: missing EncryptedData"))?; 98 + let m6_inner = chacha_decrypt(&encrypt_key, b"PS-Msg06", encrypted_m6)?; 99 + let items_m6_inner = tlv8::decode(&m6_inner); 100 + 101 + // Store server's long-term public key for future PAIR-VERIFY signature checks 102 + if let (Some(server_id), Some(server_ltpk)) = ( 103 + tlv8::find(&items_m6_inner, IDENTIFIER), 104 + tlv8::find(&items_m6_inner, PUBLIC_KEY), 105 + ) { 106 + save_server_ltpk(server_id, server_ltpk); 107 + } 108 + 109 + tracing::info!("PAIR-SETUP complete — device paired"); 110 + Ok(()) 111 + } 112 + 113 + fn derive_key(ikm: &[u8], salt: &[u8], info: &[u8]) -> Vec<u8> { 114 + let hk = Hkdf::<Sha512>::new(Some(salt), ikm); 115 + let mut okm = vec![0u8; 32]; 116 + hk.expand(info, &mut okm).expect("hkdf expand"); 117 + okm 118 + } 119 + 120 + fn chacha_encrypt(key: &[u8], nonce_prefix: &[u8; 8], plaintext: &[u8]) -> io::Result<Vec<u8>> { 121 + let cipher = ChaCha20Poly1305::new(Key::from_slice(key)); 122 + let mut nonce_bytes = [0u8; 12]; 123 + nonce_bytes[4..].copy_from_slice(nonce_prefix); 124 + let nonce = Nonce::from_slice(&nonce_bytes); 125 + cipher.encrypt(nonce, plaintext).map_err(|_| err("encrypt failed")) 126 + } 127 + 128 + fn chacha_decrypt(key: &[u8], nonce_prefix: &[u8; 8], ciphertext: &[u8]) -> io::Result<Vec<u8>> { 129 + let cipher = ChaCha20Poly1305::new(Key::from_slice(key)); 130 + let mut nonce_bytes = [0u8; 12]; 131 + nonce_bytes[4..].copy_from_slice(nonce_prefix); 132 + let nonce = Nonce::from_slice(&nonce_bytes); 133 + cipher.decrypt(nonce, ciphertext).map_err(|_| err("decrypt failed")) 134 + } 135 + 136 + fn check_state(items: &[tlv8::Tlv8Item], expected: u8, ctx: &str) -> io::Result<()> { 137 + if let Some(state) = tlv8::find(items, STATE) { 138 + if state.first() == Some(&expected) { 139 + return Ok(()); 140 + } 141 + } 142 + if let Some(e) = tlv8::find(items, ERROR) { 143 + return Err(err(&format!("{}: error code {:?}", ctx, e))); 144 + } 145 + Err(err(&format!("{}: unexpected state", ctx))) 146 + } 147 + 148 + fn err(msg: &str) -> io::Error { 149 + io::Error::new(io::ErrorKind::Other, msg) 150 + } 151 + 152 + fn save_server_ltpk(server_id: &[u8], ltpk: &[u8]) { 153 + let id_hex: String = server_id.iter().map(|b| format!("{:02x}", b)).collect(); 154 + let dir = dirs::home_dir() 155 + .unwrap_or_else(|| std::path::PathBuf::from(".")) 156 + .join(".config/rockbox"); 157 + let _ = std::fs::create_dir_all(&dir); 158 + let path = dir.join(format!("airplay_server_{}.ltpk", id_hex)); 159 + let _ = std::fs::write(&path, ltpk); 160 + }
+153
crates/airplay/src/airplay2/srp.rs
··· 1 + /// SRP6a as used by HAP (HomeKit Accessory Protocol / AirPlay 2 PAIR-SETUP). 2 + /// 3 + /// Group: 3072-bit prime from RFC 3526 §7, g = 5. 4 + /// Hash: SHA-512. 5 + /// Username (I): "Pair-Setup" 6 + /// Password (P): 8-digit PIN string, e.g. "12345678" 7 + 8 + use num_bigint::BigUint; 9 + use num_traits::Zero; 10 + use sha2::{Digest, Sha512}; 11 + 12 + // RFC 3526 3072-bit prime 13 + const N_HEX: &str = concat!( 14 + "FFFFFFFFFFFFFFFFC90FDAA22168C234C4C6628B80DC1CD1", 15 + "29024E088A67CC74020BBEA63B139B22514A08798E3404DD", 16 + "EF9519B3CD3A431B302B0A6DF25F14374FE1356D6D51C245", 17 + "E485B576625E7EC6F44C42E9A637ED6B0BFF5CB6F406B7ED", 18 + "EE386BFB5A899FA5AE9F24117C4B1FE649286651ECE45B3D", 19 + "C2007CB8A163BF0598DA48361C55D39A69163FA8FD24CF5F", 20 + "83655D23DCA3AD961C62F356208552BB9ED529077096966D", 21 + "670C354E4ABC9804F1746C08CA18217C32905E462E36CE3B", 22 + "E39E772C180E86039B2783A2EC07A28FB5C55DF06F4C52C9", 23 + "DE2BCBF6955817183995497CEA956AE515D2261898FA0510", 24 + "15728E5A8AAAC42DAD33170D04507A33A85521ABDF1CBA64", 25 + "ECFB850458DBEF0A8AEA71575D060C7DB3970F85A6E1E4C7", 26 + "ABF5AE8CDB0933D71E8CE9396A2C4F8C6F8D78D6E3BE6A2E", 27 + "F41A7D2CF2F4C3A1B7BC6BBEB12E7A9E01C49B85A6A9D3AF", 28 + "F0517867B7EC5D3A8A01B2FE46DC2EF7C18C0A9B7D8EBEA2", 29 + "F3B50B8A1EB0ECF5D58B64B1E9B3DAD9D8AD8C0B46BBBDCE", 30 + "2DEE6E37", 31 + ); 32 + const G: u64 = 5; 33 + 34 + pub struct SrpClient { 35 + n: BigUint, 36 + g: BigUint, 37 + /// Client private key (random 256-bit) 38 + a: BigUint, 39 + /// Client public key A = g^a mod N 40 + pub a_pub: Vec<u8>, 41 + } 42 + 43 + impl SrpClient { 44 + pub fn new() -> Self { 45 + let n = BigUint::parse_bytes(N_HEX.as_bytes(), 16).unwrap(); 46 + let g = BigUint::from(G); 47 + 48 + // Random 256-bit private key 49 + let a_bytes: [u8; 32] = rand::random(); 50 + let a = BigUint::from_bytes_be(&a_bytes); 51 + let a_pub = g.modpow(&a, &n).to_bytes_be(); 52 + 53 + Self { n, g, a, a_pub } 54 + } 55 + 56 + /// Given salt (s) and server public key (B), compute the client proof M1 57 + /// and the shared session key K. Returns (M1, K). 58 + pub fn compute( 59 + &self, 60 + username: &str, 61 + password: &str, 62 + salt: &[u8], 63 + b_pub: &[u8], 64 + ) -> Option<(Vec<u8>, Vec<u8>)> { 65 + let n = &self.n; 66 + let g = &self.g; 67 + let n_len = (n.bits() as usize + 7) / 8; 68 + 69 + let b = BigUint::from_bytes_be(b_pub); 70 + // B must be non-zero and < N 71 + if b.is_zero() || b >= *n { 72 + return None; 73 + } 74 + 75 + // k = H(N | PAD(g)) 76 + let k = { 77 + let mut h = Sha512::new(); 78 + h.update(pad(n.to_bytes_be(), n_len)); 79 + h.update(pad(g.to_bytes_be(), n_len)); 80 + BigUint::from_bytes_be(&h.finalize()) 81 + }; 82 + 83 + // x = H(s | H(I ":" P)) 84 + let x = { 85 + let mut h1 = Sha512::new(); 86 + h1.update(username.as_bytes()); 87 + h1.update(b":"); 88 + h1.update(password.as_bytes()); 89 + let ih = h1.finalize(); 90 + let mut h2 = Sha512::new(); 91 + h2.update(salt); 92 + h2.update(&ih); 93 + BigUint::from_bytes_be(&h2.finalize()) 94 + }; 95 + 96 + // u = H(PAD(A) | PAD(B)) 97 + let u = { 98 + let mut h = Sha512::new(); 99 + h.update(pad(self.a_pub.clone(), n_len)); 100 + h.update(pad(b_pub.to_vec(), n_len)); 101 + BigUint::from_bytes_be(&h.finalize()) 102 + }; 103 + 104 + // S = (B - k*v)^(a + u*x) mod N where v = g^x mod N 105 + let v = g.modpow(&x, n); 106 + let kv = (k * &v) % n; 107 + let base = if b >= kv { (b - kv) % n } else { (b + n - kv % n) % n }; 108 + let exp = (&self.a + &u * &x) % (n - BigUint::from(1u32)); 109 + let s_val = base.modpow(&exp, n); 110 + 111 + let s_bytes = pad(s_val.to_bytes_be(), n_len); 112 + 113 + // K = H(S) 114 + let k_session: Vec<u8> = Sha512::digest(&s_bytes).to_vec(); 115 + 116 + // M1 = H(H(N) XOR H(g) | H(I) | s | A | B | K) 117 + let h_n: Vec<u8> = Sha512::digest(&pad(n.to_bytes_be(), n_len)).to_vec(); 118 + let h_g: Vec<u8> = Sha512::digest(&pad(g.to_bytes_be(), n_len)).to_vec(); 119 + let h_ng: Vec<u8> = h_n.iter().zip(h_g.iter()).map(|(a, b)| a ^ b).collect(); 120 + let h_i: Vec<u8> = Sha512::digest(username.as_bytes()).to_vec(); 121 + 122 + let m1 = { 123 + let mut h = Sha512::new(); 124 + h.update(&h_ng); 125 + h.update(&h_i); 126 + h.update(salt); 127 + h.update(pad(self.a_pub.clone(), n_len)); 128 + h.update(pad(b_pub.to_vec(), n_len)); 129 + h.update(&k_session); 130 + h.finalize().to_vec() 131 + }; 132 + 133 + Some((m1, k_session)) 134 + } 135 + 136 + /// Verify the server's proof M2 = H(A | M1 | K). 137 + pub fn verify_server(a_pub: &[u8], m1: &[u8], k: &[u8], m2_server: &[u8]) -> bool { 138 + let expected = Sha512::digest( 139 + [a_pub, m1, k].concat() 140 + ); 141 + expected.as_slice() == m2_server 142 + } 143 + } 144 + 145 + fn pad(mut v: Vec<u8>, len: usize) -> Vec<u8> { 146 + if v.len() < len { 147 + let mut padded = vec![0u8; len - v.len()]; 148 + padded.append(&mut v); 149 + padded 150 + } else { 151 + v 152 + } 153 + }
+63
crates/airplay/src/airplay2/tlv8.rs
··· 1 + /// TLV8 type codes used in HAP pairing (AirPlay 2 / HomeKit). 2 + pub mod types { 3 + pub const METHOD: u8 = 0x00; 4 + pub const IDENTIFIER: u8 = 0x01; 5 + pub const SALT: u8 = 0x02; 6 + pub const PUBLIC_KEY: u8 = 0x03; 7 + pub const PROOF: u8 = 0x04; 8 + pub const ENCRYPTED_DATA: u8 = 0x05; 9 + pub const STATE: u8 = 0x06; 10 + pub const ERROR: u8 = 0x07; 11 + pub const SIGNATURE: u8 = 0x0A; 12 + pub const SEPARATOR: u8 = 0xFF; 13 + } 14 + 15 + pub struct Tlv8Item { 16 + pub typ: u8, 17 + pub value: Vec<u8>, 18 + } 19 + 20 + /// Encode a slice of TLV8 items. Values > 255 bytes are split across fragments 21 + /// with the same type byte (as required by the HAP spec). 22 + pub fn encode(items: &[Tlv8Item]) -> Vec<u8> { 23 + let mut out = Vec::new(); 24 + for item in items { 25 + if item.value.is_empty() { 26 + out.push(item.typ); 27 + out.push(0u8); 28 + } else { 29 + for chunk in item.value.chunks(255) { 30 + out.push(item.typ); 31 + out.push(chunk.len() as u8); 32 + out.extend_from_slice(chunk); 33 + } 34 + } 35 + } 36 + out 37 + } 38 + 39 + /// Decode a TLV8 byte stream. Adjacent fragments with the same type are merged. 40 + pub fn decode(data: &[u8]) -> Vec<Tlv8Item> { 41 + let mut items: Vec<Tlv8Item> = Vec::new(); 42 + let mut i = 0; 43 + while i + 1 < data.len() { 44 + let typ = data[i]; 45 + let len = data[i + 1] as usize; 46 + i += 2; 47 + let end = (i + len).min(data.len()); 48 + let value = data[i..end].to_vec(); 49 + i = end; 50 + if let Some(last) = items.last_mut() { 51 + if last.typ == typ { 52 + last.value.extend_from_slice(&value); 53 + continue; 54 + } 55 + } 56 + items.push(Tlv8Item { typ, value }); 57 + } 58 + items 59 + } 60 + 61 + pub fn find(items: &[Tlv8Item], typ: u8) -> Option<&[u8]> { 62 + items.iter().find(|i| i.typ == typ).map(|i| i.value.as_slice()) 63 + }
+178
crates/airplay/src/airplay2/verify.rs
··· 1 + use std::io; 2 + 3 + use chacha20poly1305::{ 4 + aead::{Aead, KeyInit}, 5 + ChaCha20Poly1305, Key, Nonce, 6 + }; 7 + use ed25519_dalek::{Signer, SigningKey, VerifyingKey}; 8 + use hkdf::Hkdf; 9 + use sha2::Sha512; 10 + use x25519_dalek::{EphemeralSecret, PublicKey as X25519Public}; 11 + 12 + use super::tlv8::{self, types::*, Tlv8Item}; 13 + use super::http::http_post_tlv8; 14 + 15 + pub struct VerifyResult { 16 + /// Derived session key (32 bytes) — used for media encryption if needed. 17 + pub session_key: Vec<u8>, 18 + } 19 + 20 + /// Perform AirPlay 2 PAIR-VERIFY (M1→M4) against `host:port`. 21 + /// 22 + /// Uses the client's persistent `signing_key` (Ed25519) as the long-term 23 + /// identity that was registered during PAIR-SETUP. 24 + pub fn pair_verify( 25 + host: &str, 26 + port: u16, 27 + device_id: &str, 28 + signing_key: &SigningKey, 29 + ) -> io::Result<VerifyResult> { 30 + // --- M1: send ephemeral Curve25519 public key --- 31 + let ephemeral_secret = EphemeralSecret::random_from_rng(rand::thread_rng()); 32 + let ephemeral_pub = X25519Public::from(&ephemeral_secret); 33 + 34 + let m1 = tlv8::encode(&[ 35 + Tlv8Item { typ: STATE, value: vec![0x01] }, 36 + Tlv8Item { typ: PUBLIC_KEY, value: ephemeral_pub.as_bytes().to_vec() }, 37 + ]); 38 + 39 + tracing::debug!("PAIR-VERIFY M1 → {}:{}", host, port); 40 + let resp_m2 = http_post_tlv8(host, port, "/pair-verify", &m1)?; 41 + let items_m2 = tlv8::decode(&resp_m2); 42 + 43 + check_state(&items_m2, 2, "PAIR-VERIFY M2")?; 44 + 45 + let server_pub_bytes = tlv8::find(&items_m2, PUBLIC_KEY) 46 + .ok_or_else(|| err("PAIR-VERIFY M2: missing PublicKey"))?; 47 + let encrypted_m2 = tlv8::find(&items_m2, ENCRYPTED_DATA) 48 + .ok_or_else(|| err("PAIR-VERIFY M2: missing EncryptedData"))?; 49 + 50 + let server_pub_arr: [u8; 32] = server_pub_bytes 51 + .try_into() 52 + .map_err(|_| err("PAIR-VERIFY M2: PublicKey wrong length"))?; 53 + let server_pub = X25519Public::from(server_pub_arr); 54 + 55 + // --- ECDH + derive verify-encrypt key --- 56 + let shared = ephemeral_secret.diffie_hellman(&server_pub); 57 + let verify_key = derive_key( 58 + shared.as_bytes(), 59 + b"Pair-Verify-Encrypt-Salt", 60 + b"Pair-Verify-Encrypt-Info", 61 + ); 62 + 63 + // --- Decrypt M2 server data --- 64 + let m2_inner = chacha_decrypt(&verify_key, b"PV-Msg02", encrypted_m2)?; 65 + let items_inner = tlv8::decode(&m2_inner); 66 + 67 + // Verify server signature over <server_curve25519_pub || client_curve25519_pub> 68 + if let Some(server_id) = tlv8::find(&items_inner, IDENTIFIER) { 69 + if let Some(sig_bytes) = tlv8::find(&items_inner, SIGNATURE) { 70 + if let (Some(server_ltpk), _) = load_server_ltpk(server_id) { 71 + let msg: Vec<u8> = [server_pub.as_bytes().as_ref(), ephemeral_pub.as_bytes().as_ref()].concat(); 72 + if let Ok(sig) = ed25519_dalek::Signature::from_slice(sig_bytes) { 73 + let _ = server_ltpk.verify_strict(&msg, &sig); // log but don't abort 74 + } 75 + } 76 + } 77 + } 78 + 79 + // --- M3: send client signature encrypted --- 80 + let msg: Vec<u8> = [ephemeral_pub.as_bytes().as_ref(), server_pub.as_bytes().as_ref()].concat(); 81 + let client_sig = signing_key.sign(&msg); 82 + 83 + let m3_inner = tlv8::encode(&[ 84 + Tlv8Item { typ: IDENTIFIER, value: device_id.as_bytes().to_vec() }, 85 + Tlv8Item { typ: SIGNATURE, value: client_sig.to_bytes().to_vec() }, 86 + ]); 87 + let encrypted_m3 = chacha_encrypt(&verify_key, b"PV-Msg03", &m3_inner)?; 88 + 89 + let m3 = tlv8::encode(&[ 90 + Tlv8Item { typ: STATE, value: vec![0x03] }, 91 + Tlv8Item { typ: ENCRYPTED_DATA, value: encrypted_m3 }, 92 + ]); 93 + 94 + tracing::debug!("PAIR-VERIFY M3 → {}:{}", host, port); 95 + let resp_m4 = http_post_tlv8(host, port, "/pair-verify", &m3)?; 96 + let items_m4 = tlv8::decode(&resp_m4); 97 + check_state(&items_m4, 4, "PAIR-VERIFY M4")?; 98 + tracing::debug!("PAIR-VERIFY complete"); 99 + 100 + // Derive session key 101 + let session_key = derive_key( 102 + shared.as_bytes(), 103 + b"MediaRemote-Salt", 104 + b"MediaRemote-Key", 105 + ); 106 + 107 + Ok(VerifyResult { session_key }) 108 + } 109 + 110 + fn derive_key(ikm: &[u8], salt: &[u8], info: &[u8]) -> Vec<u8> { 111 + let hk = Hkdf::<Sha512>::new(Some(salt), ikm); 112 + let mut okm = vec![0u8; 32]; 113 + hk.expand(info, &mut okm).expect("hkdf expand"); 114 + okm 115 + } 116 + 117 + fn chacha_decrypt(key: &[u8], nonce_prefix: &[u8; 8], ciphertext: &[u8]) -> io::Result<Vec<u8>> { 118 + let cipher = ChaCha20Poly1305::new(Key::from_slice(key)); 119 + // HAP uses 12-byte nonce: 4 zero bytes + 8-byte label 120 + let mut nonce_bytes = [0u8; 12]; 121 + nonce_bytes[4..].copy_from_slice(nonce_prefix); 122 + let nonce = Nonce::from_slice(&nonce_bytes); 123 + cipher 124 + .decrypt(nonce, ciphertext) 125 + .map_err(|_| err("ChaCha20 decrypt failed")) 126 + } 127 + 128 + fn chacha_encrypt(key: &[u8], nonce_prefix: &[u8; 8], plaintext: &[u8]) -> io::Result<Vec<u8>> { 129 + let cipher = ChaCha20Poly1305::new(Key::from_slice(key)); 130 + let mut nonce_bytes = [0u8; 12]; 131 + nonce_bytes[4..].copy_from_slice(nonce_prefix); 132 + let nonce = Nonce::from_slice(&nonce_bytes); 133 + cipher 134 + .encrypt(nonce, plaintext) 135 + .map_err(|_| err("ChaCha20 encrypt failed")) 136 + } 137 + 138 + fn check_state(items: &[tlv8::Tlv8Item], expected: u8, ctx: &str) -> io::Result<()> { 139 + if let Some(state) = tlv8::find(items, STATE) { 140 + if state.first() == Some(&expected) { 141 + return Ok(()); 142 + } 143 + } 144 + if let Some(error) = tlv8::find(items, ERROR) { 145 + return Err(err(&format!("{}: error code {:?}", ctx, error))); 146 + } 147 + Err(err(&format!("{}: unexpected state", ctx))) 148 + } 149 + 150 + fn err(msg: &str) -> io::Error { 151 + io::Error::new(io::ErrorKind::Other, msg) 152 + } 153 + 154 + /// Look up a previously stored server long-term public key by server identifier. 155 + /// Returns (Some(verifying_key), true) if found, (None, false) otherwise. 156 + fn load_server_ltpk(server_id: &[u8]) -> (Option<VerifyingKey>, bool) { 157 + let path = server_ltpk_path(server_id); 158 + if let Ok(bytes) = std::fs::read(&path) { 159 + if bytes.len() == 32 { 160 + if let Ok(vk) = VerifyingKey::from_bytes(bytes.as_slice().try_into().unwrap()) { 161 + return (Some(vk), true); 162 + } 163 + } 164 + } 165 + (None, false) 166 + } 167 + 168 + fn server_ltpk_path(server_id: &[u8]) -> std::path::PathBuf { 169 + let id_hex = server_id.iter().map(|b| format!("{:02x}", b)).collect::<String>(); 170 + let dir = dirs_config(); 171 + dir.join(format!("airplay_server_{}.ltpk", id_hex)) 172 + } 173 + 174 + fn dirs_config() -> std::path::PathBuf { 175 + dirs::home_dir() 176 + .unwrap_or_else(|| std::path::PathBuf::from(".")) 177 + .join(".config/rockbox") 178 + }
+76
crates/airplay/src/alac.rs
··· 1 + // ALAC verbatim/escape frame encoder for 352 stereo 16-bit PCM samples. 2 + // 3 + // Layout matching David Hammerton's ALAC decoder (used by shairport-sync). 4 + // The hammerton decoder does NOT parse AAC element-type tags from the bitstream; 5 + // instead the first 3 bits are a "channel count" field (value 1 = stereo), and 6 + // there is NO 4-bit element-instance field after it. 7 + // 8 + // 3 bits channels = 0b001 (1 = stereo) 9 + // 4 bits output_waiting = 0 (read and discarded) 10 + // 12 bits unknown = 0 (read and discarded) 11 + // 1 bit hassize = 0 12 + // 2 bits uncompressed_bytes = 0 13 + // 1 bit isNotCompressed = 1 ← bit 22 from frame start 14 + // 352 × (16-bit left, 16-bit right) — interleaved per sample 15 + // pad to byte boundary (no END tag) 16 + // → total: 23 + 352×32 = 11287 bits → 1411 bytes 17 + 18 + pub const FRAME_SAMPLES: usize = 352; 19 + pub const PCM_BYTES_PER_FRAME: usize = FRAME_SAMPLES * 4; // stereo S16LE 20 + pub const ALAC_FRAME_BYTES: usize = 1411; 21 + 22 + struct BitWriter<'a> { 23 + buf: &'a mut [u8], 24 + pos: usize, 25 + } 26 + 27 + impl<'a> BitWriter<'a> { 28 + fn new(buf: &'a mut [u8]) -> Self { 29 + Self { buf, pos: 0 } 30 + } 31 + 32 + fn write(&mut self, value: u32, nbits: usize) { 33 + for i in (0..nbits).rev() { 34 + let bit = (value >> i) & 1; 35 + let byte_idx = self.pos / 8; 36 + let bit_idx = 7 - (self.pos % 8); 37 + if bit == 1 { 38 + self.buf[byte_idx] |= 1 << bit_idx; 39 + } 40 + self.pos += 1; 41 + } 42 + } 43 + 44 + fn align(&mut self) { 45 + if self.pos % 8 != 0 { 46 + self.pos = (self.pos + 7) & !7; 47 + } 48 + } 49 + } 50 + 51 + pub fn encode_frame(pcm: &[u8]) -> [u8; ALAC_FRAME_BYTES] { 52 + assert_eq!(pcm.len(), PCM_BYTES_PER_FRAME); 53 + let mut out = [0u8; ALAC_FRAME_BYTES]; 54 + let mut w = BitWriter::new(&mut out); 55 + 56 + // 23-bit header — matches the exact readbits() sequence in hammerton alac.c: 57 + w.write(0b001, 3); // channels = 1 (stereo); decoder: readbits(3) 58 + w.write(0, 4); // output_waiting; decoder: readbits(4) — discarded 59 + w.write(0, 12); // unknown; decoder: readbits(12) — discarded 60 + w.write(0, 1); // hassize = 0; decoder: readbits(1) 61 + w.write(0, 2); // uncompressed_bytes = 0; decoder: readbits(2) 62 + w.write(1, 1); // isNotCompressed = 1; decoder: readbits(1) — bit 22 63 + 64 + // Interleaved samples: L0, R0, L1, R1, ... 65 + for i in 0..FRAME_SAMPLES { 66 + let base = i * 4; 67 + let l = i16::from_le_bytes([pcm[base], pcm[base + 1]]) as u16 as u32; 68 + let r = i16::from_le_bytes([pcm[base + 2], pcm[base + 3]]) as u16 as u32; 69 + w.write(l, 16); 70 + w.write(r, 16); 71 + } 72 + 73 + w.align(); // pad to byte boundary (hammerton has no END tag) 74 + 75 + out 76 + }
+197
crates/airplay/src/lib.rs
··· 1 + mod airplay2; 2 + mod alac; 3 + mod rtp; 4 + mod rtsp; 5 + 6 + // Called from rockbox-cli to force this crate's symbols into librockbox_cli.a 7 + #[doc(hidden)] 8 + pub fn _link_airplay() {} 9 + 10 + use alac::{encode_frame, PCM_BYTES_PER_FRAME}; 11 + use rtp::RtpSender; 12 + use rtsp::RtspClient; 13 + 14 + use std::ffi::CStr; 15 + use std::os::raw::{c_char, c_int, c_ushort}; 16 + use std::sync::Mutex; 17 + 18 + static SESSION: Mutex<Option<AirPlaySession>> = Mutex::new(None); 19 + 20 + struct AirPlaySession { 21 + sender: RtpSender, 22 + rtsp: RtspClient, 23 + buf: Vec<u8>, 24 + first_frame: bool, 25 + } 26 + 27 + static CONFIG: Mutex<AirPlayConfig> = Mutex::new(AirPlayConfig { 28 + host: None, 29 + port: 5000, 30 + }); 31 + 32 + struct AirPlayConfig { 33 + host: Option<String>, 34 + port: u16, 35 + } 36 + 37 + // Safety: the raw pointer in host is only touched inside the mutex 38 + unsafe impl Send for AirPlayConfig {} 39 + 40 + #[no_mangle] 41 + pub extern "C" fn pcm_airplay_set_host(host: *const c_char, port: c_ushort) { 42 + if host.is_null() { 43 + return; 44 + } 45 + let s = unsafe { CStr::from_ptr(host) }.to_string_lossy().into_owned(); 46 + let mut cfg = CONFIG.lock().unwrap(); 47 + cfg.host = Some(s); 48 + cfg.port = port; 49 + } 50 + 51 + #[no_mangle] 52 + pub extern "C" fn pcm_airplay_connect() -> c_int { 53 + // Already connected — don't redo the RTSP handshake for every DMA chunk. 54 + if SESSION.lock().unwrap().is_some() { 55 + return 0; 56 + } 57 + 58 + let cfg = CONFIG.lock().unwrap(); 59 + let host = match cfg.host.clone() { 60 + Some(h) => h, 61 + None => { 62 + tracing::error!("pcm_airplay_connect: no host configured"); 63 + return -1; 64 + } 65 + }; 66 + let port = cfg.port; 67 + drop(cfg); 68 + 69 + let local_ip = local_ip_for(&host).unwrap_or_else(|| "127.0.0.1".to_string()); 70 + tracing::info!("connecting to {}:{} (local_ip={})", host, port, local_ip); 71 + 72 + // Attempt AirPlay 2 pairing (PAIR-VERIFY / PAIR-SETUP). 73 + // Failure here is non-fatal — many AirPlay 1 receivers don't have the endpoint. 74 + match airplay2::connect(&host, port, None) { 75 + Ok(()) => tracing::info!("AirPlay 2 handshake complete"), 76 + Err(e) => tracing::debug!("AirPlay 2 handshake skipped ({}), using AirPlay 1", e), 77 + } 78 + 79 + let session_token: u64 = rand::random(); 80 + let ssrc: u32 = rand::random(); 81 + let initial_rtptime: u32 = rand::random(); 82 + 83 + // Bind all UDP sockets first so we know the local ports before SETUP. 84 + let mut sender = match RtpSender::bind(ssrc, initial_rtptime) { 85 + Ok(s) => s, 86 + Err(e) => { tracing::error!("bind failed: {}", e); return -1; } 87 + }; 88 + let local_ctrl_port = sender.local_ctrl_port; 89 + let local_timing_port = sender.local_timing_port; 90 + 91 + let mut rtsp = match RtspClient::connect(&host, port, session_token) { 92 + Ok(c) => c, 93 + Err(e) => { tracing::error!("RTSP TCP connect failed: {}", e); return -1; } 94 + }; 95 + 96 + if let Err(e) = rtsp.announce(&local_ip, &host) { 97 + tracing::error!("ANNOUNCE failed: {}", e); 98 + return -1; 99 + } 100 + 101 + let (server_audio, server_ctrl, _server_timing) = 102 + match rtsp.setup(local_ctrl_port, local_timing_port) { 103 + Ok(ports) => ports, 104 + Err(e) => { tracing::error!("SETUP failed: {}", e); return -1; } 105 + }; 106 + 107 + if let Err(e) = sender.connect_server(&host, server_audio, server_ctrl) { 108 + tracing::error!("connect_server failed: {}", e); 109 + return -1; 110 + } 111 + 112 + if let Err(e) = rtsp.record(0, initial_rtptime) { 113 + tracing::error!("RECORD failed: {}", e); 114 + return -1; 115 + } 116 + 117 + // Set volume to maximum; RAOP range: -144.0 (mute) to 0.0 (full). 118 + if let Err(e) = rtsp.set_parameter_volume(0.0) { 119 + tracing::warn!("SET_PARAMETER volume failed (non-fatal): {}", e); 120 + } 121 + 122 + sender.send_initial_sync(); 123 + tracing::info!("session established — sending audio to {}:{}", host, server_audio); 124 + 125 + let mut guard = SESSION.lock().unwrap(); 126 + *guard = Some(AirPlaySession { 127 + sender, 128 + rtsp, 129 + buf: Vec::with_capacity(PCM_BYTES_PER_FRAME * 4), 130 + first_frame: true, 131 + }); 132 + 133 + 0 134 + } 135 + 136 + /// Write raw S16LE stereo PCM. Buffers into 352-sample frames, encodes ALAC, sends RTP. 137 + #[no_mangle] 138 + pub extern "C" fn pcm_airplay_write(data: *const u8, len: usize) -> c_int { 139 + if data.is_null() || len == 0 { 140 + return 0; 141 + } 142 + let input = unsafe { std::slice::from_raw_parts(data, len) }; 143 + 144 + let mut guard = SESSION.lock().unwrap(); 145 + let session = match guard.as_mut() { 146 + Some(s) => s, 147 + None => { 148 + tracing::warn!("pcm_airplay_write: no session"); 149 + return -1; 150 + } 151 + }; 152 + 153 + if session.first_frame { 154 + tracing::debug!("first write: {} bytes", len); 155 + } 156 + 157 + session.buf.extend_from_slice(input); 158 + 159 + while session.buf.len() >= PCM_BYTES_PER_FRAME { 160 + let frame_bytes: [u8; PCM_BYTES_PER_FRAME] = session.buf[..PCM_BYTES_PER_FRAME] 161 + .try_into() 162 + .unwrap(); 163 + session.buf.drain(..PCM_BYTES_PER_FRAME); 164 + 165 + let alac = encode_frame(&frame_bytes); 166 + let first = session.first_frame; 167 + session.first_frame = false; 168 + session.sender.send_audio(&alac, first); 169 + } 170 + 171 + 0 172 + } 173 + 174 + #[no_mangle] 175 + pub extern "C" fn pcm_airplay_stop() { 176 + let mut guard = SESSION.lock().unwrap(); 177 + if let Some(ref mut session) = *guard { 178 + let _ = session.rtsp.teardown(); 179 + } 180 + *guard = None; 181 + } 182 + 183 + #[no_mangle] 184 + pub extern "C" fn pcm_airplay_close() { 185 + let mut guard = SESSION.lock().unwrap(); 186 + if let Some(ref mut session) = *guard { 187 + let _ = session.rtsp.teardown(); 188 + } 189 + *guard = None; 190 + } 191 + 192 + fn local_ip_for(remote: &str) -> Option<String> { 193 + use std::net::UdpSocket; 194 + let sock = UdpSocket::bind("0.0.0.0:0").ok()?; 195 + sock.connect(format!("{}:80", remote)).ok()?; 196 + sock.local_addr().ok().map(|a| a.ip().to_string()) 197 + }
+244
crates/airplay/src/rtp.rs
··· 1 + use std::net::UdpSocket; 2 + use std::sync::Arc; 3 + use std::thread; 4 + use std::time::{Duration, Instant, SystemTime, UNIX_EPOCH}; 5 + 6 + use crate::alac::{ALAC_FRAME_BYTES, FRAME_SAMPLES}; 7 + 8 + const RTP_HEADER_BYTES: usize = 12; 9 + pub const RTP_PACKET_BYTES: usize = RTP_HEADER_BYTES + ALAC_FRAME_BYTES; 10 + 11 + const NTP_EPOCH_DELTA: u32 = 0x83AA_7E80; 12 + 13 + // Duration of one ALAC frame at 44100 Hz 14 + const FRAME_DURATION_US: u64 = FRAME_SAMPLES as u64 * 1_000_000 / 44100; // ~7982 µs 15 + 16 + pub struct RtpSender { 17 + audio_sock: UdpSocket, 18 + ctrl_sock: UdpSocket, 19 + server_ctrl_addr: std::net::SocketAddr, 20 + ssrc: u32, 21 + seqnum: u16, 22 + rtptime: u32, 23 + initial_rtptime: u32, 24 + frames_sent: u64, 25 + pub local_ctrl_port: u16, 26 + pub local_timing_port: u16, 27 + stream_start: Option<Instant>, 28 + // kept alive so the OS port stays open; responder thread holds the other Arc 29 + _timing_sock: Arc<UdpSocket>, 30 + } 31 + 32 + impl RtpSender { 33 + /// Bind all local UDP sockets. `connect_server()` must be called after SETUP 34 + /// once the server's ports are known. 35 + pub fn bind(ssrc: u32, initial_rtptime: u32) -> std::io::Result<Self> { 36 + let audio_sock = UdpSocket::bind("0.0.0.0:0")?; 37 + let ctrl_sock = UdpSocket::bind("0.0.0.0:0")?; 38 + let local_ctrl_port = ctrl_sock.local_addr()?.port(); 39 + let timing_sock = Arc::new(UdpSocket::bind("0.0.0.0:0")?); 40 + let local_timing_port = timing_sock.local_addr()?.port(); 41 + 42 + // Respond to NTP timing requests from the receiver so it can synchronise 43 + // and actually start playing. Without this, the timing port gets ICMP 44 + // unreachable replies and many receivers stall indefinitely. 45 + let timing_thread = Arc::clone(&timing_sock); 46 + thread::spawn(move || timing_responder(timing_thread)); 47 + 48 + let server_ctrl_addr = "0.0.0.0:0".parse().unwrap(); 49 + tracing::debug!("local ctrl_port={} timing_port={}", local_ctrl_port, local_timing_port); 50 + 51 + Ok(Self { 52 + audio_sock, 53 + ctrl_sock, 54 + server_ctrl_addr, 55 + ssrc, 56 + seqnum: 0, 57 + rtptime: initial_rtptime, 58 + initial_rtptime, 59 + frames_sent: 0, 60 + local_ctrl_port, 61 + local_timing_port, 62 + stream_start: None, 63 + _timing_sock: timing_sock, 64 + }) 65 + } 66 + 67 + /// Connect the audio socket to the server's RTP port and record the ctrl addr. 68 + pub fn connect_server(&mut self, host: &str, audio_port: u16, ctrl_port: u16) -> std::io::Result<()> { 69 + tracing::debug!("connecting audio → {}:{}", host, audio_port); 70 + self.audio_sock.connect(format!("{}:{}", host, audio_port))?; 71 + self.server_ctrl_addr = format!("{}:{}", host, ctrl_port) 72 + .parse() 73 + .map_err(|e| std::io::Error::new(std::io::ErrorKind::InvalidInput, e))?; 74 + Ok(()) 75 + } 76 + 77 + pub fn send_audio(&mut self, alac_frame: &[u8; ALAC_FRAME_BYTES], first: bool) { 78 + let start = *self.stream_start.get_or_insert_with(Instant::now); 79 + 80 + let mut pkt = [0u8; RTP_PACKET_BYTES]; 81 + pkt[0] = 0x80; 82 + pkt[1] = if first { 0x60 | 0x80 } else { 0x60 }; // M=1 on first, PT=96 83 + pkt[2] = (self.seqnum >> 8) as u8; 84 + pkt[3] = self.seqnum as u8; 85 + pkt[4] = (self.rtptime >> 24) as u8; 86 + pkt[5] = (self.rtptime >> 16) as u8; 87 + pkt[6] = (self.rtptime >> 8) as u8; 88 + pkt[7] = self.rtptime as u8; 89 + pkt[8] = (self.ssrc >> 24) as u8; 90 + pkt[9] = (self.ssrc >> 16) as u8; 91 + pkt[10] = (self.ssrc >> 8) as u8; 92 + pkt[11] = self.ssrc as u8; 93 + pkt[RTP_HEADER_BYTES..].copy_from_slice(alac_frame); 94 + 95 + match self.audio_sock.send(&pkt) { 96 + Ok(_) => { 97 + if self.frames_sent < 5 { 98 + tracing::debug!("sent frame {} ts={} seq={} first={}", 99 + self.frames_sent, self.rtptime, self.seqnum, first); 100 + } 101 + } 102 + Err(e) => tracing::warn!("send error on frame {}: {}", self.frames_sent, e), 103 + } 104 + 105 + self.seqnum = self.seqnum.wrapping_add(1); 106 + self.rtptime = self.rtptime.wrapping_add(FRAME_SAMPLES as u32); 107 + self.frames_sent += 1; 108 + 109 + // RTCP NTP sync every ~44 frames (~0.35 s) 110 + if self.frames_sent % 44 == 0 { 111 + self.send_sync(false); 112 + } 113 + 114 + // Real-time pacing — sleep until the frame's playout deadline. 115 + let expected = start + Duration::from_micros(self.frames_sent * FRAME_DURATION_US); 116 + let now = Instant::now(); 117 + if expected > now { 118 + std::thread::sleep(expected - now); 119 + } 120 + } 121 + 122 + fn send_sync(&self, first: bool) { 123 + let now = SystemTime::now() 124 + .duration_since(UNIX_EPOCH) 125 + .unwrap_or_default(); 126 + let ntp_sec = now.as_secs() as u32 + NTP_EPOCH_DELTA; 127 + let ntp_frac = ((now.subsec_nanos() as u64 * (1u64 << 32)) / 1_000_000_000) as u32; 128 + 129 + // "current" timestamp = frame we just sent (rtptime was already incremented) 130 + let current_ts = self.rtptime.wrapping_sub(FRAME_SAMPLES as u32); 131 + // "next" timestamp = self.rtptime (next frame to be sent) 132 + let next_ts = self.rtptime; 133 + 134 + let mut pkt = [0u8; 20]; 135 + pkt[0] = if first { 0x90 } else { 0x80 }; 136 + pkt[1] = 0xd4; 137 + pkt[2] = 0x00; 138 + pkt[3] = 0x07; 139 + pkt[4] = (current_ts >> 24) as u8; 140 + pkt[5] = (current_ts >> 16) as u8; 141 + pkt[6] = (current_ts >> 8) as u8; 142 + pkt[7] = current_ts as u8; 143 + pkt[8] = (ntp_sec >> 24) as u8; 144 + pkt[9] = (ntp_sec >> 16) as u8; 145 + pkt[10] = (ntp_sec >> 8) as u8; 146 + pkt[11] = ntp_sec as u8; 147 + pkt[12] = (ntp_frac >> 24) as u8; 148 + pkt[13] = (ntp_frac >> 16) as u8; 149 + pkt[14] = (ntp_frac >> 8) as u8; 150 + pkt[15] = ntp_frac as u8; 151 + pkt[16] = (next_ts >> 24) as u8; 152 + pkt[17] = (next_ts >> 16) as u8; 153 + pkt[18] = (next_ts >> 8) as u8; 154 + pkt[19] = next_ts as u8; 155 + 156 + let _ = self.ctrl_sock.send_to(&pkt, self.server_ctrl_addr); 157 + } 158 + 159 + pub fn send_initial_sync(&self) { 160 + // At startup no frames have been sent yet; use initial_rtptime for both 161 + // "current" and "next" so we don't send a backwards-wrapped timestamp. 162 + let now = SystemTime::now() 163 + .duration_since(UNIX_EPOCH) 164 + .unwrap_or_default(); 165 + let ntp_sec = now.as_secs() as u32 + NTP_EPOCH_DELTA; 166 + let ntp_frac = ((now.subsec_nanos() as u64 * (1u64 << 32)) / 1_000_000_000) as u32; 167 + let ts = self.initial_rtptime; 168 + 169 + let mut pkt = [0u8; 20]; 170 + pkt[0] = 0x90; // first sync: extension bit set 171 + pkt[1] = 0xd4; 172 + pkt[2] = 0x00; 173 + pkt[3] = 0x07; 174 + pkt[4] = (ts >> 24) as u8; 175 + pkt[5] = (ts >> 16) as u8; 176 + pkt[6] = (ts >> 8) as u8; 177 + pkt[7] = ts as u8; 178 + pkt[8] = (ntp_sec >> 24) as u8; 179 + pkt[9] = (ntp_sec >> 16) as u8; 180 + pkt[10] = (ntp_sec >> 8) as u8; 181 + pkt[11] = ntp_sec as u8; 182 + pkt[12] = (ntp_frac >> 24) as u8; 183 + pkt[13] = (ntp_frac >> 16) as u8; 184 + pkt[14] = (ntp_frac >> 8) as u8; 185 + pkt[15] = ntp_frac as u8; 186 + pkt[16] = (ts >> 24) as u8; 187 + pkt[17] = (ts >> 16) as u8; 188 + pkt[18] = (ts >> 8) as u8; 189 + pkt[19] = ts as u8; 190 + 191 + let _ = self.ctrl_sock.send_to(&pkt, self.server_ctrl_addr); 192 + tracing::debug!("sent initial sync ts={}", ts); 193 + } 194 + 195 + pub fn reset_clock(&mut self) { 196 + self.stream_start = None; 197 + self.frames_sent = 0; 198 + } 199 + } 200 + 201 + // RAOP NTP timing responder. 202 + // 203 + // The receiver sends 32-byte timing requests (PT=0xD2) on the timing port we 204 + // advertised in SETUP. We reply with PT=0xD3 so it can synchronise playback. 205 + fn timing_responder(sock: Arc<UdpSocket>) { 206 + let mut buf = [0u8; 64]; 207 + loop { 208 + let (len, src) = match sock.recv_from(&mut buf) { 209 + Ok(x) => x, 210 + Err(_) => break, 211 + }; 212 + if len < 32 || buf[1] != 0xD2 { 213 + tracing::debug!("timing: unexpected packet len={} type=0x{:02X} from {}", len, buf[1], src); 214 + continue; 215 + } 216 + tracing::debug!("timing request from {}", src); 217 + 218 + let now = SystemTime::now() 219 + .duration_since(UNIX_EPOCH) 220 + .unwrap_or_default(); 221 + let ntp_sec = now.as_secs() as u32 + NTP_EPOCH_DELTA; 222 + let ntp_frac = ((now.subsec_nanos() as u64 * (1u64 << 32)) / 1_000_000_000) as u32; 223 + 224 + let mut resp = [0u8; 32]; 225 + resp[0] = 0x80; 226 + resp[1] = 0xD3; // timing response 227 + resp[2] = buf[2]; // seq 228 + resp[3] = buf[3]; 229 + // [8-15] reference — leave as zero 230 + // [16-23] originate = client's send time from request [16-23] 231 + resp[16..24].copy_from_slice(&buf[16..24]); 232 + // [24-31] receive + transmit = our current NTP 233 + resp[24] = (ntp_sec >> 24) as u8; 234 + resp[25] = (ntp_sec >> 16) as u8; 235 + resp[26] = (ntp_sec >> 8) as u8; 236 + resp[27] = ntp_sec as u8; 237 + resp[28] = (ntp_frac >> 24) as u8; 238 + resp[29] = (ntp_frac >> 16) as u8; 239 + resp[30] = (ntp_frac >> 8) as u8; 240 + resp[31] = ntp_frac as u8; 241 + 242 + let _ = sock.send_to(&resp, src); 243 + } 244 + }
+198
crates/airplay/src/rtsp.rs
··· 1 + use std::collections::HashMap; 2 + use std::io::{self, BufRead, BufReader, Write as IoWrite}; 3 + use std::net::TcpStream; 4 + 5 + pub struct RtspClient { 6 + stream: TcpStream, 7 + reader: BufReader<TcpStream>, 8 + cseq: u32, 9 + pub session_id: Option<String>, 10 + base_url: String, 11 + dacp_id: u64, 12 + active_remote: u32, 13 + } 14 + 15 + /// RTSP response: status code + headers. 16 + struct Response { 17 + status: u16, 18 + headers: HashMap<String, String>, 19 + } 20 + 21 + impl RtspClient { 22 + pub fn connect(host: &str, port: u16, session_token: u64) -> io::Result<Self> { 23 + let stream = TcpStream::connect(format!("{}:{}", host, port))?; 24 + let reader = BufReader::new(stream.try_clone()?); 25 + // Use a plain decimal session id — some receivers choke on hex 26 + let base_url = format!("rtsp://{}:{}/{}", host, port, session_token); 27 + let dacp_id: u64 = rand::random(); 28 + let active_remote: u32 = rand::random(); 29 + Ok(Self { stream, reader, cseq: 0, session_id: None, base_url, dacp_id, active_remote }) 30 + } 31 + 32 + fn send_request( 33 + &mut self, 34 + method: &str, 35 + uri: &str, 36 + headers: &[(&str, &str)], 37 + body: Option<&str>, 38 + ) -> io::Result<Response> { 39 + self.cseq += 1; 40 + let dacp_str = format!("{:016X}", self.dacp_id); 41 + let active_str = format!("{}", self.active_remote); 42 + let mut req = format!( 43 + "{} {} RTSP/1.0\r\nCSeq: {}\r\nUser-Agent: iTunes/12.0 (Rockbox)\r\nClient-Instance: {}\r\nDacp-ID: {}\r\nActive-Remote: {}\r\n", 44 + method, uri, self.cseq, dacp_str, dacp_str, active_str, 45 + ); 46 + for (k, v) in headers { 47 + req.push_str(&format!("{}: {}\r\n", k, v)); 48 + } 49 + if let Some(b) = body { 50 + req.push_str(&format!("Content-Length: {}\r\n", b.len())); 51 + } 52 + req.push_str("\r\n"); 53 + if let Some(b) = body { 54 + req.push_str(b); 55 + } 56 + tracing::debug!(">> {} {}", method, uri); 57 + self.stream.write_all(req.as_bytes())?; 58 + self.stream.flush()?; 59 + self.read_response() 60 + } 61 + 62 + fn read_response(&mut self) -> io::Result<Response> { 63 + let mut status_line = String::new(); 64 + self.reader.read_line(&mut status_line)?; 65 + let status_line = status_line.trim().to_string(); 66 + tracing::debug!("<< {}", status_line); 67 + 68 + let status: u16 = status_line 69 + .split_whitespace() 70 + .nth(1) 71 + .and_then(|s| s.parse().ok()) 72 + .unwrap_or(0); 73 + 74 + let mut headers = HashMap::new(); 75 + loop { 76 + let mut line = String::new(); 77 + self.reader.read_line(&mut line)?; 78 + let trimmed = line.trim_end_matches(|c| c == '\r' || c == '\n'); 79 + if trimmed.is_empty() { 80 + break; 81 + } 82 + tracing::debug!("<< {}", trimmed); 83 + if let Some((key, val)) = trimmed.split_once(':') { 84 + headers.insert(key.trim().to_lowercase(), val.trim().to_string()); 85 + } 86 + } 87 + 88 + // Consume body 89 + if let Some(len_str) = headers.get("content-length") { 90 + if let Ok(len) = len_str.parse::<usize>() { 91 + let mut body = vec![0u8; len]; 92 + use std::io::Read; 93 + self.reader.read_exact(&mut body)?; 94 + } 95 + } 96 + 97 + Ok(Response { status, headers }) 98 + } 99 + 100 + fn check_ok(resp: &Response, method: &str) -> io::Result<()> { 101 + if resp.status != 200 { 102 + return Err(io::Error::new( 103 + io::ErrorKind::Other, 104 + format!("RTSP {} returned status {}", method, resp.status), 105 + )); 106 + } 107 + Ok(()) 108 + } 109 + 110 + pub fn announce(&mut self, local_ip: &str, server_ip: &str) -> io::Result<()> { 111 + // m=audio 0: port 0 because the client is the sender; server port comes from SETUP 112 + let sdp = format!( 113 + "v=0\r\n\ 114 + o=iTunes 3413821438 0 IN IP4 {local_ip}\r\n\ 115 + s=iTunes\r\n\ 116 + c=IN IP4 {server_ip}\r\n\ 117 + t=0 0\r\n\ 118 + m=audio 0 RTP/AVP 96\r\n\ 119 + a=rtpmap:96 AppleLossless\r\n\ 120 + a=fmtp:96 352 0 16 40 10 14 2 255 0 0 44100\r\n\ 121 + a=min-latency:3528\r\n" 122 + ); 123 + let url = self.base_url.clone(); 124 + let resp = self.send_request("ANNOUNCE", &url, &[ 125 + ("Content-Type", "application/sdp"), 126 + ], Some(&sdp))?; 127 + Self::check_ok(&resp, "ANNOUNCE") 128 + } 129 + 130 + /// Returns (server_audio_port, server_ctrl_port, server_timing_port). 131 + pub fn setup(&mut self, local_ctrl_port: u16, local_timing_port: u16) -> io::Result<(u16, u16, u16)> { 132 + // interleaved=0-1 is required by Apple receivers even for UDP transport. 133 + let transport = format!( 134 + "RTP/AVP/UDP;unicast;interleaved=0-1;mode=record;control_port={};timing_port={}", 135 + local_ctrl_port, local_timing_port 136 + ); 137 + let url = self.base_url.clone(); 138 + let resp = self.send_request("SETUP", &url, &[ 139 + ("Transport", &transport), 140 + ], None)?; 141 + Self::check_ok(&resp, "SETUP")?; 142 + 143 + if let Some(sid) = resp.headers.get("session") { 144 + self.session_id = Some(sid.split(';').next().unwrap_or(sid).trim().to_string()); 145 + } 146 + 147 + let transport_resp = resp.headers.get("transport").cloned().unwrap_or_default(); 148 + let server_audio = parse_port(&transport_resp, "server_port").unwrap_or(6000); 149 + let server_ctrl = parse_port(&transport_resp, "control_port").unwrap_or(6001); 150 + let server_timing = parse_port(&transport_resp, "timing_port").unwrap_or(6002); 151 + tracing::debug!("server ports: audio={} ctrl={} timing={}", server_audio, server_ctrl, server_timing); 152 + Ok((server_audio, server_ctrl, server_timing)) 153 + } 154 + 155 + pub fn record(&mut self, seqnum: u16, rtptime: u32) -> io::Result<()> { 156 + let rtp_info = format!("seq={};rtptime={}", seqnum, rtptime); 157 + let sid = self.session_id.clone().unwrap_or_default(); 158 + let url = self.base_url.clone(); 159 + let all_hdrs: Vec<(&str, &str)> = vec![ 160 + ("Range", "npt=0-"), 161 + ("Session", &sid), 162 + ("RTP-Info", &rtp_info), 163 + ]; 164 + let resp = self.send_request("RECORD", &url, &all_hdrs, None)?; 165 + Self::check_ok(&resp, "RECORD") 166 + } 167 + 168 + /// Send SET_PARAMETER with a `volume` value in RAOP range [-144.0, 0.0]. 169 + /// 0.0 = full volume, -144.0 = mute. 170 + pub fn set_parameter_volume(&mut self, volume: f32) -> io::Result<()> { 171 + let body = format!("volume: {:.6}\r\n", volume); 172 + let sid = self.session_id.clone().unwrap_or_default(); 173 + let url = self.base_url.clone(); 174 + let resp = self.send_request("SET_PARAMETER", &url, &[ 175 + ("Session", &sid), 176 + ("Content-Type", "text/parameters"), 177 + ], Some(&body))?; 178 + Self::check_ok(&resp, "SET_PARAMETER") 179 + } 180 + 181 + pub fn teardown(&mut self) -> io::Result<()> { 182 + let sid = self.session_id.clone().unwrap_or_default(); 183 + let url = self.base_url.clone(); 184 + let resp = self.send_request("TEARDOWN", &url, &[("Session", &sid)], None)?; 185 + Self::check_ok(&resp, "TEARDOWN") 186 + } 187 + } 188 + 189 + fn parse_port(transport: &str, key: &str) -> Option<u16> { 190 + for part in transport.split(';') { 191 + let part = part.trim(); 192 + if let Some(rest) = part.strip_prefix(key) { 193 + let rest = rest.trim_start_matches('='); 194 + return rest.split('-').next()?.parse().ok(); 195 + } 196 + } 197 + None 198 + }
+1
crates/cli/Cargo.toml
··· 8 8 9 9 [dependencies] 10 10 anyhow = "1.0.90" 11 + rockbox-airplay = {path = "../airplay"} 11 12 clap = "4.5.16" 12 13 owo-colors = "4.1.0" 13 14 rockbox-library = {path = "../library"}
+4
crates/cli/src/lib.rs
··· 1 1 use anyhow::Error; 2 + 3 + // Force rockbox-airplay symbols into librockbox_cli.a 4 + #[allow(unused_imports)] 5 + use rockbox_airplay::_link_airplay as _; 2 6 use clap::Command; 3 7 use owo_colors::OwoColorize; 4 8 use rockbox_library::audio_scan::{save_audio_metadata, scan_audio_files};
+2506 -1240
crates/rocksky/src/api/rockbox.v1alpha1.rs
··· 43 43 dead_code, 44 44 missing_docs, 45 45 clippy::wildcard_imports, 46 - clippy::let_unit_value 46 + clippy::let_unit_value, 47 47 )] 48 - use tonic::codegen::http::Uri; 49 48 use tonic::codegen::*; 49 + use tonic::codegen::http::Uri; 50 50 #[derive(Debug, Clone)] 51 51 pub struct BrowseServiceClient<T> { 52 52 inner: tonic::client::Grpc<T>, ··· 90 90 <T as tonic::client::GrpcService<tonic::body::BoxBody>>::ResponseBody, 91 91 >, 92 92 >, 93 - <T as tonic::codegen::Service<http::Request<tonic::body::BoxBody>>>::Error: 94 - Into<StdError> + std::marker::Send + std::marker::Sync, 93 + <T as tonic::codegen::Service< 94 + http::Request<tonic::body::BoxBody>, 95 + >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync, 95 96 { 96 97 BrowseServiceClient::new(InterceptedService::new(inner, interceptor)) 97 98 } ··· 129 130 pub async fn tree_get_entries( 130 131 &mut self, 131 132 request: impl tonic::IntoRequest<super::TreeGetEntriesRequest>, 132 - ) -> std::result::Result<tonic::Response<super::TreeGetEntriesResponse>, tonic::Status> 133 - { 134 - self.inner.ready().await.map_err(|e| { 135 - tonic::Status::unknown(format!("Service was not ready: {}", e.into())) 136 - })?; 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 + })?; 137 145 let codec = tonic::codec::ProstCodec::default(); 138 146 let path = http::uri::PathAndQuery::from_static( 139 147 "/rockbox.v1alpha1.BrowseService/TreeGetEntries", 140 148 ); 141 149 let mut req = request.into_request(); 142 - req.extensions_mut().insert(GrpcMethod::new( 143 - "rockbox.v1alpha1.BrowseService", 144 - "TreeGetEntries", 145 - )); 150 + req.extensions_mut() 151 + .insert( 152 + GrpcMethod::new("rockbox.v1alpha1.BrowseService", "TreeGetEntries"), 153 + ); 146 154 self.inner.unary(req, path, codec).await 147 155 } 148 156 } ··· 154 162 dead_code, 155 163 missing_docs, 156 164 clippy::wildcard_imports, 157 - clippy::let_unit_value 165 + clippy::let_unit_value, 158 166 )] 159 167 use tonic::codegen::*; 160 168 /// Generated trait containing gRPC methods that should be implemented for use with BrowseServiceServer. ··· 163 171 async fn tree_get_entries( 164 172 &self, 165 173 request: tonic::Request<super::TreeGetEntriesRequest>, 166 - ) -> std::result::Result<tonic::Response<super::TreeGetEntriesResponse>, tonic::Status>; 174 + ) -> std::result::Result< 175 + tonic::Response<super::TreeGetEntriesResponse>, 176 + tonic::Status, 177 + >; 167 178 } 168 179 #[derive(Debug)] 169 180 pub struct BrowseServiceServer<T> { ··· 186 197 max_encoding_message_size: None, 187 198 } 188 199 } 189 - pub fn with_interceptor<F>(inner: T, interceptor: F) -> InterceptedService<Self, F> 200 + pub fn with_interceptor<F>( 201 + inner: T, 202 + interceptor: F, 203 + ) -> InterceptedService<Self, F> 190 204 where 191 205 F: tonic::service::Interceptor, 192 206 { ··· 241 255 "/rockbox.v1alpha1.BrowseService/TreeGetEntries" => { 242 256 #[allow(non_camel_case_types)] 243 257 struct TreeGetEntriesSvc<T: BrowseService>(pub Arc<T>); 244 - impl<T: BrowseService> tonic::server::UnaryService<super::TreeGetEntriesRequest> 245 - for TreeGetEntriesSvc<T> 246 - { 258 + impl< 259 + T: BrowseService, 260 + > tonic::server::UnaryService<super::TreeGetEntriesRequest> 261 + for TreeGetEntriesSvc<T> { 247 262 type Response = super::TreeGetEntriesResponse; 248 - type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>; 263 + type Future = BoxFuture< 264 + tonic::Response<Self::Response>, 265 + tonic::Status, 266 + >; 249 267 fn call( 250 268 &mut self, 251 269 request: tonic::Request<super::TreeGetEntriesRequest>, 252 270 ) -> Self::Future { 253 271 let inner = Arc::clone(&self.0); 254 272 let fut = async move { 255 - <T as BrowseService>::tree_get_entries(&inner, request).await 273 + <T as BrowseService>::tree_get_entries(&inner, request) 274 + .await 256 275 }; 257 276 Box::pin(fut) 258 277 } ··· 279 298 }; 280 299 Box::pin(fut) 281 300 } 282 - _ => Box::pin(async move { 283 - let mut response = http::Response::new(empty_body()); 284 - let headers = response.headers_mut(); 285 - headers.insert( 286 - tonic::Status::GRPC_STATUS, 287 - (tonic::Code::Unimplemented as i32).into(), 288 - ); 289 - headers.insert( 290 - http::header::CONTENT_TYPE, 291 - tonic::metadata::GRPC_CONTENT_TYPE, 292 - ); 293 - Ok(response) 294 - }), 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 + } 295 318 } 296 319 } 297 320 } ··· 527 550 dead_code, 528 551 missing_docs, 529 552 clippy::wildcard_imports, 530 - clippy::let_unit_value 553 + clippy::let_unit_value, 531 554 )] 532 - use tonic::codegen::http::Uri; 533 555 use tonic::codegen::*; 556 + use tonic::codegen::http::Uri; 534 557 #[derive(Debug, Clone)] 535 558 pub struct LibraryServiceClient<T> { 536 559 inner: tonic::client::Grpc<T>, ··· 574 597 <T as tonic::client::GrpcService<tonic::body::BoxBody>>::ResponseBody, 575 598 >, 576 599 >, 577 - <T as tonic::codegen::Service<http::Request<tonic::body::BoxBody>>>::Error: 578 - Into<StdError> + std::marker::Send + std::marker::Sync, 600 + <T as tonic::codegen::Service< 601 + http::Request<tonic::body::BoxBody>, 602 + >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync, 579 603 { 580 604 LibraryServiceClient::new(InterceptedService::new(inner, interceptor)) 581 605 } ··· 613 637 pub async fn get_albums( 614 638 &mut self, 615 639 request: impl tonic::IntoRequest<super::GetAlbumsRequest>, 616 - ) -> std::result::Result<tonic::Response<super::GetAlbumsResponse>, tonic::Status> { 617 - self.inner.ready().await.map_err(|e| { 618 - tonic::Status::unknown(format!("Service was not ready: {}", e.into())) 619 - })?; 640 + ) -> std::result::Result< 641 + tonic::Response<super::GetAlbumsResponse>, 642 + tonic::Status, 643 + > { 644 + self.inner 645 + .ready() 646 + .await 647 + .map_err(|e| { 648 + tonic::Status::unknown( 649 + format!("Service was not ready: {}", e.into()), 650 + ) 651 + })?; 620 652 let codec = tonic::codec::ProstCodec::default(); 621 - let path = 622 - http::uri::PathAndQuery::from_static("/rockbox.v1alpha1.LibraryService/GetAlbums"); 653 + let path = http::uri::PathAndQuery::from_static( 654 + "/rockbox.v1alpha1.LibraryService/GetAlbums", 655 + ); 623 656 let mut req = request.into_request(); 624 - req.extensions_mut().insert(GrpcMethod::new( 625 - "rockbox.v1alpha1.LibraryService", 626 - "GetAlbums", 627 - )); 657 + req.extensions_mut() 658 + .insert(GrpcMethod::new("rockbox.v1alpha1.LibraryService", "GetAlbums")); 628 659 self.inner.unary(req, path, codec).await 629 660 } 630 661 pub async fn get_artists( 631 662 &mut self, 632 663 request: impl tonic::IntoRequest<super::GetArtistsRequest>, 633 - ) -> std::result::Result<tonic::Response<super::GetArtistsResponse>, tonic::Status> 634 - { 635 - self.inner.ready().await.map_err(|e| { 636 - tonic::Status::unknown(format!("Service was not ready: {}", e.into())) 637 - })?; 664 + ) -> std::result::Result< 665 + tonic::Response<super::GetArtistsResponse>, 666 + tonic::Status, 667 + > { 668 + self.inner 669 + .ready() 670 + .await 671 + .map_err(|e| { 672 + tonic::Status::unknown( 673 + format!("Service was not ready: {}", e.into()), 674 + ) 675 + })?; 638 676 let codec = tonic::codec::ProstCodec::default(); 639 - let path = 640 - http::uri::PathAndQuery::from_static("/rockbox.v1alpha1.LibraryService/GetArtists"); 677 + let path = http::uri::PathAndQuery::from_static( 678 + "/rockbox.v1alpha1.LibraryService/GetArtists", 679 + ); 641 680 let mut req = request.into_request(); 642 - req.extensions_mut().insert(GrpcMethod::new( 643 - "rockbox.v1alpha1.LibraryService", 644 - "GetArtists", 645 - )); 681 + req.extensions_mut() 682 + .insert( 683 + GrpcMethod::new("rockbox.v1alpha1.LibraryService", "GetArtists"), 684 + ); 646 685 self.inner.unary(req, path, codec).await 647 686 } 648 687 pub async fn get_tracks( 649 688 &mut self, 650 689 request: impl tonic::IntoRequest<super::GetTracksRequest>, 651 - ) -> std::result::Result<tonic::Response<super::GetTracksResponse>, tonic::Status> { 652 - self.inner.ready().await.map_err(|e| { 653 - tonic::Status::unknown(format!("Service was not ready: {}", e.into())) 654 - })?; 690 + ) -> std::result::Result< 691 + tonic::Response<super::GetTracksResponse>, 692 + tonic::Status, 693 + > { 694 + self.inner 695 + .ready() 696 + .await 697 + .map_err(|e| { 698 + tonic::Status::unknown( 699 + format!("Service was not ready: {}", e.into()), 700 + ) 701 + })?; 655 702 let codec = tonic::codec::ProstCodec::default(); 656 - let path = 657 - http::uri::PathAndQuery::from_static("/rockbox.v1alpha1.LibraryService/GetTracks"); 703 + let path = http::uri::PathAndQuery::from_static( 704 + "/rockbox.v1alpha1.LibraryService/GetTracks", 705 + ); 658 706 let mut req = request.into_request(); 659 - req.extensions_mut().insert(GrpcMethod::new( 660 - "rockbox.v1alpha1.LibraryService", 661 - "GetTracks", 662 - )); 707 + req.extensions_mut() 708 + .insert(GrpcMethod::new("rockbox.v1alpha1.LibraryService", "GetTracks")); 663 709 self.inner.unary(req, path, codec).await 664 710 } 665 711 pub async fn get_album( 666 712 &mut self, 667 713 request: impl tonic::IntoRequest<super::GetAlbumRequest>, 668 - ) -> std::result::Result<tonic::Response<super::GetAlbumResponse>, tonic::Status> { 669 - self.inner.ready().await.map_err(|e| { 670 - tonic::Status::unknown(format!("Service was not ready: {}", e.into())) 671 - })?; 714 + ) -> std::result::Result< 715 + tonic::Response<super::GetAlbumResponse>, 716 + tonic::Status, 717 + > { 718 + self.inner 719 + .ready() 720 + .await 721 + .map_err(|e| { 722 + tonic::Status::unknown( 723 + format!("Service was not ready: {}", e.into()), 724 + ) 725 + })?; 672 726 let codec = tonic::codec::ProstCodec::default(); 673 - let path = 674 - http::uri::PathAndQuery::from_static("/rockbox.v1alpha1.LibraryService/GetAlbum"); 727 + let path = http::uri::PathAndQuery::from_static( 728 + "/rockbox.v1alpha1.LibraryService/GetAlbum", 729 + ); 675 730 let mut req = request.into_request(); 676 - req.extensions_mut().insert(GrpcMethod::new( 677 - "rockbox.v1alpha1.LibraryService", 678 - "GetAlbum", 679 - )); 731 + req.extensions_mut() 732 + .insert(GrpcMethod::new("rockbox.v1alpha1.LibraryService", "GetAlbum")); 680 733 self.inner.unary(req, path, codec).await 681 734 } 682 735 pub async fn get_artist( 683 736 &mut self, 684 737 request: impl tonic::IntoRequest<super::GetArtistRequest>, 685 - ) -> std::result::Result<tonic::Response<super::GetArtistResponse>, tonic::Status> { 686 - self.inner.ready().await.map_err(|e| { 687 - tonic::Status::unknown(format!("Service was not ready: {}", e.into())) 688 - })?; 738 + ) -> std::result::Result< 739 + tonic::Response<super::GetArtistResponse>, 740 + tonic::Status, 741 + > { 742 + self.inner 743 + .ready() 744 + .await 745 + .map_err(|e| { 746 + tonic::Status::unknown( 747 + format!("Service was not ready: {}", e.into()), 748 + ) 749 + })?; 689 750 let codec = tonic::codec::ProstCodec::default(); 690 - let path = 691 - http::uri::PathAndQuery::from_static("/rockbox.v1alpha1.LibraryService/GetArtist"); 751 + let path = http::uri::PathAndQuery::from_static( 752 + "/rockbox.v1alpha1.LibraryService/GetArtist", 753 + ); 692 754 let mut req = request.into_request(); 693 - req.extensions_mut().insert(GrpcMethod::new( 694 - "rockbox.v1alpha1.LibraryService", 695 - "GetArtist", 696 - )); 755 + req.extensions_mut() 756 + .insert(GrpcMethod::new("rockbox.v1alpha1.LibraryService", "GetArtist")); 697 757 self.inner.unary(req, path, codec).await 698 758 } 699 759 pub async fn get_track( 700 760 &mut self, 701 761 request: impl tonic::IntoRequest<super::GetTrackRequest>, 702 - ) -> std::result::Result<tonic::Response<super::GetTrackResponse>, tonic::Status> { 703 - self.inner.ready().await.map_err(|e| { 704 - tonic::Status::unknown(format!("Service was not ready: {}", e.into())) 705 - })?; 762 + ) -> std::result::Result< 763 + tonic::Response<super::GetTrackResponse>, 764 + tonic::Status, 765 + > { 766 + self.inner 767 + .ready() 768 + .await 769 + .map_err(|e| { 770 + tonic::Status::unknown( 771 + format!("Service was not ready: {}", e.into()), 772 + ) 773 + })?; 706 774 let codec = tonic::codec::ProstCodec::default(); 707 - let path = 708 - http::uri::PathAndQuery::from_static("/rockbox.v1alpha1.LibraryService/GetTrack"); 775 + let path = http::uri::PathAndQuery::from_static( 776 + "/rockbox.v1alpha1.LibraryService/GetTrack", 777 + ); 709 778 let mut req = request.into_request(); 710 - req.extensions_mut().insert(GrpcMethod::new( 711 - "rockbox.v1alpha1.LibraryService", 712 - "GetTrack", 713 - )); 779 + req.extensions_mut() 780 + .insert(GrpcMethod::new("rockbox.v1alpha1.LibraryService", "GetTrack")); 714 781 self.inner.unary(req, path, codec).await 715 782 } 716 783 pub async fn like_track( 717 784 &mut self, 718 785 request: impl tonic::IntoRequest<super::LikeTrackRequest>, 719 - ) -> std::result::Result<tonic::Response<super::LikeTrackResponse>, tonic::Status> { 720 - self.inner.ready().await.map_err(|e| { 721 - tonic::Status::unknown(format!("Service was not ready: {}", e.into())) 722 - })?; 786 + ) -> std::result::Result< 787 + tonic::Response<super::LikeTrackResponse>, 788 + tonic::Status, 789 + > { 790 + self.inner 791 + .ready() 792 + .await 793 + .map_err(|e| { 794 + tonic::Status::unknown( 795 + format!("Service was not ready: {}", e.into()), 796 + ) 797 + })?; 723 798 let codec = tonic::codec::ProstCodec::default(); 724 - let path = 725 - http::uri::PathAndQuery::from_static("/rockbox.v1alpha1.LibraryService/LikeTrack"); 799 + let path = http::uri::PathAndQuery::from_static( 800 + "/rockbox.v1alpha1.LibraryService/LikeTrack", 801 + ); 726 802 let mut req = request.into_request(); 727 - req.extensions_mut().insert(GrpcMethod::new( 728 - "rockbox.v1alpha1.LibraryService", 729 - "LikeTrack", 730 - )); 803 + req.extensions_mut() 804 + .insert(GrpcMethod::new("rockbox.v1alpha1.LibraryService", "LikeTrack")); 731 805 self.inner.unary(req, path, codec).await 732 806 } 733 807 pub async fn unlike_track( 734 808 &mut self, 735 809 request: impl tonic::IntoRequest<super::UnlikeTrackRequest>, 736 - ) -> std::result::Result<tonic::Response<super::UnlikeTrackResponse>, tonic::Status> 737 - { 738 - self.inner.ready().await.map_err(|e| { 739 - tonic::Status::unknown(format!("Service was not ready: {}", e.into())) 740 - })?; 810 + ) -> std::result::Result< 811 + tonic::Response<super::UnlikeTrackResponse>, 812 + tonic::Status, 813 + > { 814 + self.inner 815 + .ready() 816 + .await 817 + .map_err(|e| { 818 + tonic::Status::unknown( 819 + format!("Service was not ready: {}", e.into()), 820 + ) 821 + })?; 741 822 let codec = tonic::codec::ProstCodec::default(); 742 823 let path = http::uri::PathAndQuery::from_static( 743 824 "/rockbox.v1alpha1.LibraryService/UnlikeTrack", 744 825 ); 745 826 let mut req = request.into_request(); 746 - req.extensions_mut().insert(GrpcMethod::new( 747 - "rockbox.v1alpha1.LibraryService", 748 - "UnlikeTrack", 749 - )); 827 + req.extensions_mut() 828 + .insert( 829 + GrpcMethod::new("rockbox.v1alpha1.LibraryService", "UnlikeTrack"), 830 + ); 750 831 self.inner.unary(req, path, codec).await 751 832 } 752 833 pub async fn like_album( 753 834 &mut self, 754 835 request: impl tonic::IntoRequest<super::LikeAlbumRequest>, 755 - ) -> std::result::Result<tonic::Response<super::LikeAlbumResponse>, tonic::Status> { 756 - self.inner.ready().await.map_err(|e| { 757 - tonic::Status::unknown(format!("Service was not ready: {}", e.into())) 758 - })?; 836 + ) -> std::result::Result< 837 + tonic::Response<super::LikeAlbumResponse>, 838 + tonic::Status, 839 + > { 840 + self.inner 841 + .ready() 842 + .await 843 + .map_err(|e| { 844 + tonic::Status::unknown( 845 + format!("Service was not ready: {}", e.into()), 846 + ) 847 + })?; 759 848 let codec = tonic::codec::ProstCodec::default(); 760 - let path = 761 - http::uri::PathAndQuery::from_static("/rockbox.v1alpha1.LibraryService/LikeAlbum"); 849 + let path = http::uri::PathAndQuery::from_static( 850 + "/rockbox.v1alpha1.LibraryService/LikeAlbum", 851 + ); 762 852 let mut req = request.into_request(); 763 - req.extensions_mut().insert(GrpcMethod::new( 764 - "rockbox.v1alpha1.LibraryService", 765 - "LikeAlbum", 766 - )); 853 + req.extensions_mut() 854 + .insert(GrpcMethod::new("rockbox.v1alpha1.LibraryService", "LikeAlbum")); 767 855 self.inner.unary(req, path, codec).await 768 856 } 769 857 pub async fn unlike_album( 770 858 &mut self, 771 859 request: impl tonic::IntoRequest<super::UnlikeAlbumRequest>, 772 - ) -> std::result::Result<tonic::Response<super::UnlikeAlbumResponse>, tonic::Status> 773 - { 774 - self.inner.ready().await.map_err(|e| { 775 - tonic::Status::unknown(format!("Service was not ready: {}", e.into())) 776 - })?; 860 + ) -> std::result::Result< 861 + tonic::Response<super::UnlikeAlbumResponse>, 862 + tonic::Status, 863 + > { 864 + self.inner 865 + .ready() 866 + .await 867 + .map_err(|e| { 868 + tonic::Status::unknown( 869 + format!("Service was not ready: {}", e.into()), 870 + ) 871 + })?; 777 872 let codec = tonic::codec::ProstCodec::default(); 778 873 let path = http::uri::PathAndQuery::from_static( 779 874 "/rockbox.v1alpha1.LibraryService/UnlikeAlbum", 780 875 ); 781 876 let mut req = request.into_request(); 782 - req.extensions_mut().insert(GrpcMethod::new( 783 - "rockbox.v1alpha1.LibraryService", 784 - "UnlikeAlbum", 785 - )); 877 + req.extensions_mut() 878 + .insert( 879 + GrpcMethod::new("rockbox.v1alpha1.LibraryService", "UnlikeAlbum"), 880 + ); 786 881 self.inner.unary(req, path, codec).await 787 882 } 788 883 pub async fn get_liked_tracks( 789 884 &mut self, 790 885 request: impl tonic::IntoRequest<super::GetLikedTracksRequest>, 791 - ) -> std::result::Result<tonic::Response<super::GetLikedTracksResponse>, tonic::Status> 792 - { 793 - self.inner.ready().await.map_err(|e| { 794 - tonic::Status::unknown(format!("Service was not ready: {}", e.into())) 795 - })?; 886 + ) -> std::result::Result< 887 + tonic::Response<super::GetLikedTracksResponse>, 888 + tonic::Status, 889 + > { 890 + self.inner 891 + .ready() 892 + .await 893 + .map_err(|e| { 894 + tonic::Status::unknown( 895 + format!("Service was not ready: {}", e.into()), 896 + ) 897 + })?; 796 898 let codec = tonic::codec::ProstCodec::default(); 797 899 let path = http::uri::PathAndQuery::from_static( 798 900 "/rockbox.v1alpha1.LibraryService/GetLikedTracks", 799 901 ); 800 902 let mut req = request.into_request(); 801 - req.extensions_mut().insert(GrpcMethod::new( 802 - "rockbox.v1alpha1.LibraryService", 803 - "GetLikedTracks", 804 - )); 903 + req.extensions_mut() 904 + .insert( 905 + GrpcMethod::new("rockbox.v1alpha1.LibraryService", "GetLikedTracks"), 906 + ); 805 907 self.inner.unary(req, path, codec).await 806 908 } 807 909 pub async fn get_liked_albums( 808 910 &mut self, 809 911 request: impl tonic::IntoRequest<super::GetLikedAlbumsRequest>, 810 - ) -> std::result::Result<tonic::Response<super::GetLikedAlbumsResponse>, tonic::Status> 811 - { 812 - self.inner.ready().await.map_err(|e| { 813 - tonic::Status::unknown(format!("Service was not ready: {}", e.into())) 814 - })?; 912 + ) -> std::result::Result< 913 + tonic::Response<super::GetLikedAlbumsResponse>, 914 + tonic::Status, 915 + > { 916 + self.inner 917 + .ready() 918 + .await 919 + .map_err(|e| { 920 + tonic::Status::unknown( 921 + format!("Service was not ready: {}", e.into()), 922 + ) 923 + })?; 815 924 let codec = tonic::codec::ProstCodec::default(); 816 925 let path = http::uri::PathAndQuery::from_static( 817 926 "/rockbox.v1alpha1.LibraryService/GetLikedAlbums", 818 927 ); 819 928 let mut req = request.into_request(); 820 - req.extensions_mut().insert(GrpcMethod::new( 821 - "rockbox.v1alpha1.LibraryService", 822 - "GetLikedAlbums", 823 - )); 929 + req.extensions_mut() 930 + .insert( 931 + GrpcMethod::new("rockbox.v1alpha1.LibraryService", "GetLikedAlbums"), 932 + ); 824 933 self.inner.unary(req, path, codec).await 825 934 } 826 935 pub async fn scan_library( 827 936 &mut self, 828 937 request: impl tonic::IntoRequest<super::ScanLibraryRequest>, 829 - ) -> std::result::Result<tonic::Response<super::ScanLibraryResponse>, tonic::Status> 830 - { 831 - self.inner.ready().await.map_err(|e| { 832 - tonic::Status::unknown(format!("Service was not ready: {}", e.into())) 833 - })?; 938 + ) -> std::result::Result< 939 + tonic::Response<super::ScanLibraryResponse>, 940 + tonic::Status, 941 + > { 942 + self.inner 943 + .ready() 944 + .await 945 + .map_err(|e| { 946 + tonic::Status::unknown( 947 + format!("Service was not ready: {}", e.into()), 948 + ) 949 + })?; 834 950 let codec = tonic::codec::ProstCodec::default(); 835 951 let path = http::uri::PathAndQuery::from_static( 836 952 "/rockbox.v1alpha1.LibraryService/ScanLibrary", 837 953 ); 838 954 let mut req = request.into_request(); 839 - req.extensions_mut().insert(GrpcMethod::new( 840 - "rockbox.v1alpha1.LibraryService", 841 - "ScanLibrary", 842 - )); 955 + req.extensions_mut() 956 + .insert( 957 + GrpcMethod::new("rockbox.v1alpha1.LibraryService", "ScanLibrary"), 958 + ); 843 959 self.inner.unary(req, path, codec).await 844 960 } 845 961 pub async fn search( 846 962 &mut self, 847 963 request: impl tonic::IntoRequest<super::SearchRequest>, 848 964 ) -> std::result::Result<tonic::Response<super::SearchResponse>, tonic::Status> { 849 - self.inner.ready().await.map_err(|e| { 850 - tonic::Status::unknown(format!("Service was not ready: {}", e.into())) 851 - })?; 965 + self.inner 966 + .ready() 967 + .await 968 + .map_err(|e| { 969 + tonic::Status::unknown( 970 + format!("Service was not ready: {}", e.into()), 971 + ) 972 + })?; 852 973 let codec = tonic::codec::ProstCodec::default(); 853 - let path = 854 - http::uri::PathAndQuery::from_static("/rockbox.v1alpha1.LibraryService/Search"); 974 + let path = http::uri::PathAndQuery::from_static( 975 + "/rockbox.v1alpha1.LibraryService/Search", 976 + ); 855 977 let mut req = request.into_request(); 856 978 req.extensions_mut() 857 979 .insert(GrpcMethod::new("rockbox.v1alpha1.LibraryService", "Search")); ··· 866 988 dead_code, 867 989 missing_docs, 868 990 clippy::wildcard_imports, 869 - clippy::let_unit_value 991 + clippy::let_unit_value, 870 992 )] 871 993 use tonic::codegen::*; 872 994 /// Generated trait containing gRPC methods that should be implemented for use with LibraryServiceServer. ··· 875 997 async fn get_albums( 876 998 &self, 877 999 request: tonic::Request<super::GetAlbumsRequest>, 878 - ) -> std::result::Result<tonic::Response<super::GetAlbumsResponse>, tonic::Status>; 1000 + ) -> std::result::Result< 1001 + tonic::Response<super::GetAlbumsResponse>, 1002 + tonic::Status, 1003 + >; 879 1004 async fn get_artists( 880 1005 &self, 881 1006 request: tonic::Request<super::GetArtistsRequest>, 882 - ) -> std::result::Result<tonic::Response<super::GetArtistsResponse>, tonic::Status>; 1007 + ) -> std::result::Result< 1008 + tonic::Response<super::GetArtistsResponse>, 1009 + tonic::Status, 1010 + >; 883 1011 async fn get_tracks( 884 1012 &self, 885 1013 request: tonic::Request<super::GetTracksRequest>, 886 - ) -> std::result::Result<tonic::Response<super::GetTracksResponse>, tonic::Status>; 1014 + ) -> std::result::Result< 1015 + tonic::Response<super::GetTracksResponse>, 1016 + tonic::Status, 1017 + >; 887 1018 async fn get_album( 888 1019 &self, 889 1020 request: tonic::Request<super::GetAlbumRequest>, 890 - ) -> std::result::Result<tonic::Response<super::GetAlbumResponse>, tonic::Status>; 1021 + ) -> std::result::Result< 1022 + tonic::Response<super::GetAlbumResponse>, 1023 + tonic::Status, 1024 + >; 891 1025 async fn get_artist( 892 1026 &self, 893 1027 request: tonic::Request<super::GetArtistRequest>, 894 - ) -> std::result::Result<tonic::Response<super::GetArtistResponse>, tonic::Status>; 1028 + ) -> std::result::Result< 1029 + tonic::Response<super::GetArtistResponse>, 1030 + tonic::Status, 1031 + >; 895 1032 async fn get_track( 896 1033 &self, 897 1034 request: tonic::Request<super::GetTrackRequest>, 898 - ) -> std::result::Result<tonic::Response<super::GetTrackResponse>, tonic::Status>; 1035 + ) -> std::result::Result< 1036 + tonic::Response<super::GetTrackResponse>, 1037 + tonic::Status, 1038 + >; 899 1039 async fn like_track( 900 1040 &self, 901 1041 request: tonic::Request<super::LikeTrackRequest>, 902 - ) -> std::result::Result<tonic::Response<super::LikeTrackResponse>, tonic::Status>; 1042 + ) -> std::result::Result< 1043 + tonic::Response<super::LikeTrackResponse>, 1044 + tonic::Status, 1045 + >; 903 1046 async fn unlike_track( 904 1047 &self, 905 1048 request: tonic::Request<super::UnlikeTrackRequest>, 906 - ) -> std::result::Result<tonic::Response<super::UnlikeTrackResponse>, tonic::Status>; 1049 + ) -> std::result::Result< 1050 + tonic::Response<super::UnlikeTrackResponse>, 1051 + tonic::Status, 1052 + >; 907 1053 async fn like_album( 908 1054 &self, 909 1055 request: tonic::Request<super::LikeAlbumRequest>, 910 - ) -> std::result::Result<tonic::Response<super::LikeAlbumResponse>, tonic::Status>; 1056 + ) -> std::result::Result< 1057 + tonic::Response<super::LikeAlbumResponse>, 1058 + tonic::Status, 1059 + >; 911 1060 async fn unlike_album( 912 1061 &self, 913 1062 request: tonic::Request<super::UnlikeAlbumRequest>, 914 - ) -> std::result::Result<tonic::Response<super::UnlikeAlbumResponse>, tonic::Status>; 1063 + ) -> std::result::Result< 1064 + tonic::Response<super::UnlikeAlbumResponse>, 1065 + tonic::Status, 1066 + >; 915 1067 async fn get_liked_tracks( 916 1068 &self, 917 1069 request: tonic::Request<super::GetLikedTracksRequest>, 918 - ) -> std::result::Result<tonic::Response<super::GetLikedTracksResponse>, tonic::Status>; 1070 + ) -> std::result::Result< 1071 + tonic::Response<super::GetLikedTracksResponse>, 1072 + tonic::Status, 1073 + >; 919 1074 async fn get_liked_albums( 920 1075 &self, 921 1076 request: tonic::Request<super::GetLikedAlbumsRequest>, 922 - ) -> std::result::Result<tonic::Response<super::GetLikedAlbumsResponse>, tonic::Status>; 1077 + ) -> std::result::Result< 1078 + tonic::Response<super::GetLikedAlbumsResponse>, 1079 + tonic::Status, 1080 + >; 923 1081 async fn scan_library( 924 1082 &self, 925 1083 request: tonic::Request<super::ScanLibraryRequest>, 926 - ) -> std::result::Result<tonic::Response<super::ScanLibraryResponse>, tonic::Status>; 1084 + ) -> std::result::Result< 1085 + tonic::Response<super::ScanLibraryResponse>, 1086 + tonic::Status, 1087 + >; 927 1088 async fn search( 928 1089 &self, 929 1090 request: tonic::Request<super::SearchRequest>, ··· 950 1111 max_encoding_message_size: None, 951 1112 } 952 1113 } 953 - pub fn with_interceptor<F>(inner: T, interceptor: F) -> InterceptedService<Self, F> 1114 + pub fn with_interceptor<F>( 1115 + inner: T, 1116 + interceptor: F, 1117 + ) -> InterceptedService<Self, F> 954 1118 where 955 1119 F: tonic::service::Interceptor, 956 1120 { ··· 1005 1169 "/rockbox.v1alpha1.LibraryService/GetAlbums" => { 1006 1170 #[allow(non_camel_case_types)] 1007 1171 struct GetAlbumsSvc<T: LibraryService>(pub Arc<T>); 1008 - impl<T: LibraryService> tonic::server::UnaryService<super::GetAlbumsRequest> for GetAlbumsSvc<T> { 1172 + impl< 1173 + T: LibraryService, 1174 + > tonic::server::UnaryService<super::GetAlbumsRequest> 1175 + for GetAlbumsSvc<T> { 1009 1176 type Response = super::GetAlbumsResponse; 1010 - type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>; 1177 + type Future = BoxFuture< 1178 + tonic::Response<Self::Response>, 1179 + tonic::Status, 1180 + >; 1011 1181 fn call( 1012 1182 &mut self, 1013 1183 request: tonic::Request<super::GetAlbumsRequest>, ··· 1044 1214 "/rockbox.v1alpha1.LibraryService/GetArtists" => { 1045 1215 #[allow(non_camel_case_types)] 1046 1216 struct GetArtistsSvc<T: LibraryService>(pub Arc<T>); 1047 - impl<T: LibraryService> tonic::server::UnaryService<super::GetArtistsRequest> for GetArtistsSvc<T> { 1217 + impl< 1218 + T: LibraryService, 1219 + > tonic::server::UnaryService<super::GetArtistsRequest> 1220 + for GetArtistsSvc<T> { 1048 1221 type Response = super::GetArtistsResponse; 1049 - type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>; 1222 + type Future = BoxFuture< 1223 + tonic::Response<Self::Response>, 1224 + tonic::Status, 1225 + >; 1050 1226 fn call( 1051 1227 &mut self, 1052 1228 request: tonic::Request<super::GetArtistsRequest>, ··· 1083 1259 "/rockbox.v1alpha1.LibraryService/GetTracks" => { 1084 1260 #[allow(non_camel_case_types)] 1085 1261 struct GetTracksSvc<T: LibraryService>(pub Arc<T>); 1086 - impl<T: LibraryService> tonic::server::UnaryService<super::GetTracksRequest> for GetTracksSvc<T> { 1262 + impl< 1263 + T: LibraryService, 1264 + > tonic::server::UnaryService<super::GetTracksRequest> 1265 + for GetTracksSvc<T> { 1087 1266 type Response = super::GetTracksResponse; 1088 - type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>; 1267 + type Future = BoxFuture< 1268 + tonic::Response<Self::Response>, 1269 + tonic::Status, 1270 + >; 1089 1271 fn call( 1090 1272 &mut self, 1091 1273 request: tonic::Request<super::GetTracksRequest>, ··· 1122 1304 "/rockbox.v1alpha1.LibraryService/GetAlbum" => { 1123 1305 #[allow(non_camel_case_types)] 1124 1306 struct GetAlbumSvc<T: LibraryService>(pub Arc<T>); 1125 - impl<T: LibraryService> tonic::server::UnaryService<super::GetAlbumRequest> for GetAlbumSvc<T> { 1307 + impl< 1308 + T: LibraryService, 1309 + > tonic::server::UnaryService<super::GetAlbumRequest> 1310 + for GetAlbumSvc<T> { 1126 1311 type Response = super::GetAlbumResponse; 1127 - type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>; 1312 + type Future = BoxFuture< 1313 + tonic::Response<Self::Response>, 1314 + tonic::Status, 1315 + >; 1128 1316 fn call( 1129 1317 &mut self, 1130 1318 request: tonic::Request<super::GetAlbumRequest>, ··· 1161 1349 "/rockbox.v1alpha1.LibraryService/GetArtist" => { 1162 1350 #[allow(non_camel_case_types)] 1163 1351 struct GetArtistSvc<T: LibraryService>(pub Arc<T>); 1164 - impl<T: LibraryService> tonic::server::UnaryService<super::GetArtistRequest> for GetArtistSvc<T> { 1352 + impl< 1353 + T: LibraryService, 1354 + > tonic::server::UnaryService<super::GetArtistRequest> 1355 + for GetArtistSvc<T> { 1165 1356 type Response = super::GetArtistResponse; 1166 - type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>; 1357 + type Future = BoxFuture< 1358 + tonic::Response<Self::Response>, 1359 + tonic::Status, 1360 + >; 1167 1361 fn call( 1168 1362 &mut self, 1169 1363 request: tonic::Request<super::GetArtistRequest>, ··· 1200 1394 "/rockbox.v1alpha1.LibraryService/GetTrack" => { 1201 1395 #[allow(non_camel_case_types)] 1202 1396 struct GetTrackSvc<T: LibraryService>(pub Arc<T>); 1203 - impl<T: LibraryService> tonic::server::UnaryService<super::GetTrackRequest> for GetTrackSvc<T> { 1397 + impl< 1398 + T: LibraryService, 1399 + > tonic::server::UnaryService<super::GetTrackRequest> 1400 + for GetTrackSvc<T> { 1204 1401 type Response = super::GetTrackResponse; 1205 - type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>; 1402 + type Future = BoxFuture< 1403 + tonic::Response<Self::Response>, 1404 + tonic::Status, 1405 + >; 1206 1406 fn call( 1207 1407 &mut self, 1208 1408 request: tonic::Request<super::GetTrackRequest>, ··· 1239 1439 "/rockbox.v1alpha1.LibraryService/LikeTrack" => { 1240 1440 #[allow(non_camel_case_types)] 1241 1441 struct LikeTrackSvc<T: LibraryService>(pub Arc<T>); 1242 - impl<T: LibraryService> tonic::server::UnaryService<super::LikeTrackRequest> for LikeTrackSvc<T> { 1442 + impl< 1443 + T: LibraryService, 1444 + > tonic::server::UnaryService<super::LikeTrackRequest> 1445 + for LikeTrackSvc<T> { 1243 1446 type Response = super::LikeTrackResponse; 1244 - type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>; 1447 + type Future = BoxFuture< 1448 + tonic::Response<Self::Response>, 1449 + tonic::Status, 1450 + >; 1245 1451 fn call( 1246 1452 &mut self, 1247 1453 request: tonic::Request<super::LikeTrackRequest>, ··· 1278 1484 "/rockbox.v1alpha1.LibraryService/UnlikeTrack" => { 1279 1485 #[allow(non_camel_case_types)] 1280 1486 struct UnlikeTrackSvc<T: LibraryService>(pub Arc<T>); 1281 - impl<T: LibraryService> tonic::server::UnaryService<super::UnlikeTrackRequest> 1282 - for UnlikeTrackSvc<T> 1283 - { 1487 + impl< 1488 + T: LibraryService, 1489 + > tonic::server::UnaryService<super::UnlikeTrackRequest> 1490 + for UnlikeTrackSvc<T> { 1284 1491 type Response = super::UnlikeTrackResponse; 1285 - type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>; 1492 + type Future = BoxFuture< 1493 + tonic::Response<Self::Response>, 1494 + tonic::Status, 1495 + >; 1286 1496 fn call( 1287 1497 &mut self, 1288 1498 request: tonic::Request<super::UnlikeTrackRequest>, ··· 1319 1529 "/rockbox.v1alpha1.LibraryService/LikeAlbum" => { 1320 1530 #[allow(non_camel_case_types)] 1321 1531 struct LikeAlbumSvc<T: LibraryService>(pub Arc<T>); 1322 - impl<T: LibraryService> tonic::server::UnaryService<super::LikeAlbumRequest> for LikeAlbumSvc<T> { 1532 + impl< 1533 + T: LibraryService, 1534 + > tonic::server::UnaryService<super::LikeAlbumRequest> 1535 + for LikeAlbumSvc<T> { 1323 1536 type Response = super::LikeAlbumResponse; 1324 - type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>; 1537 + type Future = BoxFuture< 1538 + tonic::Response<Self::Response>, 1539 + tonic::Status, 1540 + >; 1325 1541 fn call( 1326 1542 &mut self, 1327 1543 request: tonic::Request<super::LikeAlbumRequest>, ··· 1358 1574 "/rockbox.v1alpha1.LibraryService/UnlikeAlbum" => { 1359 1575 #[allow(non_camel_case_types)] 1360 1576 struct UnlikeAlbumSvc<T: LibraryService>(pub Arc<T>); 1361 - impl<T: LibraryService> tonic::server::UnaryService<super::UnlikeAlbumRequest> 1362 - for UnlikeAlbumSvc<T> 1363 - { 1577 + impl< 1578 + T: LibraryService, 1579 + > tonic::server::UnaryService<super::UnlikeAlbumRequest> 1580 + for UnlikeAlbumSvc<T> { 1364 1581 type Response = super::UnlikeAlbumResponse; 1365 - type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>; 1582 + type Future = BoxFuture< 1583 + tonic::Response<Self::Response>, 1584 + tonic::Status, 1585 + >; 1366 1586 fn call( 1367 1587 &mut self, 1368 1588 request: tonic::Request<super::UnlikeAlbumRequest>, ··· 1399 1619 "/rockbox.v1alpha1.LibraryService/GetLikedTracks" => { 1400 1620 #[allow(non_camel_case_types)] 1401 1621 struct GetLikedTracksSvc<T: LibraryService>(pub Arc<T>); 1402 - impl<T: LibraryService> 1403 - tonic::server::UnaryService<super::GetLikedTracksRequest> 1404 - for GetLikedTracksSvc<T> 1405 - { 1622 + impl< 1623 + T: LibraryService, 1624 + > tonic::server::UnaryService<super::GetLikedTracksRequest> 1625 + for GetLikedTracksSvc<T> { 1406 1626 type Response = super::GetLikedTracksResponse; 1407 - type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>; 1627 + type Future = BoxFuture< 1628 + tonic::Response<Self::Response>, 1629 + tonic::Status, 1630 + >; 1408 1631 fn call( 1409 1632 &mut self, 1410 1633 request: tonic::Request<super::GetLikedTracksRequest>, 1411 1634 ) -> Self::Future { 1412 1635 let inner = Arc::clone(&self.0); 1413 1636 let fut = async move { 1414 - <T as LibraryService>::get_liked_tracks(&inner, request).await 1637 + <T as LibraryService>::get_liked_tracks(&inner, request) 1638 + .await 1415 1639 }; 1416 1640 Box::pin(fut) 1417 1641 } ··· 1441 1665 "/rockbox.v1alpha1.LibraryService/GetLikedAlbums" => { 1442 1666 #[allow(non_camel_case_types)] 1443 1667 struct GetLikedAlbumsSvc<T: LibraryService>(pub Arc<T>); 1444 - impl<T: LibraryService> 1445 - tonic::server::UnaryService<super::GetLikedAlbumsRequest> 1446 - for GetLikedAlbumsSvc<T> 1447 - { 1668 + impl< 1669 + T: LibraryService, 1670 + > tonic::server::UnaryService<super::GetLikedAlbumsRequest> 1671 + for GetLikedAlbumsSvc<T> { 1448 1672 type Response = super::GetLikedAlbumsResponse; 1449 - type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>; 1673 + type Future = BoxFuture< 1674 + tonic::Response<Self::Response>, 1675 + tonic::Status, 1676 + >; 1450 1677 fn call( 1451 1678 &mut self, 1452 1679 request: tonic::Request<super::GetLikedAlbumsRequest>, 1453 1680 ) -> Self::Future { 1454 1681 let inner = Arc::clone(&self.0); 1455 1682 let fut = async move { 1456 - <T as LibraryService>::get_liked_albums(&inner, request).await 1683 + <T as LibraryService>::get_liked_albums(&inner, request) 1684 + .await 1457 1685 }; 1458 1686 Box::pin(fut) 1459 1687 } ··· 1483 1711 "/rockbox.v1alpha1.LibraryService/ScanLibrary" => { 1484 1712 #[allow(non_camel_case_types)] 1485 1713 struct ScanLibrarySvc<T: LibraryService>(pub Arc<T>); 1486 - impl<T: LibraryService> tonic::server::UnaryService<super::ScanLibraryRequest> 1487 - for ScanLibrarySvc<T> 1488 - { 1714 + impl< 1715 + T: LibraryService, 1716 + > tonic::server::UnaryService<super::ScanLibraryRequest> 1717 + for ScanLibrarySvc<T> { 1489 1718 type Response = super::ScanLibraryResponse; 1490 - type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>; 1719 + type Future = BoxFuture< 1720 + tonic::Response<Self::Response>, 1721 + tonic::Status, 1722 + >; 1491 1723 fn call( 1492 1724 &mut self, 1493 1725 request: tonic::Request<super::ScanLibraryRequest>, ··· 1524 1756 "/rockbox.v1alpha1.LibraryService/Search" => { 1525 1757 #[allow(non_camel_case_types)] 1526 1758 struct SearchSvc<T: LibraryService>(pub Arc<T>); 1527 - impl<T: LibraryService> tonic::server::UnaryService<super::SearchRequest> for SearchSvc<T> { 1759 + impl< 1760 + T: LibraryService, 1761 + > tonic::server::UnaryService<super::SearchRequest> 1762 + for SearchSvc<T> { 1528 1763 type Response = super::SearchResponse; 1529 - type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>; 1764 + type Future = BoxFuture< 1765 + tonic::Response<Self::Response>, 1766 + tonic::Status, 1767 + >; 1530 1768 fn call( 1531 1769 &mut self, 1532 1770 request: tonic::Request<super::SearchRequest>, 1533 1771 ) -> Self::Future { 1534 1772 let inner = Arc::clone(&self.0); 1535 - let fut = 1536 - async move { <T as LibraryService>::search(&inner, request).await }; 1773 + let fut = async move { 1774 + <T as LibraryService>::search(&inner, request).await 1775 + }; 1537 1776 Box::pin(fut) 1538 1777 } 1539 1778 } ··· 1559 1798 }; 1560 1799 Box::pin(fut) 1561 1800 } 1562 - _ => Box::pin(async move { 1563 - let mut response = http::Response::new(empty_body()); 1564 - let headers = response.headers_mut(); 1565 - headers.insert( 1566 - tonic::Status::GRPC_STATUS, 1567 - (tonic::Code::Unimplemented as i32).into(), 1568 - ); 1569 - headers.insert( 1570 - http::header::CONTENT_TYPE, 1571 - tonic::metadata::GRPC_CONTENT_TYPE, 1572 - ); 1573 - Ok(response) 1574 - }), 1801 + _ => { 1802 + Box::pin(async move { 1803 + let mut response = http::Response::new(empty_body()); 1804 + let headers = response.headers_mut(); 1805 + headers 1806 + .insert( 1807 + tonic::Status::GRPC_STATUS, 1808 + (tonic::Code::Unimplemented as i32).into(), 1809 + ); 1810 + headers 1811 + .insert( 1812 + http::header::CONTENT_TYPE, 1813 + tonic::metadata::GRPC_CONTENT_TYPE, 1814 + ); 1815 + Ok(response) 1816 + }) 1817 + } 1575 1818 } 1576 1819 } 1577 1820 } ··· 1600 1843 dead_code, 1601 1844 missing_docs, 1602 1845 clippy::wildcard_imports, 1603 - clippy::let_unit_value 1846 + clippy::let_unit_value, 1604 1847 )] 1605 - use tonic::codegen::http::Uri; 1606 1848 use tonic::codegen::*; 1849 + use tonic::codegen::http::Uri; 1607 1850 #[derive(Debug, Clone)] 1608 1851 pub struct MetadataServiceClient<T> { 1609 1852 inner: tonic::client::Grpc<T>, ··· 1647 1890 <T as tonic::client::GrpcService<tonic::body::BoxBody>>::ResponseBody, 1648 1891 >, 1649 1892 >, 1650 - <T as tonic::codegen::Service<http::Request<tonic::body::BoxBody>>>::Error: 1651 - Into<StdError> + std::marker::Send + std::marker::Sync, 1893 + <T as tonic::codegen::Service< 1894 + http::Request<tonic::body::BoxBody>, 1895 + >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync, 1652 1896 { 1653 1897 MetadataServiceClient::new(InterceptedService::new(inner, interceptor)) 1654 1898 } ··· 1692 1936 dead_code, 1693 1937 missing_docs, 1694 1938 clippy::wildcard_imports, 1695 - clippy::let_unit_value 1939 + clippy::let_unit_value, 1696 1940 )] 1697 1941 use tonic::codegen::*; 1698 1942 /// Generated trait containing gRPC methods that should be implemented for use with MetadataServiceServer. ··· 1719 1963 max_encoding_message_size: None, 1720 1964 } 1721 1965 } 1722 - pub fn with_interceptor<F>(inner: T, interceptor: F) -> InterceptedService<Self, F> 1966 + pub fn with_interceptor<F>( 1967 + inner: T, 1968 + interceptor: F, 1969 + ) -> InterceptedService<Self, F> 1723 1970 where 1724 1971 F: tonic::service::Interceptor, 1725 1972 { ··· 1771 2018 } 1772 2019 fn call(&mut self, req: http::Request<B>) -> Self::Future { 1773 2020 match req.uri().path() { 1774 - _ => Box::pin(async move { 1775 - let mut response = http::Response::new(empty_body()); 1776 - let headers = response.headers_mut(); 1777 - headers.insert( 1778 - tonic::Status::GRPC_STATUS, 1779 - (tonic::Code::Unimplemented as i32).into(), 1780 - ); 1781 - headers.insert( 1782 - http::header::CONTENT_TYPE, 1783 - tonic::metadata::GRPC_CONTENT_TYPE, 1784 - ); 1785 - Ok(response) 1786 - }), 2021 + _ => { 2022 + Box::pin(async move { 2023 + let mut response = http::Response::new(empty_body()); 2024 + let headers = response.headers_mut(); 2025 + headers 2026 + .insert( 2027 + tonic::Status::GRPC_STATUS, 2028 + (tonic::Code::Unimplemented as i32).into(), 2029 + ); 2030 + headers 2031 + .insert( 2032 + http::header::CONTENT_TYPE, 2033 + tonic::metadata::GRPC_CONTENT_TYPE, 2034 + ); 2035 + Ok(response) 2036 + }) 2037 + } 1787 2038 } 1788 2039 } 1789 2040 } ··· 2067 2318 dead_code, 2068 2319 missing_docs, 2069 2320 clippy::wildcard_imports, 2070 - clippy::let_unit_value 2321 + clippy::let_unit_value, 2071 2322 )] 2072 - use tonic::codegen::http::Uri; 2073 2323 use tonic::codegen::*; 2324 + use tonic::codegen::http::Uri; 2074 2325 #[derive(Debug, Clone)] 2075 2326 pub struct PlaybackServiceClient<T> { 2076 2327 inner: tonic::client::Grpc<T>, ··· 2114 2365 <T as tonic::client::GrpcService<tonic::body::BoxBody>>::ResponseBody, 2115 2366 >, 2116 2367 >, 2117 - <T as tonic::codegen::Service<http::Request<tonic::body::BoxBody>>>::Error: 2118 - Into<StdError> + std::marker::Send + std::marker::Sync, 2368 + <T as tonic::codegen::Service< 2369 + http::Request<tonic::body::BoxBody>, 2370 + >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync, 2119 2371 { 2120 2372 PlaybackServiceClient::new(InterceptedService::new(inner, interceptor)) 2121 2373 } ··· 2154 2406 &mut self, 2155 2407 request: impl tonic::IntoRequest<super::PlayRequest>, 2156 2408 ) -> std::result::Result<tonic::Response<super::PlayResponse>, tonic::Status> { 2157 - self.inner.ready().await.map_err(|e| { 2158 - tonic::Status::unknown(format!("Service was not ready: {}", e.into())) 2159 - })?; 2409 + self.inner 2410 + .ready() 2411 + .await 2412 + .map_err(|e| { 2413 + tonic::Status::unknown( 2414 + format!("Service was not ready: {}", e.into()), 2415 + ) 2416 + })?; 2160 2417 let codec = tonic::codec::ProstCodec::default(); 2161 - let path = 2162 - http::uri::PathAndQuery::from_static("/rockbox.v1alpha1.PlaybackService/Play"); 2418 + let path = http::uri::PathAndQuery::from_static( 2419 + "/rockbox.v1alpha1.PlaybackService/Play", 2420 + ); 2163 2421 let mut req = request.into_request(); 2164 2422 req.extensions_mut() 2165 2423 .insert(GrpcMethod::new("rockbox.v1alpha1.PlaybackService", "Play")); ··· 2169 2427 &mut self, 2170 2428 request: impl tonic::IntoRequest<super::PauseRequest>, 2171 2429 ) -> std::result::Result<tonic::Response<super::PauseResponse>, tonic::Status> { 2172 - self.inner.ready().await.map_err(|e| { 2173 - tonic::Status::unknown(format!("Service was not ready: {}", e.into())) 2174 - })?; 2430 + self.inner 2431 + .ready() 2432 + .await 2433 + .map_err(|e| { 2434 + tonic::Status::unknown( 2435 + format!("Service was not ready: {}", e.into()), 2436 + ) 2437 + })?; 2175 2438 let codec = tonic::codec::ProstCodec::default(); 2176 - let path = 2177 - http::uri::PathAndQuery::from_static("/rockbox.v1alpha1.PlaybackService/Pause"); 2439 + let path = http::uri::PathAndQuery::from_static( 2440 + "/rockbox.v1alpha1.PlaybackService/Pause", 2441 + ); 2178 2442 let mut req = request.into_request(); 2179 2443 req.extensions_mut() 2180 2444 .insert(GrpcMethod::new("rockbox.v1alpha1.PlaybackService", "Pause")); ··· 2183 2447 pub async fn play_or_pause( 2184 2448 &mut self, 2185 2449 request: impl tonic::IntoRequest<super::PlayOrPauseRequest>, 2186 - ) -> std::result::Result<tonic::Response<super::PlayOrPauseResponse>, tonic::Status> 2187 - { 2188 - self.inner.ready().await.map_err(|e| { 2189 - tonic::Status::unknown(format!("Service was not ready: {}", e.into())) 2190 - })?; 2450 + ) -> std::result::Result< 2451 + tonic::Response<super::PlayOrPauseResponse>, 2452 + tonic::Status, 2453 + > { 2454 + self.inner 2455 + .ready() 2456 + .await 2457 + .map_err(|e| { 2458 + tonic::Status::unknown( 2459 + format!("Service was not ready: {}", e.into()), 2460 + ) 2461 + })?; 2191 2462 let codec = tonic::codec::ProstCodec::default(); 2192 2463 let path = http::uri::PathAndQuery::from_static( 2193 2464 "/rockbox.v1alpha1.PlaybackService/PlayOrPause", 2194 2465 ); 2195 2466 let mut req = request.into_request(); 2196 - req.extensions_mut().insert(GrpcMethod::new( 2197 - "rockbox.v1alpha1.PlaybackService", 2198 - "PlayOrPause", 2199 - )); 2467 + req.extensions_mut() 2468 + .insert( 2469 + GrpcMethod::new("rockbox.v1alpha1.PlaybackService", "PlayOrPause"), 2470 + ); 2200 2471 self.inner.unary(req, path, codec).await 2201 2472 } 2202 2473 pub async fn resume( 2203 2474 &mut self, 2204 2475 request: impl tonic::IntoRequest<super::ResumeRequest>, 2205 2476 ) -> std::result::Result<tonic::Response<super::ResumeResponse>, tonic::Status> { 2206 - self.inner.ready().await.map_err(|e| { 2207 - tonic::Status::unknown(format!("Service was not ready: {}", e.into())) 2208 - })?; 2477 + self.inner 2478 + .ready() 2479 + .await 2480 + .map_err(|e| { 2481 + tonic::Status::unknown( 2482 + format!("Service was not ready: {}", e.into()), 2483 + ) 2484 + })?; 2209 2485 let codec = tonic::codec::ProstCodec::default(); 2210 - let path = 2211 - http::uri::PathAndQuery::from_static("/rockbox.v1alpha1.PlaybackService/Resume"); 2486 + let path = http::uri::PathAndQuery::from_static( 2487 + "/rockbox.v1alpha1.PlaybackService/Resume", 2488 + ); 2212 2489 let mut req = request.into_request(); 2213 - req.extensions_mut().insert(GrpcMethod::new( 2214 - "rockbox.v1alpha1.PlaybackService", 2215 - "Resume", 2216 - )); 2490 + req.extensions_mut() 2491 + .insert(GrpcMethod::new("rockbox.v1alpha1.PlaybackService", "Resume")); 2217 2492 self.inner.unary(req, path, codec).await 2218 2493 } 2219 2494 pub async fn next( 2220 2495 &mut self, 2221 2496 request: impl tonic::IntoRequest<super::NextRequest>, 2222 2497 ) -> std::result::Result<tonic::Response<super::NextResponse>, tonic::Status> { 2223 - self.inner.ready().await.map_err(|e| { 2224 - tonic::Status::unknown(format!("Service was not ready: {}", e.into())) 2225 - })?; 2498 + self.inner 2499 + .ready() 2500 + .await 2501 + .map_err(|e| { 2502 + tonic::Status::unknown( 2503 + format!("Service was not ready: {}", e.into()), 2504 + ) 2505 + })?; 2226 2506 let codec = tonic::codec::ProstCodec::default(); 2227 - let path = 2228 - http::uri::PathAndQuery::from_static("/rockbox.v1alpha1.PlaybackService/Next"); 2507 + let path = http::uri::PathAndQuery::from_static( 2508 + "/rockbox.v1alpha1.PlaybackService/Next", 2509 + ); 2229 2510 let mut req = request.into_request(); 2230 2511 req.extensions_mut() 2231 2512 .insert(GrpcMethod::new("rockbox.v1alpha1.PlaybackService", "Next")); ··· 2234 2515 pub async fn previous( 2235 2516 &mut self, 2236 2517 request: impl tonic::IntoRequest<super::PreviousRequest>, 2237 - ) -> std::result::Result<tonic::Response<super::PreviousResponse>, tonic::Status> { 2238 - self.inner.ready().await.map_err(|e| { 2239 - tonic::Status::unknown(format!("Service was not ready: {}", e.into())) 2240 - })?; 2518 + ) -> std::result::Result< 2519 + tonic::Response<super::PreviousResponse>, 2520 + tonic::Status, 2521 + > { 2522 + self.inner 2523 + .ready() 2524 + .await 2525 + .map_err(|e| { 2526 + tonic::Status::unknown( 2527 + format!("Service was not ready: {}", e.into()), 2528 + ) 2529 + })?; 2241 2530 let codec = tonic::codec::ProstCodec::default(); 2242 - let path = 2243 - http::uri::PathAndQuery::from_static("/rockbox.v1alpha1.PlaybackService/Previous"); 2531 + let path = http::uri::PathAndQuery::from_static( 2532 + "/rockbox.v1alpha1.PlaybackService/Previous", 2533 + ); 2244 2534 let mut req = request.into_request(); 2245 - req.extensions_mut().insert(GrpcMethod::new( 2246 - "rockbox.v1alpha1.PlaybackService", 2247 - "Previous", 2248 - )); 2535 + req.extensions_mut() 2536 + .insert(GrpcMethod::new("rockbox.v1alpha1.PlaybackService", "Previous")); 2249 2537 self.inner.unary(req, path, codec).await 2250 2538 } 2251 2539 pub async fn fast_forward_rewind( 2252 2540 &mut self, 2253 2541 request: impl tonic::IntoRequest<super::FastForwardRewindRequest>, 2254 - ) -> std::result::Result<tonic::Response<super::FastForwardRewindResponse>, tonic::Status> 2255 - { 2256 - self.inner.ready().await.map_err(|e| { 2257 - tonic::Status::unknown(format!("Service was not ready: {}", e.into())) 2258 - })?; 2542 + ) -> std::result::Result< 2543 + tonic::Response<super::FastForwardRewindResponse>, 2544 + tonic::Status, 2545 + > { 2546 + self.inner 2547 + .ready() 2548 + .await 2549 + .map_err(|e| { 2550 + tonic::Status::unknown( 2551 + format!("Service was not ready: {}", e.into()), 2552 + ) 2553 + })?; 2259 2554 let codec = tonic::codec::ProstCodec::default(); 2260 2555 let path = http::uri::PathAndQuery::from_static( 2261 2556 "/rockbox.v1alpha1.PlaybackService/FastForwardRewind", 2262 2557 ); 2263 2558 let mut req = request.into_request(); 2264 - req.extensions_mut().insert(GrpcMethod::new( 2265 - "rockbox.v1alpha1.PlaybackService", 2266 - "FastForwardRewind", 2267 - )); 2559 + req.extensions_mut() 2560 + .insert( 2561 + GrpcMethod::new( 2562 + "rockbox.v1alpha1.PlaybackService", 2563 + "FastForwardRewind", 2564 + ), 2565 + ); 2268 2566 self.inner.unary(req, path, codec).await 2269 2567 } 2270 2568 pub async fn status( 2271 2569 &mut self, 2272 2570 request: impl tonic::IntoRequest<super::StatusRequest>, 2273 2571 ) -> std::result::Result<tonic::Response<super::StatusResponse>, tonic::Status> { 2274 - self.inner.ready().await.map_err(|e| { 2275 - tonic::Status::unknown(format!("Service was not ready: {}", e.into())) 2276 - })?; 2572 + self.inner 2573 + .ready() 2574 + .await 2575 + .map_err(|e| { 2576 + tonic::Status::unknown( 2577 + format!("Service was not ready: {}", e.into()), 2578 + ) 2579 + })?; 2277 2580 let codec = tonic::codec::ProstCodec::default(); 2278 - let path = 2279 - http::uri::PathAndQuery::from_static("/rockbox.v1alpha1.PlaybackService/Status"); 2581 + let path = http::uri::PathAndQuery::from_static( 2582 + "/rockbox.v1alpha1.PlaybackService/Status", 2583 + ); 2280 2584 let mut req = request.into_request(); 2281 - req.extensions_mut().insert(GrpcMethod::new( 2282 - "rockbox.v1alpha1.PlaybackService", 2283 - "Status", 2284 - )); 2585 + req.extensions_mut() 2586 + .insert(GrpcMethod::new("rockbox.v1alpha1.PlaybackService", "Status")); 2285 2587 self.inner.unary(req, path, codec).await 2286 2588 } 2287 2589 pub async fn current_track( 2288 2590 &mut self, 2289 2591 request: impl tonic::IntoRequest<super::CurrentTrackRequest>, 2290 - ) -> std::result::Result<tonic::Response<super::CurrentTrackResponse>, tonic::Status> 2291 - { 2292 - self.inner.ready().await.map_err(|e| { 2293 - tonic::Status::unknown(format!("Service was not ready: {}", e.into())) 2294 - })?; 2592 + ) -> std::result::Result< 2593 + tonic::Response<super::CurrentTrackResponse>, 2594 + tonic::Status, 2595 + > { 2596 + self.inner 2597 + .ready() 2598 + .await 2599 + .map_err(|e| { 2600 + tonic::Status::unknown( 2601 + format!("Service was not ready: {}", e.into()), 2602 + ) 2603 + })?; 2295 2604 let codec = tonic::codec::ProstCodec::default(); 2296 2605 let path = http::uri::PathAndQuery::from_static( 2297 2606 "/rockbox.v1alpha1.PlaybackService/CurrentTrack", 2298 2607 ); 2299 2608 let mut req = request.into_request(); 2300 - req.extensions_mut().insert(GrpcMethod::new( 2301 - "rockbox.v1alpha1.PlaybackService", 2302 - "CurrentTrack", 2303 - )); 2609 + req.extensions_mut() 2610 + .insert( 2611 + GrpcMethod::new("rockbox.v1alpha1.PlaybackService", "CurrentTrack"), 2612 + ); 2304 2613 self.inner.unary(req, path, codec).await 2305 2614 } 2306 2615 pub async fn next_track( 2307 2616 &mut self, 2308 2617 request: impl tonic::IntoRequest<super::NextTrackRequest>, 2309 - ) -> std::result::Result<tonic::Response<super::NextTrackResponse>, tonic::Status> { 2310 - self.inner.ready().await.map_err(|e| { 2311 - tonic::Status::unknown(format!("Service was not ready: {}", e.into())) 2312 - })?; 2618 + ) -> std::result::Result< 2619 + tonic::Response<super::NextTrackResponse>, 2620 + tonic::Status, 2621 + > { 2622 + self.inner 2623 + .ready() 2624 + .await 2625 + .map_err(|e| { 2626 + tonic::Status::unknown( 2627 + format!("Service was not ready: {}", e.into()), 2628 + ) 2629 + })?; 2313 2630 let codec = tonic::codec::ProstCodec::default(); 2314 - let path = 2315 - http::uri::PathAndQuery::from_static("/rockbox.v1alpha1.PlaybackService/NextTrack"); 2631 + let path = http::uri::PathAndQuery::from_static( 2632 + "/rockbox.v1alpha1.PlaybackService/NextTrack", 2633 + ); 2316 2634 let mut req = request.into_request(); 2317 - req.extensions_mut().insert(GrpcMethod::new( 2318 - "rockbox.v1alpha1.PlaybackService", 2319 - "NextTrack", 2320 - )); 2635 + req.extensions_mut() 2636 + .insert( 2637 + GrpcMethod::new("rockbox.v1alpha1.PlaybackService", "NextTrack"), 2638 + ); 2321 2639 self.inner.unary(req, path, codec).await 2322 2640 } 2323 2641 pub async fn flush_and_reload_tracks( 2324 2642 &mut self, 2325 2643 request: impl tonic::IntoRequest<super::FlushAndReloadTracksRequest>, 2326 - ) -> std::result::Result<tonic::Response<super::FlushAndReloadTracksResponse>, tonic::Status> 2327 - { 2328 - self.inner.ready().await.map_err(|e| { 2329 - tonic::Status::unknown(format!("Service was not ready: {}", e.into())) 2330 - })?; 2644 + ) -> std::result::Result< 2645 + tonic::Response<super::FlushAndReloadTracksResponse>, 2646 + tonic::Status, 2647 + > { 2648 + self.inner 2649 + .ready() 2650 + .await 2651 + .map_err(|e| { 2652 + tonic::Status::unknown( 2653 + format!("Service was not ready: {}", e.into()), 2654 + ) 2655 + })?; 2331 2656 let codec = tonic::codec::ProstCodec::default(); 2332 2657 let path = http::uri::PathAndQuery::from_static( 2333 2658 "/rockbox.v1alpha1.PlaybackService/FlushAndReloadTracks", 2334 2659 ); 2335 2660 let mut req = request.into_request(); 2336 - req.extensions_mut().insert(GrpcMethod::new( 2337 - "rockbox.v1alpha1.PlaybackService", 2338 - "FlushAndReloadTracks", 2339 - )); 2661 + req.extensions_mut() 2662 + .insert( 2663 + GrpcMethod::new( 2664 + "rockbox.v1alpha1.PlaybackService", 2665 + "FlushAndReloadTracks", 2666 + ), 2667 + ); 2340 2668 self.inner.unary(req, path, codec).await 2341 2669 } 2342 2670 pub async fn get_file_position( 2343 2671 &mut self, 2344 2672 request: impl tonic::IntoRequest<super::GetFilePositionRequest>, 2345 - ) -> std::result::Result<tonic::Response<super::GetFilePositionResponse>, tonic::Status> 2346 - { 2347 - self.inner.ready().await.map_err(|e| { 2348 - tonic::Status::unknown(format!("Service was not ready: {}", e.into())) 2349 - })?; 2673 + ) -> std::result::Result< 2674 + tonic::Response<super::GetFilePositionResponse>, 2675 + tonic::Status, 2676 + > { 2677 + self.inner 2678 + .ready() 2679 + .await 2680 + .map_err(|e| { 2681 + tonic::Status::unknown( 2682 + format!("Service was not ready: {}", e.into()), 2683 + ) 2684 + })?; 2350 2685 let codec = tonic::codec::ProstCodec::default(); 2351 2686 let path = http::uri::PathAndQuery::from_static( 2352 2687 "/rockbox.v1alpha1.PlaybackService/GetFilePosition", 2353 2688 ); 2354 2689 let mut req = request.into_request(); 2355 - req.extensions_mut().insert(GrpcMethod::new( 2356 - "rockbox.v1alpha1.PlaybackService", 2357 - "GetFilePosition", 2358 - )); 2690 + req.extensions_mut() 2691 + .insert( 2692 + GrpcMethod::new( 2693 + "rockbox.v1alpha1.PlaybackService", 2694 + "GetFilePosition", 2695 + ), 2696 + ); 2359 2697 self.inner.unary(req, path, codec).await 2360 2698 } 2361 2699 pub async fn hard_stop( 2362 2700 &mut self, 2363 2701 request: impl tonic::IntoRequest<super::HardStopRequest>, 2364 - ) -> std::result::Result<tonic::Response<super::HardStopResponse>, tonic::Status> { 2365 - self.inner.ready().await.map_err(|e| { 2366 - tonic::Status::unknown(format!("Service was not ready: {}", e.into())) 2367 - })?; 2702 + ) -> std::result::Result< 2703 + tonic::Response<super::HardStopResponse>, 2704 + tonic::Status, 2705 + > { 2706 + self.inner 2707 + .ready() 2708 + .await 2709 + .map_err(|e| { 2710 + tonic::Status::unknown( 2711 + format!("Service was not ready: {}", e.into()), 2712 + ) 2713 + })?; 2368 2714 let codec = tonic::codec::ProstCodec::default(); 2369 - let path = 2370 - http::uri::PathAndQuery::from_static("/rockbox.v1alpha1.PlaybackService/HardStop"); 2715 + let path = http::uri::PathAndQuery::from_static( 2716 + "/rockbox.v1alpha1.PlaybackService/HardStop", 2717 + ); 2371 2718 let mut req = request.into_request(); 2372 - req.extensions_mut().insert(GrpcMethod::new( 2373 - "rockbox.v1alpha1.PlaybackService", 2374 - "HardStop", 2375 - )); 2719 + req.extensions_mut() 2720 + .insert(GrpcMethod::new("rockbox.v1alpha1.PlaybackService", "HardStop")); 2376 2721 self.inner.unary(req, path, codec).await 2377 2722 } 2378 2723 pub async fn play_album( 2379 2724 &mut self, 2380 2725 request: impl tonic::IntoRequest<super::PlayAlbumRequest>, 2381 - ) -> std::result::Result<tonic::Response<super::PlayAlbumResponse>, tonic::Status> { 2382 - self.inner.ready().await.map_err(|e| { 2383 - tonic::Status::unknown(format!("Service was not ready: {}", e.into())) 2384 - })?; 2726 + ) -> std::result::Result< 2727 + tonic::Response<super::PlayAlbumResponse>, 2728 + tonic::Status, 2729 + > { 2730 + self.inner 2731 + .ready() 2732 + .await 2733 + .map_err(|e| { 2734 + tonic::Status::unknown( 2735 + format!("Service was not ready: {}", e.into()), 2736 + ) 2737 + })?; 2385 2738 let codec = tonic::codec::ProstCodec::default(); 2386 - let path = 2387 - http::uri::PathAndQuery::from_static("/rockbox.v1alpha1.PlaybackService/PlayAlbum"); 2739 + let path = http::uri::PathAndQuery::from_static( 2740 + "/rockbox.v1alpha1.PlaybackService/PlayAlbum", 2741 + ); 2388 2742 let mut req = request.into_request(); 2389 - req.extensions_mut().insert(GrpcMethod::new( 2390 - "rockbox.v1alpha1.PlaybackService", 2391 - "PlayAlbum", 2392 - )); 2743 + req.extensions_mut() 2744 + .insert( 2745 + GrpcMethod::new("rockbox.v1alpha1.PlaybackService", "PlayAlbum"), 2746 + ); 2393 2747 self.inner.unary(req, path, codec).await 2394 2748 } 2395 2749 pub async fn play_artist_tracks( 2396 2750 &mut self, 2397 2751 request: impl tonic::IntoRequest<super::PlayArtistTracksRequest>, 2398 - ) -> std::result::Result<tonic::Response<super::PlayArtistTracksResponse>, tonic::Status> 2399 - { 2400 - self.inner.ready().await.map_err(|e| { 2401 - tonic::Status::unknown(format!("Service was not ready: {}", e.into())) 2402 - })?; 2752 + ) -> std::result::Result< 2753 + tonic::Response<super::PlayArtistTracksResponse>, 2754 + tonic::Status, 2755 + > { 2756 + self.inner 2757 + .ready() 2758 + .await 2759 + .map_err(|e| { 2760 + tonic::Status::unknown( 2761 + format!("Service was not ready: {}", e.into()), 2762 + ) 2763 + })?; 2403 2764 let codec = tonic::codec::ProstCodec::default(); 2404 2765 let path = http::uri::PathAndQuery::from_static( 2405 2766 "/rockbox.v1alpha1.PlaybackService/PlayArtistTracks", 2406 2767 ); 2407 2768 let mut req = request.into_request(); 2408 - req.extensions_mut().insert(GrpcMethod::new( 2409 - "rockbox.v1alpha1.PlaybackService", 2410 - "PlayArtistTracks", 2411 - )); 2769 + req.extensions_mut() 2770 + .insert( 2771 + GrpcMethod::new( 2772 + "rockbox.v1alpha1.PlaybackService", 2773 + "PlayArtistTracks", 2774 + ), 2775 + ); 2412 2776 self.inner.unary(req, path, codec).await 2413 2777 } 2414 2778 pub async fn play_playlist( 2415 2779 &mut self, 2416 2780 request: impl tonic::IntoRequest<super::PlayPlaylistRequest>, 2417 - ) -> std::result::Result<tonic::Response<super::PlayPlaylistResponse>, tonic::Status> 2418 - { 2419 - self.inner.ready().await.map_err(|e| { 2420 - tonic::Status::unknown(format!("Service was not ready: {}", e.into())) 2421 - })?; 2781 + ) -> std::result::Result< 2782 + tonic::Response<super::PlayPlaylistResponse>, 2783 + tonic::Status, 2784 + > { 2785 + self.inner 2786 + .ready() 2787 + .await 2788 + .map_err(|e| { 2789 + tonic::Status::unknown( 2790 + format!("Service was not ready: {}", e.into()), 2791 + ) 2792 + })?; 2422 2793 let codec = tonic::codec::ProstCodec::default(); 2423 2794 let path = http::uri::PathAndQuery::from_static( 2424 2795 "/rockbox.v1alpha1.PlaybackService/PlayPlaylist", 2425 2796 ); 2426 2797 let mut req = request.into_request(); 2427 - req.extensions_mut().insert(GrpcMethod::new( 2428 - "rockbox.v1alpha1.PlaybackService", 2429 - "PlayPlaylist", 2430 - )); 2798 + req.extensions_mut() 2799 + .insert( 2800 + GrpcMethod::new("rockbox.v1alpha1.PlaybackService", "PlayPlaylist"), 2801 + ); 2431 2802 self.inner.unary(req, path, codec).await 2432 2803 } 2433 2804 pub async fn play_directory( 2434 2805 &mut self, 2435 2806 request: impl tonic::IntoRequest<super::PlayDirectoryRequest>, 2436 - ) -> std::result::Result<tonic::Response<super::PlayDirectoryResponse>, tonic::Status> 2437 - { 2438 - self.inner.ready().await.map_err(|e| { 2439 - tonic::Status::unknown(format!("Service was not ready: {}", e.into())) 2440 - })?; 2807 + ) -> std::result::Result< 2808 + tonic::Response<super::PlayDirectoryResponse>, 2809 + tonic::Status, 2810 + > { 2811 + self.inner 2812 + .ready() 2813 + .await 2814 + .map_err(|e| { 2815 + tonic::Status::unknown( 2816 + format!("Service was not ready: {}", e.into()), 2817 + ) 2818 + })?; 2441 2819 let codec = tonic::codec::ProstCodec::default(); 2442 2820 let path = http::uri::PathAndQuery::from_static( 2443 2821 "/rockbox.v1alpha1.PlaybackService/PlayDirectory", 2444 2822 ); 2445 2823 let mut req = request.into_request(); 2446 - req.extensions_mut().insert(GrpcMethod::new( 2447 - "rockbox.v1alpha1.PlaybackService", 2448 - "PlayDirectory", 2449 - )); 2824 + req.extensions_mut() 2825 + .insert( 2826 + GrpcMethod::new("rockbox.v1alpha1.PlaybackService", "PlayDirectory"), 2827 + ); 2450 2828 self.inner.unary(req, path, codec).await 2451 2829 } 2452 2830 pub async fn play_music_directory( 2453 2831 &mut self, 2454 2832 request: impl tonic::IntoRequest<super::PlayMusicDirectoryRequest>, 2455 - ) -> std::result::Result<tonic::Response<super::PlayMusicDirectoryResponse>, tonic::Status> 2456 - { 2457 - self.inner.ready().await.map_err(|e| { 2458 - tonic::Status::unknown(format!("Service was not ready: {}", e.into())) 2459 - })?; 2833 + ) -> std::result::Result< 2834 + tonic::Response<super::PlayMusicDirectoryResponse>, 2835 + tonic::Status, 2836 + > { 2837 + self.inner 2838 + .ready() 2839 + .await 2840 + .map_err(|e| { 2841 + tonic::Status::unknown( 2842 + format!("Service was not ready: {}", e.into()), 2843 + ) 2844 + })?; 2460 2845 let codec = tonic::codec::ProstCodec::default(); 2461 2846 let path = http::uri::PathAndQuery::from_static( 2462 2847 "/rockbox.v1alpha1.PlaybackService/PlayMusicDirectory", 2463 2848 ); 2464 2849 let mut req = request.into_request(); 2465 - req.extensions_mut().insert(GrpcMethod::new( 2466 - "rockbox.v1alpha1.PlaybackService", 2467 - "PlayMusicDirectory", 2468 - )); 2850 + req.extensions_mut() 2851 + .insert( 2852 + GrpcMethod::new( 2853 + "rockbox.v1alpha1.PlaybackService", 2854 + "PlayMusicDirectory", 2855 + ), 2856 + ); 2469 2857 self.inner.unary(req, path, codec).await 2470 2858 } 2471 2859 pub async fn play_track( 2472 2860 &mut self, 2473 2861 request: impl tonic::IntoRequest<super::PlayTrackRequest>, 2474 - ) -> std::result::Result<tonic::Response<super::PlayTrackResponse>, tonic::Status> { 2475 - self.inner.ready().await.map_err(|e| { 2476 - tonic::Status::unknown(format!("Service was not ready: {}", e.into())) 2477 - })?; 2862 + ) -> std::result::Result< 2863 + tonic::Response<super::PlayTrackResponse>, 2864 + tonic::Status, 2865 + > { 2866 + self.inner 2867 + .ready() 2868 + .await 2869 + .map_err(|e| { 2870 + tonic::Status::unknown( 2871 + format!("Service was not ready: {}", e.into()), 2872 + ) 2873 + })?; 2478 2874 let codec = tonic::codec::ProstCodec::default(); 2479 - let path = 2480 - http::uri::PathAndQuery::from_static("/rockbox.v1alpha1.PlaybackService/PlayTrack"); 2875 + let path = http::uri::PathAndQuery::from_static( 2876 + "/rockbox.v1alpha1.PlaybackService/PlayTrack", 2877 + ); 2481 2878 let mut req = request.into_request(); 2482 - req.extensions_mut().insert(GrpcMethod::new( 2483 - "rockbox.v1alpha1.PlaybackService", 2484 - "PlayTrack", 2485 - )); 2879 + req.extensions_mut() 2880 + .insert( 2881 + GrpcMethod::new("rockbox.v1alpha1.PlaybackService", "PlayTrack"), 2882 + ); 2486 2883 self.inner.unary(req, path, codec).await 2487 2884 } 2488 2885 pub async fn play_liked_tracks( 2489 2886 &mut self, 2490 2887 request: impl tonic::IntoRequest<super::PlayLikedTracksRequest>, 2491 - ) -> std::result::Result<tonic::Response<super::PlayLikedTracksResponse>, tonic::Status> 2492 - { 2493 - self.inner.ready().await.map_err(|e| { 2494 - tonic::Status::unknown(format!("Service was not ready: {}", e.into())) 2495 - })?; 2888 + ) -> std::result::Result< 2889 + tonic::Response<super::PlayLikedTracksResponse>, 2890 + tonic::Status, 2891 + > { 2892 + self.inner 2893 + .ready() 2894 + .await 2895 + .map_err(|e| { 2896 + tonic::Status::unknown( 2897 + format!("Service was not ready: {}", e.into()), 2898 + ) 2899 + })?; 2496 2900 let codec = tonic::codec::ProstCodec::default(); 2497 2901 let path = http::uri::PathAndQuery::from_static( 2498 2902 "/rockbox.v1alpha1.PlaybackService/PlayLikedTracks", 2499 2903 ); 2500 2904 let mut req = request.into_request(); 2501 - req.extensions_mut().insert(GrpcMethod::new( 2502 - "rockbox.v1alpha1.PlaybackService", 2503 - "PlayLikedTracks", 2504 - )); 2905 + req.extensions_mut() 2906 + .insert( 2907 + GrpcMethod::new( 2908 + "rockbox.v1alpha1.PlaybackService", 2909 + "PlayLikedTracks", 2910 + ), 2911 + ); 2505 2912 self.inner.unary(req, path, codec).await 2506 2913 } 2507 2914 pub async fn play_all_tracks( 2508 2915 &mut self, 2509 2916 request: impl tonic::IntoRequest<super::PlayAllTracksRequest>, 2510 - ) -> std::result::Result<tonic::Response<super::PlayAllTracksResponse>, tonic::Status> 2511 - { 2512 - self.inner.ready().await.map_err(|e| { 2513 - tonic::Status::unknown(format!("Service was not ready: {}", e.into())) 2514 - })?; 2917 + ) -> std::result::Result< 2918 + tonic::Response<super::PlayAllTracksResponse>, 2919 + tonic::Status, 2920 + > { 2921 + self.inner 2922 + .ready() 2923 + .await 2924 + .map_err(|e| { 2925 + tonic::Status::unknown( 2926 + format!("Service was not ready: {}", e.into()), 2927 + ) 2928 + })?; 2515 2929 let codec = tonic::codec::ProstCodec::default(); 2516 2930 let path = http::uri::PathAndQuery::from_static( 2517 2931 "/rockbox.v1alpha1.PlaybackService/PlayAllTracks", 2518 2932 ); 2519 2933 let mut req = request.into_request(); 2520 - req.extensions_mut().insert(GrpcMethod::new( 2521 - "rockbox.v1alpha1.PlaybackService", 2522 - "PlayAllTracks", 2523 - )); 2934 + req.extensions_mut() 2935 + .insert( 2936 + GrpcMethod::new("rockbox.v1alpha1.PlaybackService", "PlayAllTracks"), 2937 + ); 2524 2938 self.inner.unary(req, path, codec).await 2525 2939 } 2526 2940 pub async fn stream_current_track( ··· 2530 2944 tonic::Response<tonic::codec::Streaming<super::CurrentTrackResponse>>, 2531 2945 tonic::Status, 2532 2946 > { 2533 - self.inner.ready().await.map_err(|e| { 2534 - tonic::Status::unknown(format!("Service was not ready: {}", e.into())) 2535 - })?; 2947 + self.inner 2948 + .ready() 2949 + .await 2950 + .map_err(|e| { 2951 + tonic::Status::unknown( 2952 + format!("Service was not ready: {}", e.into()), 2953 + ) 2954 + })?; 2536 2955 let codec = tonic::codec::ProstCodec::default(); 2537 2956 let path = http::uri::PathAndQuery::from_static( 2538 2957 "/rockbox.v1alpha1.PlaybackService/StreamCurrentTrack", 2539 2958 ); 2540 2959 let mut req = request.into_request(); 2541 - req.extensions_mut().insert(GrpcMethod::new( 2542 - "rockbox.v1alpha1.PlaybackService", 2543 - "StreamCurrentTrack", 2544 - )); 2960 + req.extensions_mut() 2961 + .insert( 2962 + GrpcMethod::new( 2963 + "rockbox.v1alpha1.PlaybackService", 2964 + "StreamCurrentTrack", 2965 + ), 2966 + ); 2545 2967 self.inner.server_streaming(req, path, codec).await 2546 2968 } 2547 2969 pub async fn stream_status( ··· 2551 2973 tonic::Response<tonic::codec::Streaming<super::StatusResponse>>, 2552 2974 tonic::Status, 2553 2975 > { 2554 - self.inner.ready().await.map_err(|e| { 2555 - tonic::Status::unknown(format!("Service was not ready: {}", e.into())) 2556 - })?; 2976 + self.inner 2977 + .ready() 2978 + .await 2979 + .map_err(|e| { 2980 + tonic::Status::unknown( 2981 + format!("Service was not ready: {}", e.into()), 2982 + ) 2983 + })?; 2557 2984 let codec = tonic::codec::ProstCodec::default(); 2558 2985 let path = http::uri::PathAndQuery::from_static( 2559 2986 "/rockbox.v1alpha1.PlaybackService/StreamStatus", 2560 2987 ); 2561 2988 let mut req = request.into_request(); 2562 - req.extensions_mut().insert(GrpcMethod::new( 2563 - "rockbox.v1alpha1.PlaybackService", 2564 - "StreamStatus", 2565 - )); 2989 + req.extensions_mut() 2990 + .insert( 2991 + GrpcMethod::new("rockbox.v1alpha1.PlaybackService", "StreamStatus"), 2992 + ); 2566 2993 self.inner.server_streaming(req, path, codec).await 2567 2994 } 2568 2995 pub async fn stream_playlist( ··· 2572 2999 tonic::Response<tonic::codec::Streaming<super::PlaylistResponse>>, 2573 3000 tonic::Status, 2574 3001 > { 2575 - self.inner.ready().await.map_err(|e| { 2576 - tonic::Status::unknown(format!("Service was not ready: {}", e.into())) 2577 - })?; 3002 + self.inner 3003 + .ready() 3004 + .await 3005 + .map_err(|e| { 3006 + tonic::Status::unknown( 3007 + format!("Service was not ready: {}", e.into()), 3008 + ) 3009 + })?; 2578 3010 let codec = tonic::codec::ProstCodec::default(); 2579 3011 let path = http::uri::PathAndQuery::from_static( 2580 3012 "/rockbox.v1alpha1.PlaybackService/StreamPlaylist", 2581 3013 ); 2582 3014 let mut req = request.into_request(); 2583 - req.extensions_mut().insert(GrpcMethod::new( 2584 - "rockbox.v1alpha1.PlaybackService", 2585 - "StreamPlaylist", 2586 - )); 3015 + req.extensions_mut() 3016 + .insert( 3017 + GrpcMethod::new("rockbox.v1alpha1.PlaybackService", "StreamPlaylist"), 3018 + ); 2587 3019 self.inner.server_streaming(req, path, codec).await 2588 3020 } 2589 3021 } ··· 2595 3027 dead_code, 2596 3028 missing_docs, 2597 3029 clippy::wildcard_imports, 2598 - clippy::let_unit_value 3030 + clippy::let_unit_value, 2599 3031 )] 2600 3032 use tonic::codegen::*; 2601 3033 /// Generated trait containing gRPC methods that should be implemented for use with PlaybackServiceServer. ··· 2612 3044 async fn play_or_pause( 2613 3045 &self, 2614 3046 request: tonic::Request<super::PlayOrPauseRequest>, 2615 - ) -> std::result::Result<tonic::Response<super::PlayOrPauseResponse>, tonic::Status>; 3047 + ) -> std::result::Result< 3048 + tonic::Response<super::PlayOrPauseResponse>, 3049 + tonic::Status, 3050 + >; 2616 3051 async fn resume( 2617 3052 &self, 2618 3053 request: tonic::Request<super::ResumeRequest>, ··· 2624 3059 async fn previous( 2625 3060 &self, 2626 3061 request: tonic::Request<super::PreviousRequest>, 2627 - ) -> std::result::Result<tonic::Response<super::PreviousResponse>, tonic::Status>; 3062 + ) -> std::result::Result< 3063 + tonic::Response<super::PreviousResponse>, 3064 + tonic::Status, 3065 + >; 2628 3066 async fn fast_forward_rewind( 2629 3067 &self, 2630 3068 request: tonic::Request<super::FastForwardRewindRequest>, 2631 - ) -> std::result::Result<tonic::Response<super::FastForwardRewindResponse>, tonic::Status>; 3069 + ) -> std::result::Result< 3070 + tonic::Response<super::FastForwardRewindResponse>, 3071 + tonic::Status, 3072 + >; 2632 3073 async fn status( 2633 3074 &self, 2634 3075 request: tonic::Request<super::StatusRequest>, ··· 2636 3077 async fn current_track( 2637 3078 &self, 2638 3079 request: tonic::Request<super::CurrentTrackRequest>, 2639 - ) -> std::result::Result<tonic::Response<super::CurrentTrackResponse>, tonic::Status>; 3080 + ) -> std::result::Result< 3081 + tonic::Response<super::CurrentTrackResponse>, 3082 + tonic::Status, 3083 + >; 2640 3084 async fn next_track( 2641 3085 &self, 2642 3086 request: tonic::Request<super::NextTrackRequest>, 2643 - ) -> std::result::Result<tonic::Response<super::NextTrackResponse>, tonic::Status>; 3087 + ) -> std::result::Result< 3088 + tonic::Response<super::NextTrackResponse>, 3089 + tonic::Status, 3090 + >; 2644 3091 async fn flush_and_reload_tracks( 2645 3092 &self, 2646 3093 request: tonic::Request<super::FlushAndReloadTracksRequest>, 2647 - ) -> std::result::Result<tonic::Response<super::FlushAndReloadTracksResponse>, tonic::Status>; 3094 + ) -> std::result::Result< 3095 + tonic::Response<super::FlushAndReloadTracksResponse>, 3096 + tonic::Status, 3097 + >; 2648 3098 async fn get_file_position( 2649 3099 &self, 2650 3100 request: tonic::Request<super::GetFilePositionRequest>, 2651 - ) -> std::result::Result<tonic::Response<super::GetFilePositionResponse>, tonic::Status>; 3101 + ) -> std::result::Result< 3102 + tonic::Response<super::GetFilePositionResponse>, 3103 + tonic::Status, 3104 + >; 2652 3105 async fn hard_stop( 2653 3106 &self, 2654 3107 request: tonic::Request<super::HardStopRequest>, 2655 - ) -> std::result::Result<tonic::Response<super::HardStopResponse>, tonic::Status>; 3108 + ) -> std::result::Result< 3109 + tonic::Response<super::HardStopResponse>, 3110 + tonic::Status, 3111 + >; 2656 3112 async fn play_album( 2657 3113 &self, 2658 3114 request: tonic::Request<super::PlayAlbumRequest>, 2659 - ) -> std::result::Result<tonic::Response<super::PlayAlbumResponse>, tonic::Status>; 3115 + ) -> std::result::Result< 3116 + tonic::Response<super::PlayAlbumResponse>, 3117 + tonic::Status, 3118 + >; 2660 3119 async fn play_artist_tracks( 2661 3120 &self, 2662 3121 request: tonic::Request<super::PlayArtistTracksRequest>, 2663 - ) -> std::result::Result<tonic::Response<super::PlayArtistTracksResponse>, tonic::Status>; 3122 + ) -> std::result::Result< 3123 + tonic::Response<super::PlayArtistTracksResponse>, 3124 + tonic::Status, 3125 + >; 2664 3126 async fn play_playlist( 2665 3127 &self, 2666 3128 request: tonic::Request<super::PlayPlaylistRequest>, 2667 - ) -> std::result::Result<tonic::Response<super::PlayPlaylistResponse>, tonic::Status>; 3129 + ) -> std::result::Result< 3130 + tonic::Response<super::PlayPlaylistResponse>, 3131 + tonic::Status, 3132 + >; 2668 3133 async fn play_directory( 2669 3134 &self, 2670 3135 request: tonic::Request<super::PlayDirectoryRequest>, 2671 - ) -> std::result::Result<tonic::Response<super::PlayDirectoryResponse>, tonic::Status>; 3136 + ) -> std::result::Result< 3137 + tonic::Response<super::PlayDirectoryResponse>, 3138 + tonic::Status, 3139 + >; 2672 3140 async fn play_music_directory( 2673 3141 &self, 2674 3142 request: tonic::Request<super::PlayMusicDirectoryRequest>, 2675 - ) -> std::result::Result<tonic::Response<super::PlayMusicDirectoryResponse>, tonic::Status>; 3143 + ) -> std::result::Result< 3144 + tonic::Response<super::PlayMusicDirectoryResponse>, 3145 + tonic::Status, 3146 + >; 2676 3147 async fn play_track( 2677 3148 &self, 2678 3149 request: tonic::Request<super::PlayTrackRequest>, 2679 - ) -> std::result::Result<tonic::Response<super::PlayTrackResponse>, tonic::Status>; 3150 + ) -> std::result::Result< 3151 + tonic::Response<super::PlayTrackResponse>, 3152 + tonic::Status, 3153 + >; 2680 3154 async fn play_liked_tracks( 2681 3155 &self, 2682 3156 request: tonic::Request<super::PlayLikedTracksRequest>, 2683 - ) -> std::result::Result<tonic::Response<super::PlayLikedTracksResponse>, tonic::Status>; 3157 + ) -> std::result::Result< 3158 + tonic::Response<super::PlayLikedTracksResponse>, 3159 + tonic::Status, 3160 + >; 2684 3161 async fn play_all_tracks( 2685 3162 &self, 2686 3163 request: tonic::Request<super::PlayAllTracksRequest>, 2687 - ) -> std::result::Result<tonic::Response<super::PlayAllTracksResponse>, tonic::Status>; 3164 + ) -> std::result::Result< 3165 + tonic::Response<super::PlayAllTracksResponse>, 3166 + tonic::Status, 3167 + >; 2688 3168 /// Server streaming response type for the StreamCurrentTrack method. 2689 3169 type StreamCurrentTrackStream: tonic::codegen::tokio_stream::Stream< 2690 3170 Item = std::result::Result<super::CurrentTrackResponse, tonic::Status>, 2691 - > + std::marker::Send 3171 + > 3172 + + std::marker::Send 2692 3173 + 'static; 2693 3174 async fn stream_current_track( 2694 3175 &self, 2695 3176 request: tonic::Request<super::StreamCurrentTrackRequest>, 2696 - ) -> std::result::Result<tonic::Response<Self::StreamCurrentTrackStream>, tonic::Status>; 3177 + ) -> std::result::Result< 3178 + tonic::Response<Self::StreamCurrentTrackStream>, 3179 + tonic::Status, 3180 + >; 2697 3181 /// Server streaming response type for the StreamStatus method. 2698 3182 type StreamStatusStream: tonic::codegen::tokio_stream::Stream< 2699 3183 Item = std::result::Result<super::StatusResponse, tonic::Status>, 2700 - > + std::marker::Send 3184 + > 3185 + + std::marker::Send 2701 3186 + 'static; 2702 3187 async fn stream_status( 2703 3188 &self, 2704 3189 request: tonic::Request<super::StreamStatusRequest>, 2705 - ) -> std::result::Result<tonic::Response<Self::StreamStatusStream>, tonic::Status>; 3190 + ) -> std::result::Result< 3191 + tonic::Response<Self::StreamStatusStream>, 3192 + tonic::Status, 3193 + >; 2706 3194 /// Server streaming response type for the StreamPlaylist method. 2707 3195 type StreamPlaylistStream: tonic::codegen::tokio_stream::Stream< 2708 3196 Item = std::result::Result<super::PlaylistResponse, tonic::Status>, 2709 - > + std::marker::Send 3197 + > 3198 + + std::marker::Send 2710 3199 + 'static; 2711 3200 async fn stream_playlist( 2712 3201 &self, 2713 3202 request: tonic::Request<super::StreamPlaylistRequest>, 2714 - ) -> std::result::Result<tonic::Response<Self::StreamPlaylistStream>, tonic::Status>; 3203 + ) -> std::result::Result< 3204 + tonic::Response<Self::StreamPlaylistStream>, 3205 + tonic::Status, 3206 + >; 2715 3207 } 2716 3208 #[derive(Debug)] 2717 3209 pub struct PlaybackServiceServer<T> { ··· 2734 3226 max_encoding_message_size: None, 2735 3227 } 2736 3228 } 2737 - pub fn with_interceptor<F>(inner: T, interceptor: F) -> InterceptedService<Self, F> 3229 + pub fn with_interceptor<F>( 3230 + inner: T, 3231 + interceptor: F, 3232 + ) -> InterceptedService<Self, F> 2738 3233 where 2739 3234 F: tonic::service::Interceptor, 2740 3235 { ··· 2789 3284 "/rockbox.v1alpha1.PlaybackService/Play" => { 2790 3285 #[allow(non_camel_case_types)] 2791 3286 struct PlaySvc<T: PlaybackService>(pub Arc<T>); 2792 - impl<T: PlaybackService> tonic::server::UnaryService<super::PlayRequest> for PlaySvc<T> { 3287 + impl< 3288 + T: PlaybackService, 3289 + > tonic::server::UnaryService<super::PlayRequest> for PlaySvc<T> { 2793 3290 type Response = super::PlayResponse; 2794 - type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>; 3291 + type Future = BoxFuture< 3292 + tonic::Response<Self::Response>, 3293 + tonic::Status, 3294 + >; 2795 3295 fn call( 2796 3296 &mut self, 2797 3297 request: tonic::Request<super::PlayRequest>, 2798 3298 ) -> Self::Future { 2799 3299 let inner = Arc::clone(&self.0); 2800 - let fut = 2801 - async move { <T as PlaybackService>::play(&inner, request).await }; 3300 + let fut = async move { 3301 + <T as PlaybackService>::play(&inner, request).await 3302 + }; 2802 3303 Box::pin(fut) 2803 3304 } 2804 3305 } ··· 2827 3328 "/rockbox.v1alpha1.PlaybackService/Pause" => { 2828 3329 #[allow(non_camel_case_types)] 2829 3330 struct PauseSvc<T: PlaybackService>(pub Arc<T>); 2830 - impl<T: PlaybackService> tonic::server::UnaryService<super::PauseRequest> for PauseSvc<T> { 3331 + impl< 3332 + T: PlaybackService, 3333 + > tonic::server::UnaryService<super::PauseRequest> for PauseSvc<T> { 2831 3334 type Response = super::PauseResponse; 2832 - type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>; 3335 + type Future = BoxFuture< 3336 + tonic::Response<Self::Response>, 3337 + tonic::Status, 3338 + >; 2833 3339 fn call( 2834 3340 &mut self, 2835 3341 request: tonic::Request<super::PauseRequest>, 2836 3342 ) -> Self::Future { 2837 3343 let inner = Arc::clone(&self.0); 2838 - let fut = 2839 - async move { <T as PlaybackService>::pause(&inner, request).await }; 3344 + let fut = async move { 3345 + <T as PlaybackService>::pause(&inner, request).await 3346 + }; 2840 3347 Box::pin(fut) 2841 3348 } 2842 3349 } ··· 2865 3372 "/rockbox.v1alpha1.PlaybackService/PlayOrPause" => { 2866 3373 #[allow(non_camel_case_types)] 2867 3374 struct PlayOrPauseSvc<T: PlaybackService>(pub Arc<T>); 2868 - impl<T: PlaybackService> tonic::server::UnaryService<super::PlayOrPauseRequest> 2869 - for PlayOrPauseSvc<T> 2870 - { 3375 + impl< 3376 + T: PlaybackService, 3377 + > tonic::server::UnaryService<super::PlayOrPauseRequest> 3378 + for PlayOrPauseSvc<T> { 2871 3379 type Response = super::PlayOrPauseResponse; 2872 - type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>; 3380 + type Future = BoxFuture< 3381 + tonic::Response<Self::Response>, 3382 + tonic::Status, 3383 + >; 2873 3384 fn call( 2874 3385 &mut self, 2875 3386 request: tonic::Request<super::PlayOrPauseRequest>, ··· 2906 3417 "/rockbox.v1alpha1.PlaybackService/Resume" => { 2907 3418 #[allow(non_camel_case_types)] 2908 3419 struct ResumeSvc<T: PlaybackService>(pub Arc<T>); 2909 - impl<T: PlaybackService> tonic::server::UnaryService<super::ResumeRequest> for ResumeSvc<T> { 3420 + impl< 3421 + T: PlaybackService, 3422 + > tonic::server::UnaryService<super::ResumeRequest> 3423 + for ResumeSvc<T> { 2910 3424 type Response = super::ResumeResponse; 2911 - type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>; 3425 + type Future = BoxFuture< 3426 + tonic::Response<Self::Response>, 3427 + tonic::Status, 3428 + >; 2912 3429 fn call( 2913 3430 &mut self, 2914 3431 request: tonic::Request<super::ResumeRequest>, ··· 2945 3462 "/rockbox.v1alpha1.PlaybackService/Next" => { 2946 3463 #[allow(non_camel_case_types)] 2947 3464 struct NextSvc<T: PlaybackService>(pub Arc<T>); 2948 - impl<T: PlaybackService> tonic::server::UnaryService<super::NextRequest> for NextSvc<T> { 3465 + impl< 3466 + T: PlaybackService, 3467 + > tonic::server::UnaryService<super::NextRequest> for NextSvc<T> { 2949 3468 type Response = super::NextResponse; 2950 - type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>; 3469 + type Future = BoxFuture< 3470 + tonic::Response<Self::Response>, 3471 + tonic::Status, 3472 + >; 2951 3473 fn call( 2952 3474 &mut self, 2953 3475 request: tonic::Request<super::NextRequest>, 2954 3476 ) -> Self::Future { 2955 3477 let inner = Arc::clone(&self.0); 2956 - let fut = 2957 - async move { <T as PlaybackService>::next(&inner, request).await }; 3478 + let fut = async move { 3479 + <T as PlaybackService>::next(&inner, request).await 3480 + }; 2958 3481 Box::pin(fut) 2959 3482 } 2960 3483 } ··· 2983 3506 "/rockbox.v1alpha1.PlaybackService/Previous" => { 2984 3507 #[allow(non_camel_case_types)] 2985 3508 struct PreviousSvc<T: PlaybackService>(pub Arc<T>); 2986 - impl<T: PlaybackService> tonic::server::UnaryService<super::PreviousRequest> for PreviousSvc<T> { 3509 + impl< 3510 + T: PlaybackService, 3511 + > tonic::server::UnaryService<super::PreviousRequest> 3512 + for PreviousSvc<T> { 2987 3513 type Response = super::PreviousResponse; 2988 - type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>; 3514 + type Future = BoxFuture< 3515 + tonic::Response<Self::Response>, 3516 + tonic::Status, 3517 + >; 2989 3518 fn call( 2990 3519 &mut self, 2991 3520 request: tonic::Request<super::PreviousRequest>, ··· 3022 3551 "/rockbox.v1alpha1.PlaybackService/FastForwardRewind" => { 3023 3552 #[allow(non_camel_case_types)] 3024 3553 struct FastForwardRewindSvc<T: PlaybackService>(pub Arc<T>); 3025 - impl<T: PlaybackService> 3026 - tonic::server::UnaryService<super::FastForwardRewindRequest> 3027 - for FastForwardRewindSvc<T> 3028 - { 3554 + impl< 3555 + T: PlaybackService, 3556 + > tonic::server::UnaryService<super::FastForwardRewindRequest> 3557 + for FastForwardRewindSvc<T> { 3029 3558 type Response = super::FastForwardRewindResponse; 3030 - type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>; 3559 + type Future = BoxFuture< 3560 + tonic::Response<Self::Response>, 3561 + tonic::Status, 3562 + >; 3031 3563 fn call( 3032 3564 &mut self, 3033 3565 request: tonic::Request<super::FastForwardRewindRequest>, 3034 3566 ) -> Self::Future { 3035 3567 let inner = Arc::clone(&self.0); 3036 3568 let fut = async move { 3037 - <T as PlaybackService>::fast_forward_rewind(&inner, request).await 3569 + <T as PlaybackService>::fast_forward_rewind(&inner, request) 3570 + .await 3038 3571 }; 3039 3572 Box::pin(fut) 3040 3573 } ··· 3064 3597 "/rockbox.v1alpha1.PlaybackService/Status" => { 3065 3598 #[allow(non_camel_case_types)] 3066 3599 struct StatusSvc<T: PlaybackService>(pub Arc<T>); 3067 - impl<T: PlaybackService> tonic::server::UnaryService<super::StatusRequest> for StatusSvc<T> { 3600 + impl< 3601 + T: PlaybackService, 3602 + > tonic::server::UnaryService<super::StatusRequest> 3603 + for StatusSvc<T> { 3068 3604 type Response = super::StatusResponse; 3069 - type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>; 3605 + type Future = BoxFuture< 3606 + tonic::Response<Self::Response>, 3607 + tonic::Status, 3608 + >; 3070 3609 fn call( 3071 3610 &mut self, 3072 3611 request: tonic::Request<super::StatusRequest>, ··· 3103 3642 "/rockbox.v1alpha1.PlaybackService/CurrentTrack" => { 3104 3643 #[allow(non_camel_case_types)] 3105 3644 struct CurrentTrackSvc<T: PlaybackService>(pub Arc<T>); 3106 - impl<T: PlaybackService> tonic::server::UnaryService<super::CurrentTrackRequest> 3107 - for CurrentTrackSvc<T> 3108 - { 3645 + impl< 3646 + T: PlaybackService, 3647 + > tonic::server::UnaryService<super::CurrentTrackRequest> 3648 + for CurrentTrackSvc<T> { 3109 3649 type Response = super::CurrentTrackResponse; 3110 - type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>; 3650 + type Future = BoxFuture< 3651 + tonic::Response<Self::Response>, 3652 + tonic::Status, 3653 + >; 3111 3654 fn call( 3112 3655 &mut self, 3113 3656 request: tonic::Request<super::CurrentTrackRequest>, ··· 3144 3687 "/rockbox.v1alpha1.PlaybackService/NextTrack" => { 3145 3688 #[allow(non_camel_case_types)] 3146 3689 struct NextTrackSvc<T: PlaybackService>(pub Arc<T>); 3147 - impl<T: PlaybackService> tonic::server::UnaryService<super::NextTrackRequest> for NextTrackSvc<T> { 3690 + impl< 3691 + T: PlaybackService, 3692 + > tonic::server::UnaryService<super::NextTrackRequest> 3693 + for NextTrackSvc<T> { 3148 3694 type Response = super::NextTrackResponse; 3149 - type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>; 3695 + type Future = BoxFuture< 3696 + tonic::Response<Self::Response>, 3697 + tonic::Status, 3698 + >; 3150 3699 fn call( 3151 3700 &mut self, 3152 3701 request: tonic::Request<super::NextTrackRequest>, ··· 3183 3732 "/rockbox.v1alpha1.PlaybackService/FlushAndReloadTracks" => { 3184 3733 #[allow(non_camel_case_types)] 3185 3734 struct FlushAndReloadTracksSvc<T: PlaybackService>(pub Arc<T>); 3186 - impl<T: PlaybackService> 3187 - tonic::server::UnaryService<super::FlushAndReloadTracksRequest> 3188 - for FlushAndReloadTracksSvc<T> 3189 - { 3735 + impl< 3736 + T: PlaybackService, 3737 + > tonic::server::UnaryService<super::FlushAndReloadTracksRequest> 3738 + for FlushAndReloadTracksSvc<T> { 3190 3739 type Response = super::FlushAndReloadTracksResponse; 3191 - type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>; 3740 + type Future = BoxFuture< 3741 + tonic::Response<Self::Response>, 3742 + tonic::Status, 3743 + >; 3192 3744 fn call( 3193 3745 &mut self, 3194 3746 request: tonic::Request<super::FlushAndReloadTracksRequest>, 3195 3747 ) -> Self::Future { 3196 3748 let inner = Arc::clone(&self.0); 3197 3749 let fut = async move { 3198 - <T as PlaybackService>::flush_and_reload_tracks(&inner, request) 3750 + <T as PlaybackService>::flush_and_reload_tracks( 3751 + &inner, 3752 + request, 3753 + ) 3199 3754 .await 3200 3755 }; 3201 3756 Box::pin(fut) ··· 3226 3781 "/rockbox.v1alpha1.PlaybackService/GetFilePosition" => { 3227 3782 #[allow(non_camel_case_types)] 3228 3783 struct GetFilePositionSvc<T: PlaybackService>(pub Arc<T>); 3229 - impl<T: PlaybackService> 3230 - tonic::server::UnaryService<super::GetFilePositionRequest> 3231 - for GetFilePositionSvc<T> 3232 - { 3784 + impl< 3785 + T: PlaybackService, 3786 + > tonic::server::UnaryService<super::GetFilePositionRequest> 3787 + for GetFilePositionSvc<T> { 3233 3788 type Response = super::GetFilePositionResponse; 3234 - type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>; 3789 + type Future = BoxFuture< 3790 + tonic::Response<Self::Response>, 3791 + tonic::Status, 3792 + >; 3235 3793 fn call( 3236 3794 &mut self, 3237 3795 request: tonic::Request<super::GetFilePositionRequest>, 3238 3796 ) -> Self::Future { 3239 3797 let inner = Arc::clone(&self.0); 3240 3798 let fut = async move { 3241 - <T as PlaybackService>::get_file_position(&inner, request).await 3799 + <T as PlaybackService>::get_file_position(&inner, request) 3800 + .await 3242 3801 }; 3243 3802 Box::pin(fut) 3244 3803 } ··· 3268 3827 "/rockbox.v1alpha1.PlaybackService/HardStop" => { 3269 3828 #[allow(non_camel_case_types)] 3270 3829 struct HardStopSvc<T: PlaybackService>(pub Arc<T>); 3271 - impl<T: PlaybackService> tonic::server::UnaryService<super::HardStopRequest> for HardStopSvc<T> { 3830 + impl< 3831 + T: PlaybackService, 3832 + > tonic::server::UnaryService<super::HardStopRequest> 3833 + for HardStopSvc<T> { 3272 3834 type Response = super::HardStopResponse; 3273 - type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>; 3835 + type Future = BoxFuture< 3836 + tonic::Response<Self::Response>, 3837 + tonic::Status, 3838 + >; 3274 3839 fn call( 3275 3840 &mut self, 3276 3841 request: tonic::Request<super::HardStopRequest>, ··· 3307 3872 "/rockbox.v1alpha1.PlaybackService/PlayAlbum" => { 3308 3873 #[allow(non_camel_case_types)] 3309 3874 struct PlayAlbumSvc<T: PlaybackService>(pub Arc<T>); 3310 - impl<T: PlaybackService> tonic::server::UnaryService<super::PlayAlbumRequest> for PlayAlbumSvc<T> { 3875 + impl< 3876 + T: PlaybackService, 3877 + > tonic::server::UnaryService<super::PlayAlbumRequest> 3878 + for PlayAlbumSvc<T> { 3311 3879 type Response = super::PlayAlbumResponse; 3312 - type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>; 3880 + type Future = BoxFuture< 3881 + tonic::Response<Self::Response>, 3882 + tonic::Status, 3883 + >; 3313 3884 fn call( 3314 3885 &mut self, 3315 3886 request: tonic::Request<super::PlayAlbumRequest>, ··· 3346 3917 "/rockbox.v1alpha1.PlaybackService/PlayArtistTracks" => { 3347 3918 #[allow(non_camel_case_types)] 3348 3919 struct PlayArtistTracksSvc<T: PlaybackService>(pub Arc<T>); 3349 - impl<T: PlaybackService> 3350 - tonic::server::UnaryService<super::PlayArtistTracksRequest> 3351 - for PlayArtistTracksSvc<T> 3352 - { 3920 + impl< 3921 + T: PlaybackService, 3922 + > tonic::server::UnaryService<super::PlayArtistTracksRequest> 3923 + for PlayArtistTracksSvc<T> { 3353 3924 type Response = super::PlayArtistTracksResponse; 3354 - type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>; 3925 + type Future = BoxFuture< 3926 + tonic::Response<Self::Response>, 3927 + tonic::Status, 3928 + >; 3355 3929 fn call( 3356 3930 &mut self, 3357 3931 request: tonic::Request<super::PlayArtistTracksRequest>, 3358 3932 ) -> Self::Future { 3359 3933 let inner = Arc::clone(&self.0); 3360 3934 let fut = async move { 3361 - <T as PlaybackService>::play_artist_tracks(&inner, request).await 3935 + <T as PlaybackService>::play_artist_tracks(&inner, request) 3936 + .await 3362 3937 }; 3363 3938 Box::pin(fut) 3364 3939 } ··· 3388 3963 "/rockbox.v1alpha1.PlaybackService/PlayPlaylist" => { 3389 3964 #[allow(non_camel_case_types)] 3390 3965 struct PlayPlaylistSvc<T: PlaybackService>(pub Arc<T>); 3391 - impl<T: PlaybackService> tonic::server::UnaryService<super::PlayPlaylistRequest> 3392 - for PlayPlaylistSvc<T> 3393 - { 3966 + impl< 3967 + T: PlaybackService, 3968 + > tonic::server::UnaryService<super::PlayPlaylistRequest> 3969 + for PlayPlaylistSvc<T> { 3394 3970 type Response = super::PlayPlaylistResponse; 3395 - type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>; 3971 + type Future = BoxFuture< 3972 + tonic::Response<Self::Response>, 3973 + tonic::Status, 3974 + >; 3396 3975 fn call( 3397 3976 &mut self, 3398 3977 request: tonic::Request<super::PlayPlaylistRequest>, ··· 3429 4008 "/rockbox.v1alpha1.PlaybackService/PlayDirectory" => { 3430 4009 #[allow(non_camel_case_types)] 3431 4010 struct PlayDirectorySvc<T: PlaybackService>(pub Arc<T>); 3432 - impl<T: PlaybackService> 3433 - tonic::server::UnaryService<super::PlayDirectoryRequest> 3434 - for PlayDirectorySvc<T> 3435 - { 4011 + impl< 4012 + T: PlaybackService, 4013 + > tonic::server::UnaryService<super::PlayDirectoryRequest> 4014 + for PlayDirectorySvc<T> { 3436 4015 type Response = super::PlayDirectoryResponse; 3437 - type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>; 4016 + type Future = BoxFuture< 4017 + tonic::Response<Self::Response>, 4018 + tonic::Status, 4019 + >; 3438 4020 fn call( 3439 4021 &mut self, 3440 4022 request: tonic::Request<super::PlayDirectoryRequest>, 3441 4023 ) -> Self::Future { 3442 4024 let inner = Arc::clone(&self.0); 3443 4025 let fut = async move { 3444 - <T as PlaybackService>::play_directory(&inner, request).await 4026 + <T as PlaybackService>::play_directory(&inner, request) 4027 + .await 3445 4028 }; 3446 4029 Box::pin(fut) 3447 4030 } ··· 3471 4054 "/rockbox.v1alpha1.PlaybackService/PlayMusicDirectory" => { 3472 4055 #[allow(non_camel_case_types)] 3473 4056 struct PlayMusicDirectorySvc<T: PlaybackService>(pub Arc<T>); 3474 - impl<T: PlaybackService> 3475 - tonic::server::UnaryService<super::PlayMusicDirectoryRequest> 3476 - for PlayMusicDirectorySvc<T> 3477 - { 4057 + impl< 4058 + T: PlaybackService, 4059 + > tonic::server::UnaryService<super::PlayMusicDirectoryRequest> 4060 + for PlayMusicDirectorySvc<T> { 3478 4061 type Response = super::PlayMusicDirectoryResponse; 3479 - type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>; 4062 + type Future = BoxFuture< 4063 + tonic::Response<Self::Response>, 4064 + tonic::Status, 4065 + >; 3480 4066 fn call( 3481 4067 &mut self, 3482 4068 request: tonic::Request<super::PlayMusicDirectoryRequest>, 3483 4069 ) -> Self::Future { 3484 4070 let inner = Arc::clone(&self.0); 3485 4071 let fut = async move { 3486 - <T as PlaybackService>::play_music_directory(&inner, request).await 4072 + <T as PlaybackService>::play_music_directory( 4073 + &inner, 4074 + request, 4075 + ) 4076 + .await 3487 4077 }; 3488 4078 Box::pin(fut) 3489 4079 } ··· 3513 4103 "/rockbox.v1alpha1.PlaybackService/PlayTrack" => { 3514 4104 #[allow(non_camel_case_types)] 3515 4105 struct PlayTrackSvc<T: PlaybackService>(pub Arc<T>); 3516 - impl<T: PlaybackService> tonic::server::UnaryService<super::PlayTrackRequest> for PlayTrackSvc<T> { 4106 + impl< 4107 + T: PlaybackService, 4108 + > tonic::server::UnaryService<super::PlayTrackRequest> 4109 + for PlayTrackSvc<T> { 3517 4110 type Response = super::PlayTrackResponse; 3518 - type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>; 4111 + type Future = BoxFuture< 4112 + tonic::Response<Self::Response>, 4113 + tonic::Status, 4114 + >; 3519 4115 fn call( 3520 4116 &mut self, 3521 4117 request: tonic::Request<super::PlayTrackRequest>, ··· 3552 4148 "/rockbox.v1alpha1.PlaybackService/PlayLikedTracks" => { 3553 4149 #[allow(non_camel_case_types)] 3554 4150 struct PlayLikedTracksSvc<T: PlaybackService>(pub Arc<T>); 3555 - impl<T: PlaybackService> 3556 - tonic::server::UnaryService<super::PlayLikedTracksRequest> 3557 - for PlayLikedTracksSvc<T> 3558 - { 4151 + impl< 4152 + T: PlaybackService, 4153 + > tonic::server::UnaryService<super::PlayLikedTracksRequest> 4154 + for PlayLikedTracksSvc<T> { 3559 4155 type Response = super::PlayLikedTracksResponse; 3560 - type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>; 4156 + type Future = BoxFuture< 4157 + tonic::Response<Self::Response>, 4158 + tonic::Status, 4159 + >; 3561 4160 fn call( 3562 4161 &mut self, 3563 4162 request: tonic::Request<super::PlayLikedTracksRequest>, 3564 4163 ) -> Self::Future { 3565 4164 let inner = Arc::clone(&self.0); 3566 4165 let fut = async move { 3567 - <T as PlaybackService>::play_liked_tracks(&inner, request).await 4166 + <T as PlaybackService>::play_liked_tracks(&inner, request) 4167 + .await 3568 4168 }; 3569 4169 Box::pin(fut) 3570 4170 } ··· 3594 4194 "/rockbox.v1alpha1.PlaybackService/PlayAllTracks" => { 3595 4195 #[allow(non_camel_case_types)] 3596 4196 struct PlayAllTracksSvc<T: PlaybackService>(pub Arc<T>); 3597 - impl<T: PlaybackService> 3598 - tonic::server::UnaryService<super::PlayAllTracksRequest> 3599 - for PlayAllTracksSvc<T> 3600 - { 4197 + impl< 4198 + T: PlaybackService, 4199 + > tonic::server::UnaryService<super::PlayAllTracksRequest> 4200 + for PlayAllTracksSvc<T> { 3601 4201 type Response = super::PlayAllTracksResponse; 3602 - type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>; 4202 + type Future = BoxFuture< 4203 + tonic::Response<Self::Response>, 4204 + tonic::Status, 4205 + >; 3603 4206 fn call( 3604 4207 &mut self, 3605 4208 request: tonic::Request<super::PlayAllTracksRequest>, 3606 4209 ) -> Self::Future { 3607 4210 let inner = Arc::clone(&self.0); 3608 4211 let fut = async move { 3609 - <T as PlaybackService>::play_all_tracks(&inner, request).await 4212 + <T as PlaybackService>::play_all_tracks(&inner, request) 4213 + .await 3610 4214 }; 3611 4215 Box::pin(fut) 3612 4216 } ··· 3636 4240 "/rockbox.v1alpha1.PlaybackService/StreamCurrentTrack" => { 3637 4241 #[allow(non_camel_case_types)] 3638 4242 struct StreamCurrentTrackSvc<T: PlaybackService>(pub Arc<T>); 3639 - impl<T: PlaybackService> 3640 - tonic::server::ServerStreamingService<super::StreamCurrentTrackRequest> 3641 - for StreamCurrentTrackSvc<T> 3642 - { 4243 + impl< 4244 + T: PlaybackService, 4245 + > tonic::server::ServerStreamingService< 4246 + super::StreamCurrentTrackRequest, 4247 + > for StreamCurrentTrackSvc<T> { 3643 4248 type Response = super::CurrentTrackResponse; 3644 4249 type ResponseStream = T::StreamCurrentTrackStream; 3645 - type Future = 3646 - BoxFuture<tonic::Response<Self::ResponseStream>, tonic::Status>; 4250 + type Future = BoxFuture< 4251 + tonic::Response<Self::ResponseStream>, 4252 + tonic::Status, 4253 + >; 3647 4254 fn call( 3648 4255 &mut self, 3649 4256 request: tonic::Request<super::StreamCurrentTrackRequest>, 3650 4257 ) -> Self::Future { 3651 4258 let inner = Arc::clone(&self.0); 3652 4259 let fut = async move { 3653 - <T as PlaybackService>::stream_current_track(&inner, request).await 4260 + <T as PlaybackService>::stream_current_track( 4261 + &inner, 4262 + request, 4263 + ) 4264 + .await 3654 4265 }; 3655 4266 Box::pin(fut) 3656 4267 } ··· 3680 4291 "/rockbox.v1alpha1.PlaybackService/StreamStatus" => { 3681 4292 #[allow(non_camel_case_types)] 3682 4293 struct StreamStatusSvc<T: PlaybackService>(pub Arc<T>); 3683 - impl<T: PlaybackService> 3684 - tonic::server::ServerStreamingService<super::StreamStatusRequest> 3685 - for StreamStatusSvc<T> 3686 - { 4294 + impl< 4295 + T: PlaybackService, 4296 + > tonic::server::ServerStreamingService<super::StreamStatusRequest> 4297 + for StreamStatusSvc<T> { 3687 4298 type Response = super::StatusResponse; 3688 4299 type ResponseStream = T::StreamStatusStream; 3689 - type Future = 3690 - BoxFuture<tonic::Response<Self::ResponseStream>, tonic::Status>; 4300 + type Future = BoxFuture< 4301 + tonic::Response<Self::ResponseStream>, 4302 + tonic::Status, 4303 + >; 3691 4304 fn call( 3692 4305 &mut self, 3693 4306 request: tonic::Request<super::StreamStatusRequest>, ··· 3724 4337 "/rockbox.v1alpha1.PlaybackService/StreamPlaylist" => { 3725 4338 #[allow(non_camel_case_types)] 3726 4339 struct StreamPlaylistSvc<T: PlaybackService>(pub Arc<T>); 3727 - impl<T: PlaybackService> 3728 - tonic::server::ServerStreamingService<super::StreamPlaylistRequest> 3729 - for StreamPlaylistSvc<T> 3730 - { 4340 + impl< 4341 + T: PlaybackService, 4342 + > tonic::server::ServerStreamingService<super::StreamPlaylistRequest> 4343 + for StreamPlaylistSvc<T> { 3731 4344 type Response = super::PlaylistResponse; 3732 4345 type ResponseStream = T::StreamPlaylistStream; 3733 - type Future = 3734 - BoxFuture<tonic::Response<Self::ResponseStream>, tonic::Status>; 4346 + type Future = BoxFuture< 4347 + tonic::Response<Self::ResponseStream>, 4348 + tonic::Status, 4349 + >; 3735 4350 fn call( 3736 4351 &mut self, 3737 4352 request: tonic::Request<super::StreamPlaylistRequest>, 3738 4353 ) -> Self::Future { 3739 4354 let inner = Arc::clone(&self.0); 3740 4355 let fut = async move { 3741 - <T as PlaybackService>::stream_playlist(&inner, request).await 4356 + <T as PlaybackService>::stream_playlist(&inner, request) 4357 + .await 3742 4358 }; 3743 4359 Box::pin(fut) 3744 4360 } ··· 3765 4381 }; 3766 4382 Box::pin(fut) 3767 4383 } 3768 - _ => Box::pin(async move { 3769 - let mut response = http::Response::new(empty_body()); 3770 - let headers = response.headers_mut(); 3771 - headers.insert( 3772 - tonic::Status::GRPC_STATUS, 3773 - (tonic::Code::Unimplemented as i32).into(), 3774 - ); 3775 - headers.insert( 3776 - http::header::CONTENT_TYPE, 3777 - tonic::metadata::GRPC_CONTENT_TYPE, 3778 - ); 3779 - Ok(response) 3780 - }), 4384 + _ => { 4385 + Box::pin(async move { 4386 + let mut response = http::Response::new(empty_body()); 4387 + let headers = response.headers_mut(); 4388 + headers 4389 + .insert( 4390 + tonic::Status::GRPC_STATUS, 4391 + (tonic::Code::Unimplemented as i32).into(), 4392 + ); 4393 + headers 4394 + .insert( 4395 + http::header::CONTENT_TYPE, 4396 + tonic::metadata::GRPC_CONTENT_TYPE, 4397 + ); 4398 + Ok(response) 4399 + }) 4400 + } 3781 4401 } 3782 4402 } 3783 4403 } ··· 3984 4604 dead_code, 3985 4605 missing_docs, 3986 4606 clippy::wildcard_imports, 3987 - clippy::let_unit_value 4607 + clippy::let_unit_value, 3988 4608 )] 3989 - use tonic::codegen::http::Uri; 3990 4609 use tonic::codegen::*; 4610 + use tonic::codegen::http::Uri; 3991 4611 #[derive(Debug, Clone)] 3992 4612 pub struct PlaylistServiceClient<T> { 3993 4613 inner: tonic::client::Grpc<T>, ··· 4031 4651 <T as tonic::client::GrpcService<tonic::body::BoxBody>>::ResponseBody, 4032 4652 >, 4033 4653 >, 4034 - <T as tonic::codegen::Service<http::Request<tonic::body::BoxBody>>>::Error: 4035 - Into<StdError> + std::marker::Send + std::marker::Sync, 4654 + <T as tonic::codegen::Service< 4655 + http::Request<tonic::body::BoxBody>, 4656 + >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync, 4036 4657 { 4037 4658 PlaylistServiceClient::new(InterceptedService::new(inner, interceptor)) 4038 4659 } ··· 4070 4691 pub async fn get_current( 4071 4692 &mut self, 4072 4693 request: impl tonic::IntoRequest<super::GetCurrentRequest>, 4073 - ) -> std::result::Result<tonic::Response<super::GetCurrentResponse>, tonic::Status> 4074 - { 4075 - self.inner.ready().await.map_err(|e| { 4076 - tonic::Status::unknown(format!("Service was not ready: {}", e.into())) 4077 - })?; 4694 + ) -> std::result::Result< 4695 + tonic::Response<super::GetCurrentResponse>, 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 + })?; 4078 4706 let codec = tonic::codec::ProstCodec::default(); 4079 4707 let path = http::uri::PathAndQuery::from_static( 4080 4708 "/rockbox.v1alpha1.PlaylistService/GetCurrent", 4081 4709 ); 4082 4710 let mut req = request.into_request(); 4083 - req.extensions_mut().insert(GrpcMethod::new( 4084 - "rockbox.v1alpha1.PlaylistService", 4085 - "GetCurrent", 4086 - )); 4711 + req.extensions_mut() 4712 + .insert( 4713 + GrpcMethod::new("rockbox.v1alpha1.PlaylistService", "GetCurrent"), 4714 + ); 4087 4715 self.inner.unary(req, path, codec).await 4088 4716 } 4089 4717 pub async fn get_resume_info( 4090 4718 &mut self, 4091 4719 request: impl tonic::IntoRequest<super::GetResumeInfoRequest>, 4092 - ) -> std::result::Result<tonic::Response<super::GetResumeInfoResponse>, tonic::Status> 4093 - { 4094 - self.inner.ready().await.map_err(|e| { 4095 - tonic::Status::unknown(format!("Service was not ready: {}", e.into())) 4096 - })?; 4720 + ) -> std::result::Result< 4721 + tonic::Response<super::GetResumeInfoResponse>, 4722 + tonic::Status, 4723 + > { 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 + })?; 4097 4732 let codec = tonic::codec::ProstCodec::default(); 4098 4733 let path = http::uri::PathAndQuery::from_static( 4099 4734 "/rockbox.v1alpha1.PlaylistService/GetResumeInfo", 4100 4735 ); 4101 4736 let mut req = request.into_request(); 4102 - req.extensions_mut().insert(GrpcMethod::new( 4103 - "rockbox.v1alpha1.PlaylistService", 4104 - "GetResumeInfo", 4105 - )); 4737 + req.extensions_mut() 4738 + .insert( 4739 + GrpcMethod::new("rockbox.v1alpha1.PlaylistService", "GetResumeInfo"), 4740 + ); 4106 4741 self.inner.unary(req, path, codec).await 4107 4742 } 4108 4743 pub async fn get_track_info( 4109 4744 &mut self, 4110 4745 request: impl tonic::IntoRequest<super::GetTrackInfoRequest>, 4111 - ) -> std::result::Result<tonic::Response<super::GetTrackInfoResponse>, tonic::Status> 4112 - { 4113 - self.inner.ready().await.map_err(|e| { 4114 - tonic::Status::unknown(format!("Service was not ready: {}", e.into())) 4115 - })?; 4746 + ) -> std::result::Result< 4747 + tonic::Response<super::GetTrackInfoResponse>, 4748 + tonic::Status, 4749 + > { 4750 + self.inner 4751 + .ready() 4752 + .await 4753 + .map_err(|e| { 4754 + tonic::Status::unknown( 4755 + format!("Service was not ready: {}", e.into()), 4756 + ) 4757 + })?; 4116 4758 let codec = tonic::codec::ProstCodec::default(); 4117 4759 let path = http::uri::PathAndQuery::from_static( 4118 4760 "/rockbox.v1alpha1.PlaylistService/GetTrackInfo", 4119 4761 ); 4120 4762 let mut req = request.into_request(); 4121 - req.extensions_mut().insert(GrpcMethod::new( 4122 - "rockbox.v1alpha1.PlaylistService", 4123 - "GetTrackInfo", 4124 - )); 4763 + req.extensions_mut() 4764 + .insert( 4765 + GrpcMethod::new("rockbox.v1alpha1.PlaylistService", "GetTrackInfo"), 4766 + ); 4125 4767 self.inner.unary(req, path, codec).await 4126 4768 } 4127 4769 pub async fn get_first_index( 4128 4770 &mut self, 4129 4771 request: impl tonic::IntoRequest<super::GetFirstIndexRequest>, 4130 - ) -> std::result::Result<tonic::Response<super::GetFirstIndexResponse>, tonic::Status> 4131 - { 4132 - self.inner.ready().await.map_err(|e| { 4133 - tonic::Status::unknown(format!("Service was not ready: {}", e.into())) 4134 - })?; 4772 + ) -> std::result::Result< 4773 + tonic::Response<super::GetFirstIndexResponse>, 4774 + tonic::Status, 4775 + > { 4776 + self.inner 4777 + .ready() 4778 + .await 4779 + .map_err(|e| { 4780 + tonic::Status::unknown( 4781 + format!("Service was not ready: {}", e.into()), 4782 + ) 4783 + })?; 4135 4784 let codec = tonic::codec::ProstCodec::default(); 4136 4785 let path = http::uri::PathAndQuery::from_static( 4137 4786 "/rockbox.v1alpha1.PlaylistService/GetFirstIndex", 4138 4787 ); 4139 4788 let mut req = request.into_request(); 4140 - req.extensions_mut().insert(GrpcMethod::new( 4141 - "rockbox.v1alpha1.PlaylistService", 4142 - "GetFirstIndex", 4143 - )); 4789 + req.extensions_mut() 4790 + .insert( 4791 + GrpcMethod::new("rockbox.v1alpha1.PlaylistService", "GetFirstIndex"), 4792 + ); 4144 4793 self.inner.unary(req, path, codec).await 4145 4794 } 4146 4795 pub async fn get_display_index( 4147 4796 &mut self, 4148 4797 request: impl tonic::IntoRequest<super::GetDisplayIndexRequest>, 4149 - ) -> std::result::Result<tonic::Response<super::GetDisplayIndexResponse>, tonic::Status> 4150 - { 4151 - self.inner.ready().await.map_err(|e| { 4152 - tonic::Status::unknown(format!("Service was not ready: {}", e.into())) 4153 - })?; 4798 + ) -> std::result::Result< 4799 + tonic::Response<super::GetDisplayIndexResponse>, 4800 + tonic::Status, 4801 + > { 4802 + self.inner 4803 + .ready() 4804 + .await 4805 + .map_err(|e| { 4806 + tonic::Status::unknown( 4807 + format!("Service was not ready: {}", e.into()), 4808 + ) 4809 + })?; 4154 4810 let codec = tonic::codec::ProstCodec::default(); 4155 4811 let path = http::uri::PathAndQuery::from_static( 4156 4812 "/rockbox.v1alpha1.PlaylistService/GetDisplayIndex", 4157 4813 ); 4158 4814 let mut req = request.into_request(); 4159 - req.extensions_mut().insert(GrpcMethod::new( 4160 - "rockbox.v1alpha1.PlaylistService", 4161 - "GetDisplayIndex", 4162 - )); 4815 + req.extensions_mut() 4816 + .insert( 4817 + GrpcMethod::new( 4818 + "rockbox.v1alpha1.PlaylistService", 4819 + "GetDisplayIndex", 4820 + ), 4821 + ); 4163 4822 self.inner.unary(req, path, codec).await 4164 4823 } 4165 4824 pub async fn amount( 4166 4825 &mut self, 4167 4826 request: impl tonic::IntoRequest<super::AmountRequest>, 4168 4827 ) -> std::result::Result<tonic::Response<super::AmountResponse>, tonic::Status> { 4169 - self.inner.ready().await.map_err(|e| { 4170 - tonic::Status::unknown(format!("Service was not ready: {}", e.into())) 4171 - })?; 4828 + self.inner 4829 + .ready() 4830 + .await 4831 + .map_err(|e| { 4832 + tonic::Status::unknown( 4833 + format!("Service was not ready: {}", e.into()), 4834 + ) 4835 + })?; 4172 4836 let codec = tonic::codec::ProstCodec::default(); 4173 - let path = 4174 - http::uri::PathAndQuery::from_static("/rockbox.v1alpha1.PlaylistService/Amount"); 4837 + let path = http::uri::PathAndQuery::from_static( 4838 + "/rockbox.v1alpha1.PlaylistService/Amount", 4839 + ); 4175 4840 let mut req = request.into_request(); 4176 - req.extensions_mut().insert(GrpcMethod::new( 4177 - "rockbox.v1alpha1.PlaylistService", 4178 - "Amount", 4179 - )); 4841 + req.extensions_mut() 4842 + .insert(GrpcMethod::new("rockbox.v1alpha1.PlaylistService", "Amount")); 4180 4843 self.inner.unary(req, path, codec).await 4181 4844 } 4182 4845 pub async fn playlist_resume( 4183 4846 &mut self, 4184 4847 request: impl tonic::IntoRequest<super::PlaylistResumeRequest>, 4185 - ) -> std::result::Result<tonic::Response<super::PlaylistResumeResponse>, tonic::Status> 4186 - { 4187 - self.inner.ready().await.map_err(|e| { 4188 - tonic::Status::unknown(format!("Service was not ready: {}", e.into())) 4189 - })?; 4848 + ) -> std::result::Result< 4849 + tonic::Response<super::PlaylistResumeResponse>, 4850 + tonic::Status, 4851 + > { 4852 + self.inner 4853 + .ready() 4854 + .await 4855 + .map_err(|e| { 4856 + tonic::Status::unknown( 4857 + format!("Service was not ready: {}", e.into()), 4858 + ) 4859 + })?; 4190 4860 let codec = tonic::codec::ProstCodec::default(); 4191 4861 let path = http::uri::PathAndQuery::from_static( 4192 4862 "/rockbox.v1alpha1.PlaylistService/PlaylistResume", 4193 4863 ); 4194 4864 let mut req = request.into_request(); 4195 - req.extensions_mut().insert(GrpcMethod::new( 4196 - "rockbox.v1alpha1.PlaylistService", 4197 - "PlaylistResume", 4198 - )); 4865 + req.extensions_mut() 4866 + .insert( 4867 + GrpcMethod::new("rockbox.v1alpha1.PlaylistService", "PlaylistResume"), 4868 + ); 4199 4869 self.inner.unary(req, path, codec).await 4200 4870 } 4201 4871 pub async fn resume_track( 4202 4872 &mut self, 4203 4873 request: impl tonic::IntoRequest<super::ResumeTrackRequest>, 4204 - ) -> std::result::Result<tonic::Response<super::ResumeTrackResponse>, tonic::Status> 4205 - { 4206 - self.inner.ready().await.map_err(|e| { 4207 - tonic::Status::unknown(format!("Service was not ready: {}", e.into())) 4208 - })?; 4874 + ) -> std::result::Result< 4875 + tonic::Response<super::ResumeTrackResponse>, 4876 + tonic::Status, 4877 + > { 4878 + self.inner 4879 + .ready() 4880 + .await 4881 + .map_err(|e| { 4882 + tonic::Status::unknown( 4883 + format!("Service was not ready: {}", e.into()), 4884 + ) 4885 + })?; 4209 4886 let codec = tonic::codec::ProstCodec::default(); 4210 4887 let path = http::uri::PathAndQuery::from_static( 4211 4888 "/rockbox.v1alpha1.PlaylistService/ResumeTrack", 4212 4889 ); 4213 4890 let mut req = request.into_request(); 4214 - req.extensions_mut().insert(GrpcMethod::new( 4215 - "rockbox.v1alpha1.PlaylistService", 4216 - "ResumeTrack", 4217 - )); 4891 + req.extensions_mut() 4892 + .insert( 4893 + GrpcMethod::new("rockbox.v1alpha1.PlaylistService", "ResumeTrack"), 4894 + ); 4218 4895 self.inner.unary(req, path, codec).await 4219 4896 } 4220 4897 pub async fn set_modified( 4221 4898 &mut self, 4222 4899 request: impl tonic::IntoRequest<super::SetModifiedRequest>, 4223 - ) -> std::result::Result<tonic::Response<super::SetModifiedResponse>, tonic::Status> 4224 - { 4225 - self.inner.ready().await.map_err(|e| { 4226 - tonic::Status::unknown(format!("Service was not ready: {}", e.into())) 4227 - })?; 4900 + ) -> std::result::Result< 4901 + tonic::Response<super::SetModifiedResponse>, 4902 + tonic::Status, 4903 + > { 4904 + self.inner 4905 + .ready() 4906 + .await 4907 + .map_err(|e| { 4908 + tonic::Status::unknown( 4909 + format!("Service was not ready: {}", e.into()), 4910 + ) 4911 + })?; 4228 4912 let codec = tonic::codec::ProstCodec::default(); 4229 4913 let path = http::uri::PathAndQuery::from_static( 4230 4914 "/rockbox.v1alpha1.PlaylistService/SetModified", 4231 4915 ); 4232 4916 let mut req = request.into_request(); 4233 - req.extensions_mut().insert(GrpcMethod::new( 4234 - "rockbox.v1alpha1.PlaylistService", 4235 - "SetModified", 4236 - )); 4917 + req.extensions_mut() 4918 + .insert( 4919 + GrpcMethod::new("rockbox.v1alpha1.PlaylistService", "SetModified"), 4920 + ); 4237 4921 self.inner.unary(req, path, codec).await 4238 4922 } 4239 4923 pub async fn start( 4240 4924 &mut self, 4241 4925 request: impl tonic::IntoRequest<super::StartRequest>, 4242 4926 ) -> std::result::Result<tonic::Response<super::StartResponse>, tonic::Status> { 4243 - self.inner.ready().await.map_err(|e| { 4244 - tonic::Status::unknown(format!("Service was not ready: {}", e.into())) 4245 - })?; 4927 + self.inner 4928 + .ready() 4929 + .await 4930 + .map_err(|e| { 4931 + tonic::Status::unknown( 4932 + format!("Service was not ready: {}", e.into()), 4933 + ) 4934 + })?; 4246 4935 let codec = tonic::codec::ProstCodec::default(); 4247 - let path = 4248 - http::uri::PathAndQuery::from_static("/rockbox.v1alpha1.PlaylistService/Start"); 4936 + let path = http::uri::PathAndQuery::from_static( 4937 + "/rockbox.v1alpha1.PlaylistService/Start", 4938 + ); 4249 4939 let mut req = request.into_request(); 4250 4940 req.extensions_mut() 4251 4941 .insert(GrpcMethod::new("rockbox.v1alpha1.PlaylistService", "Start")); ··· 4255 4945 &mut self, 4256 4946 request: impl tonic::IntoRequest<super::SyncRequest>, 4257 4947 ) -> std::result::Result<tonic::Response<super::SyncResponse>, tonic::Status> { 4258 - self.inner.ready().await.map_err(|e| { 4259 - tonic::Status::unknown(format!("Service was not ready: {}", e.into())) 4260 - })?; 4948 + self.inner 4949 + .ready() 4950 + .await 4951 + .map_err(|e| { 4952 + tonic::Status::unknown( 4953 + format!("Service was not ready: {}", e.into()), 4954 + ) 4955 + })?; 4261 4956 let codec = tonic::codec::ProstCodec::default(); 4262 - let path = 4263 - http::uri::PathAndQuery::from_static("/rockbox.v1alpha1.PlaylistService/Sync"); 4957 + let path = http::uri::PathAndQuery::from_static( 4958 + "/rockbox.v1alpha1.PlaylistService/Sync", 4959 + ); 4264 4960 let mut req = request.into_request(); 4265 4961 req.extensions_mut() 4266 4962 .insert(GrpcMethod::new("rockbox.v1alpha1.PlaylistService", "Sync")); ··· 4269 4965 pub async fn remove_all_tracks( 4270 4966 &mut self, 4271 4967 request: impl tonic::IntoRequest<super::RemoveAllTracksRequest>, 4272 - ) -> std::result::Result<tonic::Response<super::RemoveAllTracksResponse>, tonic::Status> 4273 - { 4274 - self.inner.ready().await.map_err(|e| { 4275 - tonic::Status::unknown(format!("Service was not ready: {}", e.into())) 4276 - })?; 4968 + ) -> std::result::Result< 4969 + tonic::Response<super::RemoveAllTracksResponse>, 4970 + tonic::Status, 4971 + > { 4972 + self.inner 4973 + .ready() 4974 + .await 4975 + .map_err(|e| { 4976 + tonic::Status::unknown( 4977 + format!("Service was not ready: {}", e.into()), 4978 + ) 4979 + })?; 4277 4980 let codec = tonic::codec::ProstCodec::default(); 4278 4981 let path = http::uri::PathAndQuery::from_static( 4279 4982 "/rockbox.v1alpha1.PlaylistService/RemoveAllTracks", 4280 4983 ); 4281 4984 let mut req = request.into_request(); 4282 - req.extensions_mut().insert(GrpcMethod::new( 4283 - "rockbox.v1alpha1.PlaylistService", 4284 - "RemoveAllTracks", 4285 - )); 4985 + req.extensions_mut() 4986 + .insert( 4987 + GrpcMethod::new( 4988 + "rockbox.v1alpha1.PlaylistService", 4989 + "RemoveAllTracks", 4990 + ), 4991 + ); 4286 4992 self.inner.unary(req, path, codec).await 4287 4993 } 4288 4994 pub async fn remove_tracks( 4289 4995 &mut self, 4290 4996 request: impl tonic::IntoRequest<super::RemoveTracksRequest>, 4291 - ) -> std::result::Result<tonic::Response<super::RemoveTracksResponse>, tonic::Status> 4292 - { 4293 - self.inner.ready().await.map_err(|e| { 4294 - tonic::Status::unknown(format!("Service was not ready: {}", e.into())) 4295 - })?; 4997 + ) -> std::result::Result< 4998 + tonic::Response<super::RemoveTracksResponse>, 4999 + tonic::Status, 5000 + > { 5001 + self.inner 5002 + .ready() 5003 + .await 5004 + .map_err(|e| { 5005 + tonic::Status::unknown( 5006 + format!("Service was not ready: {}", e.into()), 5007 + ) 5008 + })?; 4296 5009 let codec = tonic::codec::ProstCodec::default(); 4297 5010 let path = http::uri::PathAndQuery::from_static( 4298 5011 "/rockbox.v1alpha1.PlaylistService/RemoveTracks", 4299 5012 ); 4300 5013 let mut req = request.into_request(); 4301 - req.extensions_mut().insert(GrpcMethod::new( 4302 - "rockbox.v1alpha1.PlaylistService", 4303 - "RemoveTracks", 4304 - )); 5014 + req.extensions_mut() 5015 + .insert( 5016 + GrpcMethod::new("rockbox.v1alpha1.PlaylistService", "RemoveTracks"), 5017 + ); 4305 5018 self.inner.unary(req, path, codec).await 4306 5019 } 4307 5020 pub async fn create_playlist( 4308 5021 &mut self, 4309 5022 request: impl tonic::IntoRequest<super::CreatePlaylistRequest>, 4310 - ) -> std::result::Result<tonic::Response<super::CreatePlaylistResponse>, tonic::Status> 4311 - { 4312 - self.inner.ready().await.map_err(|e| { 4313 - tonic::Status::unknown(format!("Service was not ready: {}", e.into())) 4314 - })?; 5023 + ) -> std::result::Result< 5024 + tonic::Response<super::CreatePlaylistResponse>, 5025 + tonic::Status, 5026 + > { 5027 + self.inner 5028 + .ready() 5029 + .await 5030 + .map_err(|e| { 5031 + tonic::Status::unknown( 5032 + format!("Service was not ready: {}", e.into()), 5033 + ) 5034 + })?; 4315 5035 let codec = tonic::codec::ProstCodec::default(); 4316 5036 let path = http::uri::PathAndQuery::from_static( 4317 5037 "/rockbox.v1alpha1.PlaylistService/CreatePlaylist", 4318 5038 ); 4319 5039 let mut req = request.into_request(); 4320 - req.extensions_mut().insert(GrpcMethod::new( 4321 - "rockbox.v1alpha1.PlaylistService", 4322 - "CreatePlaylist", 4323 - )); 5040 + req.extensions_mut() 5041 + .insert( 5042 + GrpcMethod::new("rockbox.v1alpha1.PlaylistService", "CreatePlaylist"), 5043 + ); 4324 5044 self.inner.unary(req, path, codec).await 4325 5045 } 4326 5046 pub async fn insert_tracks( 4327 5047 &mut self, 4328 5048 request: impl tonic::IntoRequest<super::InsertTracksRequest>, 4329 - ) -> std::result::Result<tonic::Response<super::InsertTracksResponse>, tonic::Status> 4330 - { 4331 - self.inner.ready().await.map_err(|e| { 4332 - tonic::Status::unknown(format!("Service was not ready: {}", e.into())) 4333 - })?; 5049 + ) -> std::result::Result< 5050 + tonic::Response<super::InsertTracksResponse>, 5051 + tonic::Status, 5052 + > { 5053 + self.inner 5054 + .ready() 5055 + .await 5056 + .map_err(|e| { 5057 + tonic::Status::unknown( 5058 + format!("Service was not ready: {}", e.into()), 5059 + ) 5060 + })?; 4334 5061 let codec = tonic::codec::ProstCodec::default(); 4335 5062 let path = http::uri::PathAndQuery::from_static( 4336 5063 "/rockbox.v1alpha1.PlaylistService/InsertTracks", 4337 5064 ); 4338 5065 let mut req = request.into_request(); 4339 - req.extensions_mut().insert(GrpcMethod::new( 4340 - "rockbox.v1alpha1.PlaylistService", 4341 - "InsertTracks", 4342 - )); 5066 + req.extensions_mut() 5067 + .insert( 5068 + GrpcMethod::new("rockbox.v1alpha1.PlaylistService", "InsertTracks"), 5069 + ); 4343 5070 self.inner.unary(req, path, codec).await 4344 5071 } 4345 5072 pub async fn insert_directory( 4346 5073 &mut self, 4347 5074 request: impl tonic::IntoRequest<super::InsertDirectoryRequest>, 4348 - ) -> std::result::Result<tonic::Response<super::InsertDirectoryResponse>, tonic::Status> 4349 - { 4350 - self.inner.ready().await.map_err(|e| { 4351 - tonic::Status::unknown(format!("Service was not ready: {}", e.into())) 4352 - })?; 5075 + ) -> std::result::Result< 5076 + tonic::Response<super::InsertDirectoryResponse>, 5077 + tonic::Status, 5078 + > { 5079 + self.inner 5080 + .ready() 5081 + .await 5082 + .map_err(|e| { 5083 + tonic::Status::unknown( 5084 + format!("Service was not ready: {}", e.into()), 5085 + ) 5086 + })?; 4353 5087 let codec = tonic::codec::ProstCodec::default(); 4354 5088 let path = http::uri::PathAndQuery::from_static( 4355 5089 "/rockbox.v1alpha1.PlaylistService/InsertDirectory", 4356 5090 ); 4357 5091 let mut req = request.into_request(); 4358 - req.extensions_mut().insert(GrpcMethod::new( 4359 - "rockbox.v1alpha1.PlaylistService", 4360 - "InsertDirectory", 4361 - )); 5092 + req.extensions_mut() 5093 + .insert( 5094 + GrpcMethod::new( 5095 + "rockbox.v1alpha1.PlaylistService", 5096 + "InsertDirectory", 5097 + ), 5098 + ); 4362 5099 self.inner.unary(req, path, codec).await 4363 5100 } 4364 5101 pub async fn insert_playlist( 4365 5102 &mut self, 4366 5103 request: impl tonic::IntoRequest<super::InsertPlaylistRequest>, 4367 - ) -> std::result::Result<tonic::Response<super::InsertPlaylistResponse>, tonic::Status> 4368 - { 4369 - self.inner.ready().await.map_err(|e| { 4370 - tonic::Status::unknown(format!("Service was not ready: {}", e.into())) 4371 - })?; 5104 + ) -> std::result::Result< 5105 + tonic::Response<super::InsertPlaylistResponse>, 5106 + tonic::Status, 5107 + > { 5108 + self.inner 5109 + .ready() 5110 + .await 5111 + .map_err(|e| { 5112 + tonic::Status::unknown( 5113 + format!("Service was not ready: {}", e.into()), 5114 + ) 5115 + })?; 4372 5116 let codec = tonic::codec::ProstCodec::default(); 4373 5117 let path = http::uri::PathAndQuery::from_static( 4374 5118 "/rockbox.v1alpha1.PlaylistService/InsertPlaylist", 4375 5119 ); 4376 5120 let mut req = request.into_request(); 4377 - req.extensions_mut().insert(GrpcMethod::new( 4378 - "rockbox.v1alpha1.PlaylistService", 4379 - "InsertPlaylist", 4380 - )); 5121 + req.extensions_mut() 5122 + .insert( 5123 + GrpcMethod::new("rockbox.v1alpha1.PlaylistService", "InsertPlaylist"), 5124 + ); 4381 5125 self.inner.unary(req, path, codec).await 4382 5126 } 4383 5127 pub async fn insert_album( 4384 5128 &mut self, 4385 5129 request: impl tonic::IntoRequest<super::InsertAlbumRequest>, 4386 - ) -> std::result::Result<tonic::Response<super::InsertAlbumResponse>, tonic::Status> 4387 - { 4388 - self.inner.ready().await.map_err(|e| { 4389 - tonic::Status::unknown(format!("Service was not ready: {}", e.into())) 4390 - })?; 5130 + ) -> std::result::Result< 5131 + tonic::Response<super::InsertAlbumResponse>, 5132 + tonic::Status, 5133 + > { 5134 + self.inner 5135 + .ready() 5136 + .await 5137 + .map_err(|e| { 5138 + tonic::Status::unknown( 5139 + format!("Service was not ready: {}", e.into()), 5140 + ) 5141 + })?; 4391 5142 let codec = tonic::codec::ProstCodec::default(); 4392 5143 let path = http::uri::PathAndQuery::from_static( 4393 5144 "/rockbox.v1alpha1.PlaylistService/InsertAlbum", 4394 5145 ); 4395 5146 let mut req = request.into_request(); 4396 - req.extensions_mut().insert(GrpcMethod::new( 4397 - "rockbox.v1alpha1.PlaylistService", 4398 - "InsertAlbum", 4399 - )); 5147 + req.extensions_mut() 5148 + .insert( 5149 + GrpcMethod::new("rockbox.v1alpha1.PlaylistService", "InsertAlbum"), 5150 + ); 4400 5151 self.inner.unary(req, path, codec).await 4401 5152 } 4402 5153 pub async fn insert_artist_tracks( 4403 5154 &mut self, 4404 5155 request: impl tonic::IntoRequest<super::InsertArtistTracksRequest>, 4405 - ) -> std::result::Result<tonic::Response<super::InsertArtistTracksResponse>, tonic::Status> 4406 - { 4407 - self.inner.ready().await.map_err(|e| { 4408 - tonic::Status::unknown(format!("Service was not ready: {}", e.into())) 4409 - })?; 5156 + ) -> std::result::Result< 5157 + tonic::Response<super::InsertArtistTracksResponse>, 5158 + tonic::Status, 5159 + > { 5160 + self.inner 5161 + .ready() 5162 + .await 5163 + .map_err(|e| { 5164 + tonic::Status::unknown( 5165 + format!("Service was not ready: {}", e.into()), 5166 + ) 5167 + })?; 4410 5168 let codec = tonic::codec::ProstCodec::default(); 4411 5169 let path = http::uri::PathAndQuery::from_static( 4412 5170 "/rockbox.v1alpha1.PlaylistService/InsertArtistTracks", 4413 5171 ); 4414 5172 let mut req = request.into_request(); 4415 - req.extensions_mut().insert(GrpcMethod::new( 4416 - "rockbox.v1alpha1.PlaylistService", 4417 - "InsertArtistTracks", 4418 - )); 5173 + req.extensions_mut() 5174 + .insert( 5175 + GrpcMethod::new( 5176 + "rockbox.v1alpha1.PlaylistService", 5177 + "InsertArtistTracks", 5178 + ), 5179 + ); 4419 5180 self.inner.unary(req, path, codec).await 4420 5181 } 4421 5182 pub async fn shuffle_playlist( 4422 5183 &mut self, 4423 5184 request: impl tonic::IntoRequest<super::ShufflePlaylistRequest>, 4424 - ) -> std::result::Result<tonic::Response<super::ShufflePlaylistResponse>, tonic::Status> 4425 - { 4426 - self.inner.ready().await.map_err(|e| { 4427 - tonic::Status::unknown(format!("Service was not ready: {}", e.into())) 4428 - })?; 5185 + ) -> std::result::Result< 5186 + tonic::Response<super::ShufflePlaylistResponse>, 5187 + tonic::Status, 5188 + > { 5189 + self.inner 5190 + .ready() 5191 + .await 5192 + .map_err(|e| { 5193 + tonic::Status::unknown( 5194 + format!("Service was not ready: {}", e.into()), 5195 + ) 5196 + })?; 4429 5197 let codec = tonic::codec::ProstCodec::default(); 4430 5198 let path = http::uri::PathAndQuery::from_static( 4431 5199 "/rockbox.v1alpha1.PlaylistService/ShufflePlaylist", 4432 5200 ); 4433 5201 let mut req = request.into_request(); 4434 - req.extensions_mut().insert(GrpcMethod::new( 4435 - "rockbox.v1alpha1.PlaylistService", 4436 - "ShufflePlaylist", 4437 - )); 5202 + req.extensions_mut() 5203 + .insert( 5204 + GrpcMethod::new( 5205 + "rockbox.v1alpha1.PlaylistService", 5206 + "ShufflePlaylist", 5207 + ), 5208 + ); 4438 5209 self.inner.unary(req, path, codec).await 4439 5210 } 4440 5211 } ··· 4446 5217 dead_code, 4447 5218 missing_docs, 4448 5219 clippy::wildcard_imports, 4449 - clippy::let_unit_value 5220 + clippy::let_unit_value, 4450 5221 )] 4451 5222 use tonic::codegen::*; 4452 5223 /// Generated trait containing gRPC methods that should be implemented for use with PlaylistServiceServer. ··· 4455 5226 async fn get_current( 4456 5227 &self, 4457 5228 request: tonic::Request<super::GetCurrentRequest>, 4458 - ) -> std::result::Result<tonic::Response<super::GetCurrentResponse>, tonic::Status>; 5229 + ) -> std::result::Result< 5230 + tonic::Response<super::GetCurrentResponse>, 5231 + tonic::Status, 5232 + >; 4459 5233 async fn get_resume_info( 4460 5234 &self, 4461 5235 request: tonic::Request<super::GetResumeInfoRequest>, 4462 - ) -> std::result::Result<tonic::Response<super::GetResumeInfoResponse>, tonic::Status>; 5236 + ) -> std::result::Result< 5237 + tonic::Response<super::GetResumeInfoResponse>, 5238 + tonic::Status, 5239 + >; 4463 5240 async fn get_track_info( 4464 5241 &self, 4465 5242 request: tonic::Request<super::GetTrackInfoRequest>, 4466 - ) -> std::result::Result<tonic::Response<super::GetTrackInfoResponse>, tonic::Status>; 5243 + ) -> std::result::Result< 5244 + tonic::Response<super::GetTrackInfoResponse>, 5245 + tonic::Status, 5246 + >; 4467 5247 async fn get_first_index( 4468 5248 &self, 4469 5249 request: tonic::Request<super::GetFirstIndexRequest>, 4470 - ) -> std::result::Result<tonic::Response<super::GetFirstIndexResponse>, tonic::Status>; 5250 + ) -> std::result::Result< 5251 + tonic::Response<super::GetFirstIndexResponse>, 5252 + tonic::Status, 5253 + >; 4471 5254 async fn get_display_index( 4472 5255 &self, 4473 5256 request: tonic::Request<super::GetDisplayIndexRequest>, 4474 - ) -> std::result::Result<tonic::Response<super::GetDisplayIndexResponse>, tonic::Status>; 5257 + ) -> std::result::Result< 5258 + tonic::Response<super::GetDisplayIndexResponse>, 5259 + tonic::Status, 5260 + >; 4475 5261 async fn amount( 4476 5262 &self, 4477 5263 request: tonic::Request<super::AmountRequest>, ··· 4479 5265 async fn playlist_resume( 4480 5266 &self, 4481 5267 request: tonic::Request<super::PlaylistResumeRequest>, 4482 - ) -> std::result::Result<tonic::Response<super::PlaylistResumeResponse>, tonic::Status>; 5268 + ) -> std::result::Result< 5269 + tonic::Response<super::PlaylistResumeResponse>, 5270 + tonic::Status, 5271 + >; 4483 5272 async fn resume_track( 4484 5273 &self, 4485 5274 request: tonic::Request<super::ResumeTrackRequest>, 4486 - ) -> std::result::Result<tonic::Response<super::ResumeTrackResponse>, tonic::Status>; 5275 + ) -> std::result::Result< 5276 + tonic::Response<super::ResumeTrackResponse>, 5277 + tonic::Status, 5278 + >; 4487 5279 async fn set_modified( 4488 5280 &self, 4489 5281 request: tonic::Request<super::SetModifiedRequest>, 4490 - ) -> std::result::Result<tonic::Response<super::SetModifiedResponse>, tonic::Status>; 5282 + ) -> std::result::Result< 5283 + tonic::Response<super::SetModifiedResponse>, 5284 + tonic::Status, 5285 + >; 4491 5286 async fn start( 4492 5287 &self, 4493 5288 request: tonic::Request<super::StartRequest>, ··· 4499 5294 async fn remove_all_tracks( 4500 5295 &self, 4501 5296 request: tonic::Request<super::RemoveAllTracksRequest>, 4502 - ) -> std::result::Result<tonic::Response<super::RemoveAllTracksResponse>, tonic::Status>; 5297 + ) -> std::result::Result< 5298 + tonic::Response<super::RemoveAllTracksResponse>, 5299 + tonic::Status, 5300 + >; 4503 5301 async fn remove_tracks( 4504 5302 &self, 4505 5303 request: tonic::Request<super::RemoveTracksRequest>, 4506 - ) -> std::result::Result<tonic::Response<super::RemoveTracksResponse>, tonic::Status>; 5304 + ) -> std::result::Result< 5305 + tonic::Response<super::RemoveTracksResponse>, 5306 + tonic::Status, 5307 + >; 4507 5308 async fn create_playlist( 4508 5309 &self, 4509 5310 request: tonic::Request<super::CreatePlaylistRequest>, 4510 - ) -> std::result::Result<tonic::Response<super::CreatePlaylistResponse>, tonic::Status>; 5311 + ) -> std::result::Result< 5312 + tonic::Response<super::CreatePlaylistResponse>, 5313 + tonic::Status, 5314 + >; 4511 5315 async fn insert_tracks( 4512 5316 &self, 4513 5317 request: tonic::Request<super::InsertTracksRequest>, 4514 - ) -> std::result::Result<tonic::Response<super::InsertTracksResponse>, tonic::Status>; 5318 + ) -> std::result::Result< 5319 + tonic::Response<super::InsertTracksResponse>, 5320 + tonic::Status, 5321 + >; 4515 5322 async fn insert_directory( 4516 5323 &self, 4517 5324 request: tonic::Request<super::InsertDirectoryRequest>, 4518 - ) -> std::result::Result<tonic::Response<super::InsertDirectoryResponse>, tonic::Status>; 5325 + ) -> std::result::Result< 5326 + tonic::Response<super::InsertDirectoryResponse>, 5327 + tonic::Status, 5328 + >; 4519 5329 async fn insert_playlist( 4520 5330 &self, 4521 5331 request: tonic::Request<super::InsertPlaylistRequest>, 4522 - ) -> std::result::Result<tonic::Response<super::InsertPlaylistResponse>, tonic::Status>; 5332 + ) -> std::result::Result< 5333 + tonic::Response<super::InsertPlaylistResponse>, 5334 + tonic::Status, 5335 + >; 4523 5336 async fn insert_album( 4524 5337 &self, 4525 5338 request: tonic::Request<super::InsertAlbumRequest>, 4526 - ) -> std::result::Result<tonic::Response<super::InsertAlbumResponse>, tonic::Status>; 5339 + ) -> std::result::Result< 5340 + tonic::Response<super::InsertAlbumResponse>, 5341 + tonic::Status, 5342 + >; 4527 5343 async fn insert_artist_tracks( 4528 5344 &self, 4529 5345 request: tonic::Request<super::InsertArtistTracksRequest>, 4530 - ) -> std::result::Result<tonic::Response<super::InsertArtistTracksResponse>, tonic::Status>; 5346 + ) -> std::result::Result< 5347 + tonic::Response<super::InsertArtistTracksResponse>, 5348 + tonic::Status, 5349 + >; 4531 5350 async fn shuffle_playlist( 4532 5351 &self, 4533 5352 request: tonic::Request<super::ShufflePlaylistRequest>, 4534 - ) -> std::result::Result<tonic::Response<super::ShufflePlaylistResponse>, tonic::Status>; 5353 + ) -> std::result::Result< 5354 + tonic::Response<super::ShufflePlaylistResponse>, 5355 + tonic::Status, 5356 + >; 4535 5357 } 4536 5358 #[derive(Debug)] 4537 5359 pub struct PlaylistServiceServer<T> { ··· 4554 5376 max_encoding_message_size: None, 4555 5377 } 4556 5378 } 4557 - pub fn with_interceptor<F>(inner: T, interceptor: F) -> InterceptedService<Self, F> 5379 + pub fn with_interceptor<F>( 5380 + inner: T, 5381 + interceptor: F, 5382 + ) -> InterceptedService<Self, F> 4558 5383 where 4559 5384 F: tonic::service::Interceptor, 4560 5385 { ··· 4609 5434 "/rockbox.v1alpha1.PlaylistService/GetCurrent" => { 4610 5435 #[allow(non_camel_case_types)] 4611 5436 struct GetCurrentSvc<T: PlaylistService>(pub Arc<T>); 4612 - impl<T: PlaylistService> tonic::server::UnaryService<super::GetCurrentRequest> 4613 - for GetCurrentSvc<T> 4614 - { 5437 + impl< 5438 + T: PlaylistService, 5439 + > tonic::server::UnaryService<super::GetCurrentRequest> 5440 + for GetCurrentSvc<T> { 4615 5441 type Response = super::GetCurrentResponse; 4616 - type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>; 5442 + type Future = BoxFuture< 5443 + tonic::Response<Self::Response>, 5444 + tonic::Status, 5445 + >; 4617 5446 fn call( 4618 5447 &mut self, 4619 5448 request: tonic::Request<super::GetCurrentRequest>, ··· 4650 5479 "/rockbox.v1alpha1.PlaylistService/GetResumeInfo" => { 4651 5480 #[allow(non_camel_case_types)] 4652 5481 struct GetResumeInfoSvc<T: PlaylistService>(pub Arc<T>); 4653 - impl<T: PlaylistService> 4654 - tonic::server::UnaryService<super::GetResumeInfoRequest> 4655 - for GetResumeInfoSvc<T> 4656 - { 5482 + impl< 5483 + T: PlaylistService, 5484 + > tonic::server::UnaryService<super::GetResumeInfoRequest> 5485 + for GetResumeInfoSvc<T> { 4657 5486 type Response = super::GetResumeInfoResponse; 4658 - type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>; 5487 + type Future = BoxFuture< 5488 + tonic::Response<Self::Response>, 5489 + tonic::Status, 5490 + >; 4659 5491 fn call( 4660 5492 &mut self, 4661 5493 request: tonic::Request<super::GetResumeInfoRequest>, 4662 5494 ) -> Self::Future { 4663 5495 let inner = Arc::clone(&self.0); 4664 5496 let fut = async move { 4665 - <T as PlaylistService>::get_resume_info(&inner, request).await 5497 + <T as PlaylistService>::get_resume_info(&inner, request) 5498 + .await 4666 5499 }; 4667 5500 Box::pin(fut) 4668 5501 } ··· 4692 5525 "/rockbox.v1alpha1.PlaylistService/GetTrackInfo" => { 4693 5526 #[allow(non_camel_case_types)] 4694 5527 struct GetTrackInfoSvc<T: PlaylistService>(pub Arc<T>); 4695 - impl<T: PlaylistService> tonic::server::UnaryService<super::GetTrackInfoRequest> 4696 - for GetTrackInfoSvc<T> 4697 - { 5528 + impl< 5529 + T: PlaylistService, 5530 + > tonic::server::UnaryService<super::GetTrackInfoRequest> 5531 + for GetTrackInfoSvc<T> { 4698 5532 type Response = super::GetTrackInfoResponse; 4699 - type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>; 5533 + type Future = BoxFuture< 5534 + tonic::Response<Self::Response>, 5535 + tonic::Status, 5536 + >; 4700 5537 fn call( 4701 5538 &mut self, 4702 5539 request: tonic::Request<super::GetTrackInfoRequest>, 4703 5540 ) -> Self::Future { 4704 5541 let inner = Arc::clone(&self.0); 4705 5542 let fut = async move { 4706 - <T as PlaylistService>::get_track_info(&inner, request).await 5543 + <T as PlaylistService>::get_track_info(&inner, request) 5544 + .await 4707 5545 }; 4708 5546 Box::pin(fut) 4709 5547 } ··· 4733 5571 "/rockbox.v1alpha1.PlaylistService/GetFirstIndex" => { 4734 5572 #[allow(non_camel_case_types)] 4735 5573 struct GetFirstIndexSvc<T: PlaylistService>(pub Arc<T>); 4736 - impl<T: PlaylistService> 4737 - tonic::server::UnaryService<super::GetFirstIndexRequest> 4738 - for GetFirstIndexSvc<T> 4739 - { 5574 + impl< 5575 + T: PlaylistService, 5576 + > tonic::server::UnaryService<super::GetFirstIndexRequest> 5577 + for GetFirstIndexSvc<T> { 4740 5578 type Response = super::GetFirstIndexResponse; 4741 - type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>; 5579 + type Future = BoxFuture< 5580 + tonic::Response<Self::Response>, 5581 + tonic::Status, 5582 + >; 4742 5583 fn call( 4743 5584 &mut self, 4744 5585 request: tonic::Request<super::GetFirstIndexRequest>, 4745 5586 ) -> Self::Future { 4746 5587 let inner = Arc::clone(&self.0); 4747 5588 let fut = async move { 4748 - <T as PlaylistService>::get_first_index(&inner, request).await 5589 + <T as PlaylistService>::get_first_index(&inner, request) 5590 + .await 4749 5591 }; 4750 5592 Box::pin(fut) 4751 5593 } ··· 4775 5617 "/rockbox.v1alpha1.PlaylistService/GetDisplayIndex" => { 4776 5618 #[allow(non_camel_case_types)] 4777 5619 struct GetDisplayIndexSvc<T: PlaylistService>(pub Arc<T>); 4778 - impl<T: PlaylistService> 4779 - tonic::server::UnaryService<super::GetDisplayIndexRequest> 4780 - for GetDisplayIndexSvc<T> 4781 - { 5620 + impl< 5621 + T: PlaylistService, 5622 + > tonic::server::UnaryService<super::GetDisplayIndexRequest> 5623 + for GetDisplayIndexSvc<T> { 4782 5624 type Response = super::GetDisplayIndexResponse; 4783 - type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>; 5625 + type Future = BoxFuture< 5626 + tonic::Response<Self::Response>, 5627 + tonic::Status, 5628 + >; 4784 5629 fn call( 4785 5630 &mut self, 4786 5631 request: tonic::Request<super::GetDisplayIndexRequest>, 4787 5632 ) -> Self::Future { 4788 5633 let inner = Arc::clone(&self.0); 4789 5634 let fut = async move { 4790 - <T as PlaylistService>::get_display_index(&inner, request).await 5635 + <T as PlaylistService>::get_display_index(&inner, request) 5636 + .await 4791 5637 }; 4792 5638 Box::pin(fut) 4793 5639 } ··· 4817 5663 "/rockbox.v1alpha1.PlaylistService/Amount" => { 4818 5664 #[allow(non_camel_case_types)] 4819 5665 struct AmountSvc<T: PlaylistService>(pub Arc<T>); 4820 - impl<T: PlaylistService> tonic::server::UnaryService<super::AmountRequest> for AmountSvc<T> { 5666 + impl< 5667 + T: PlaylistService, 5668 + > tonic::server::UnaryService<super::AmountRequest> 5669 + for AmountSvc<T> { 4821 5670 type Response = super::AmountResponse; 4822 - type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>; 5671 + type Future = BoxFuture< 5672 + tonic::Response<Self::Response>, 5673 + tonic::Status, 5674 + >; 4823 5675 fn call( 4824 5676 &mut self, 4825 5677 request: tonic::Request<super::AmountRequest>, ··· 4856 5708 "/rockbox.v1alpha1.PlaylistService/PlaylistResume" => { 4857 5709 #[allow(non_camel_case_types)] 4858 5710 struct PlaylistResumeSvc<T: PlaylistService>(pub Arc<T>); 4859 - impl<T: PlaylistService> 4860 - tonic::server::UnaryService<super::PlaylistResumeRequest> 4861 - for PlaylistResumeSvc<T> 4862 - { 5711 + impl< 5712 + T: PlaylistService, 5713 + > tonic::server::UnaryService<super::PlaylistResumeRequest> 5714 + for PlaylistResumeSvc<T> { 4863 5715 type Response = super::PlaylistResumeResponse; 4864 - type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>; 5716 + type Future = BoxFuture< 5717 + tonic::Response<Self::Response>, 5718 + tonic::Status, 5719 + >; 4865 5720 fn call( 4866 5721 &mut self, 4867 5722 request: tonic::Request<super::PlaylistResumeRequest>, 4868 5723 ) -> Self::Future { 4869 5724 let inner = Arc::clone(&self.0); 4870 5725 let fut = async move { 4871 - <T as PlaylistService>::playlist_resume(&inner, request).await 5726 + <T as PlaylistService>::playlist_resume(&inner, request) 5727 + .await 4872 5728 }; 4873 5729 Box::pin(fut) 4874 5730 } ··· 4898 5754 "/rockbox.v1alpha1.PlaylistService/ResumeTrack" => { 4899 5755 #[allow(non_camel_case_types)] 4900 5756 struct ResumeTrackSvc<T: PlaylistService>(pub Arc<T>); 4901 - impl<T: PlaylistService> tonic::server::UnaryService<super::ResumeTrackRequest> 4902 - for ResumeTrackSvc<T> 4903 - { 5757 + impl< 5758 + T: PlaylistService, 5759 + > tonic::server::UnaryService<super::ResumeTrackRequest> 5760 + for ResumeTrackSvc<T> { 4904 5761 type Response = super::ResumeTrackResponse; 4905 - type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>; 5762 + type Future = BoxFuture< 5763 + tonic::Response<Self::Response>, 5764 + tonic::Status, 5765 + >; 4906 5766 fn call( 4907 5767 &mut self, 4908 5768 request: tonic::Request<super::ResumeTrackRequest>, ··· 4939 5799 "/rockbox.v1alpha1.PlaylistService/SetModified" => { 4940 5800 #[allow(non_camel_case_types)] 4941 5801 struct SetModifiedSvc<T: PlaylistService>(pub Arc<T>); 4942 - impl<T: PlaylistService> tonic::server::UnaryService<super::SetModifiedRequest> 4943 - for SetModifiedSvc<T> 4944 - { 5802 + impl< 5803 + T: PlaylistService, 5804 + > tonic::server::UnaryService<super::SetModifiedRequest> 5805 + for SetModifiedSvc<T> { 4945 5806 type Response = super::SetModifiedResponse; 4946 - type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>; 5807 + type Future = BoxFuture< 5808 + tonic::Response<Self::Response>, 5809 + tonic::Status, 5810 + >; 4947 5811 fn call( 4948 5812 &mut self, 4949 5813 request: tonic::Request<super::SetModifiedRequest>, ··· 4980 5844 "/rockbox.v1alpha1.PlaylistService/Start" => { 4981 5845 #[allow(non_camel_case_types)] 4982 5846 struct StartSvc<T: PlaylistService>(pub Arc<T>); 4983 - impl<T: PlaylistService> tonic::server::UnaryService<super::StartRequest> for StartSvc<T> { 5847 + impl< 5848 + T: PlaylistService, 5849 + > tonic::server::UnaryService<super::StartRequest> for StartSvc<T> { 4984 5850 type Response = super::StartResponse; 4985 - type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>; 5851 + type Future = BoxFuture< 5852 + tonic::Response<Self::Response>, 5853 + tonic::Status, 5854 + >; 4986 5855 fn call( 4987 5856 &mut self, 4988 5857 request: tonic::Request<super::StartRequest>, 4989 5858 ) -> Self::Future { 4990 5859 let inner = Arc::clone(&self.0); 4991 - let fut = 4992 - async move { <T as PlaylistService>::start(&inner, request).await }; 5860 + let fut = async move { 5861 + <T as PlaylistService>::start(&inner, request).await 5862 + }; 4993 5863 Box::pin(fut) 4994 5864 } 4995 5865 } ··· 5018 5888 "/rockbox.v1alpha1.PlaylistService/Sync" => { 5019 5889 #[allow(non_camel_case_types)] 5020 5890 struct SyncSvc<T: PlaylistService>(pub Arc<T>); 5021 - impl<T: PlaylistService> tonic::server::UnaryService<super::SyncRequest> for SyncSvc<T> { 5891 + impl< 5892 + T: PlaylistService, 5893 + > tonic::server::UnaryService<super::SyncRequest> for SyncSvc<T> { 5022 5894 type Response = super::SyncResponse; 5023 - type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>; 5895 + type Future = BoxFuture< 5896 + tonic::Response<Self::Response>, 5897 + tonic::Status, 5898 + >; 5024 5899 fn call( 5025 5900 &mut self, 5026 5901 request: tonic::Request<super::SyncRequest>, 5027 5902 ) -> Self::Future { 5028 5903 let inner = Arc::clone(&self.0); 5029 - let fut = 5030 - async move { <T as PlaylistService>::sync(&inner, request).await }; 5904 + let fut = async move { 5905 + <T as PlaylistService>::sync(&inner, request).await 5906 + }; 5031 5907 Box::pin(fut) 5032 5908 } 5033 5909 } ··· 5056 5932 "/rockbox.v1alpha1.PlaylistService/RemoveAllTracks" => { 5057 5933 #[allow(non_camel_case_types)] 5058 5934 struct RemoveAllTracksSvc<T: PlaylistService>(pub Arc<T>); 5059 - impl<T: PlaylistService> 5060 - tonic::server::UnaryService<super::RemoveAllTracksRequest> 5061 - for RemoveAllTracksSvc<T> 5062 - { 5935 + impl< 5936 + T: PlaylistService, 5937 + > tonic::server::UnaryService<super::RemoveAllTracksRequest> 5938 + for RemoveAllTracksSvc<T> { 5063 5939 type Response = super::RemoveAllTracksResponse; 5064 - type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>; 5940 + type Future = BoxFuture< 5941 + tonic::Response<Self::Response>, 5942 + tonic::Status, 5943 + >; 5065 5944 fn call( 5066 5945 &mut self, 5067 5946 request: tonic::Request<super::RemoveAllTracksRequest>, 5068 5947 ) -> Self::Future { 5069 5948 let inner = Arc::clone(&self.0); 5070 5949 let fut = async move { 5071 - <T as PlaylistService>::remove_all_tracks(&inner, request).await 5950 + <T as PlaylistService>::remove_all_tracks(&inner, request) 5951 + .await 5072 5952 }; 5073 5953 Box::pin(fut) 5074 5954 } ··· 5098 5978 "/rockbox.v1alpha1.PlaylistService/RemoveTracks" => { 5099 5979 #[allow(non_camel_case_types)] 5100 5980 struct RemoveTracksSvc<T: PlaylistService>(pub Arc<T>); 5101 - impl<T: PlaylistService> tonic::server::UnaryService<super::RemoveTracksRequest> 5102 - for RemoveTracksSvc<T> 5103 - { 5981 + impl< 5982 + T: PlaylistService, 5983 + > tonic::server::UnaryService<super::RemoveTracksRequest> 5984 + for RemoveTracksSvc<T> { 5104 5985 type Response = super::RemoveTracksResponse; 5105 - type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>; 5986 + type Future = BoxFuture< 5987 + tonic::Response<Self::Response>, 5988 + tonic::Status, 5989 + >; 5106 5990 fn call( 5107 5991 &mut self, 5108 5992 request: tonic::Request<super::RemoveTracksRequest>, ··· 5139 6023 "/rockbox.v1alpha1.PlaylistService/CreatePlaylist" => { 5140 6024 #[allow(non_camel_case_types)] 5141 6025 struct CreatePlaylistSvc<T: PlaylistService>(pub Arc<T>); 5142 - impl<T: PlaylistService> 5143 - tonic::server::UnaryService<super::CreatePlaylistRequest> 5144 - for CreatePlaylistSvc<T> 5145 - { 6026 + impl< 6027 + T: PlaylistService, 6028 + > tonic::server::UnaryService<super::CreatePlaylistRequest> 6029 + for CreatePlaylistSvc<T> { 5146 6030 type Response = super::CreatePlaylistResponse; 5147 - type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>; 6031 + type Future = BoxFuture< 6032 + tonic::Response<Self::Response>, 6033 + tonic::Status, 6034 + >; 5148 6035 fn call( 5149 6036 &mut self, 5150 6037 request: tonic::Request<super::CreatePlaylistRequest>, 5151 6038 ) -> Self::Future { 5152 6039 let inner = Arc::clone(&self.0); 5153 6040 let fut = async move { 5154 - <T as PlaylistService>::create_playlist(&inner, request).await 6041 + <T as PlaylistService>::create_playlist(&inner, request) 6042 + .await 5155 6043 }; 5156 6044 Box::pin(fut) 5157 6045 } ··· 5181 6069 "/rockbox.v1alpha1.PlaylistService/InsertTracks" => { 5182 6070 #[allow(non_camel_case_types)] 5183 6071 struct InsertTracksSvc<T: PlaylistService>(pub Arc<T>); 5184 - impl<T: PlaylistService> tonic::server::UnaryService<super::InsertTracksRequest> 5185 - for InsertTracksSvc<T> 5186 - { 6072 + impl< 6073 + T: PlaylistService, 6074 + > tonic::server::UnaryService<super::InsertTracksRequest> 6075 + for InsertTracksSvc<T> { 5187 6076 type Response = super::InsertTracksResponse; 5188 - type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>; 6077 + type Future = BoxFuture< 6078 + tonic::Response<Self::Response>, 6079 + tonic::Status, 6080 + >; 5189 6081 fn call( 5190 6082 &mut self, 5191 6083 request: tonic::Request<super::InsertTracksRequest>, ··· 5222 6114 "/rockbox.v1alpha1.PlaylistService/InsertDirectory" => { 5223 6115 #[allow(non_camel_case_types)] 5224 6116 struct InsertDirectorySvc<T: PlaylistService>(pub Arc<T>); 5225 - impl<T: PlaylistService> 5226 - tonic::server::UnaryService<super::InsertDirectoryRequest> 5227 - for InsertDirectorySvc<T> 5228 - { 6117 + impl< 6118 + T: PlaylistService, 6119 + > tonic::server::UnaryService<super::InsertDirectoryRequest> 6120 + for InsertDirectorySvc<T> { 5229 6121 type Response = super::InsertDirectoryResponse; 5230 - type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>; 6122 + type Future = BoxFuture< 6123 + tonic::Response<Self::Response>, 6124 + tonic::Status, 6125 + >; 5231 6126 fn call( 5232 6127 &mut self, 5233 6128 request: tonic::Request<super::InsertDirectoryRequest>, 5234 6129 ) -> Self::Future { 5235 6130 let inner = Arc::clone(&self.0); 5236 6131 let fut = async move { 5237 - <T as PlaylistService>::insert_directory(&inner, request).await 6132 + <T as PlaylistService>::insert_directory(&inner, request) 6133 + .await 5238 6134 }; 5239 6135 Box::pin(fut) 5240 6136 } ··· 5264 6160 "/rockbox.v1alpha1.PlaylistService/InsertPlaylist" => { 5265 6161 #[allow(non_camel_case_types)] 5266 6162 struct InsertPlaylistSvc<T: PlaylistService>(pub Arc<T>); 5267 - impl<T: PlaylistService> 5268 - tonic::server::UnaryService<super::InsertPlaylistRequest> 5269 - for InsertPlaylistSvc<T> 5270 - { 6163 + impl< 6164 + T: PlaylistService, 6165 + > tonic::server::UnaryService<super::InsertPlaylistRequest> 6166 + for InsertPlaylistSvc<T> { 5271 6167 type Response = super::InsertPlaylistResponse; 5272 - type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>; 6168 + type Future = BoxFuture< 6169 + tonic::Response<Self::Response>, 6170 + tonic::Status, 6171 + >; 5273 6172 fn call( 5274 6173 &mut self, 5275 6174 request: tonic::Request<super::InsertPlaylistRequest>, 5276 6175 ) -> Self::Future { 5277 6176 let inner = Arc::clone(&self.0); 5278 6177 let fut = async move { 5279 - <T as PlaylistService>::insert_playlist(&inner, request).await 6178 + <T as PlaylistService>::insert_playlist(&inner, request) 6179 + .await 5280 6180 }; 5281 6181 Box::pin(fut) 5282 6182 } ··· 5306 6206 "/rockbox.v1alpha1.PlaylistService/InsertAlbum" => { 5307 6207 #[allow(non_camel_case_types)] 5308 6208 struct InsertAlbumSvc<T: PlaylistService>(pub Arc<T>); 5309 - impl<T: PlaylistService> tonic::server::UnaryService<super::InsertAlbumRequest> 5310 - for InsertAlbumSvc<T> 5311 - { 6209 + impl< 6210 + T: PlaylistService, 6211 + > tonic::server::UnaryService<super::InsertAlbumRequest> 6212 + for InsertAlbumSvc<T> { 5312 6213 type Response = super::InsertAlbumResponse; 5313 - type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>; 6214 + type Future = BoxFuture< 6215 + tonic::Response<Self::Response>, 6216 + tonic::Status, 6217 + >; 5314 6218 fn call( 5315 6219 &mut self, 5316 6220 request: tonic::Request<super::InsertAlbumRequest>, ··· 5347 6251 "/rockbox.v1alpha1.PlaylistService/InsertArtistTracks" => { 5348 6252 #[allow(non_camel_case_types)] 5349 6253 struct InsertArtistTracksSvc<T: PlaylistService>(pub Arc<T>); 5350 - impl<T: PlaylistService> 5351 - tonic::server::UnaryService<super::InsertArtistTracksRequest> 5352 - for InsertArtistTracksSvc<T> 5353 - { 6254 + impl< 6255 + T: PlaylistService, 6256 + > tonic::server::UnaryService<super::InsertArtistTracksRequest> 6257 + for InsertArtistTracksSvc<T> { 5354 6258 type Response = super::InsertArtistTracksResponse; 5355 - type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>; 6259 + type Future = BoxFuture< 6260 + tonic::Response<Self::Response>, 6261 + tonic::Status, 6262 + >; 5356 6263 fn call( 5357 6264 &mut self, 5358 6265 request: tonic::Request<super::InsertArtistTracksRequest>, 5359 6266 ) -> Self::Future { 5360 6267 let inner = Arc::clone(&self.0); 5361 6268 let fut = async move { 5362 - <T as PlaylistService>::insert_artist_tracks(&inner, request).await 6269 + <T as PlaylistService>::insert_artist_tracks( 6270 + &inner, 6271 + request, 6272 + ) 6273 + .await 5363 6274 }; 5364 6275 Box::pin(fut) 5365 6276 } ··· 5389 6300 "/rockbox.v1alpha1.PlaylistService/ShufflePlaylist" => { 5390 6301 #[allow(non_camel_case_types)] 5391 6302 struct ShufflePlaylistSvc<T: PlaylistService>(pub Arc<T>); 5392 - impl<T: PlaylistService> 5393 - tonic::server::UnaryService<super::ShufflePlaylistRequest> 5394 - for ShufflePlaylistSvc<T> 5395 - { 6303 + impl< 6304 + T: PlaylistService, 6305 + > tonic::server::UnaryService<super::ShufflePlaylistRequest> 6306 + for ShufflePlaylistSvc<T> { 5396 6307 type Response = super::ShufflePlaylistResponse; 5397 - type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>; 6308 + type Future = BoxFuture< 6309 + tonic::Response<Self::Response>, 6310 + tonic::Status, 6311 + >; 5398 6312 fn call( 5399 6313 &mut self, 5400 6314 request: tonic::Request<super::ShufflePlaylistRequest>, 5401 6315 ) -> Self::Future { 5402 6316 let inner = Arc::clone(&self.0); 5403 6317 let fut = async move { 5404 - <T as PlaylistService>::shuffle_playlist(&inner, request).await 6318 + <T as PlaylistService>::shuffle_playlist(&inner, request) 6319 + .await 5405 6320 }; 5406 6321 Box::pin(fut) 5407 6322 } ··· 5428 6343 }; 5429 6344 Box::pin(fut) 5430 6345 } 5431 - _ => Box::pin(async move { 5432 - let mut response = http::Response::new(empty_body()); 5433 - let headers = response.headers_mut(); 5434 - headers.insert( 5435 - tonic::Status::GRPC_STATUS, 5436 - (tonic::Code::Unimplemented as i32).into(), 5437 - ); 5438 - headers.insert( 5439 - http::header::CONTENT_TYPE, 5440 - tonic::metadata::GRPC_CONTENT_TYPE, 5441 - ); 5442 - Ok(response) 5443 - }), 6346 + _ => { 6347 + Box::pin(async move { 6348 + let mut response = http::Response::new(empty_body()); 6349 + let headers = response.headers_mut(); 6350 + headers 6351 + .insert( 6352 + tonic::Status::GRPC_STATUS, 6353 + (tonic::Code::Unimplemented as i32).into(), 6354 + ); 6355 + headers 6356 + .insert( 6357 + http::header::CONTENT_TYPE, 6358 + tonic::metadata::GRPC_CONTENT_TYPE, 6359 + ); 6360 + Ok(response) 6361 + }) 6362 + } 5444 6363 } 5445 6364 } 5446 6365 } ··· 5950 6869 dead_code, 5951 6870 missing_docs, 5952 6871 clippy::wildcard_imports, 5953 - clippy::let_unit_value 6872 + clippy::let_unit_value, 5954 6873 )] 5955 - use tonic::codegen::http::Uri; 5956 6874 use tonic::codegen::*; 6875 + use tonic::codegen::http::Uri; 5957 6876 #[derive(Debug, Clone)] 5958 6877 pub struct SettingsServiceClient<T> { 5959 6878 inner: tonic::client::Grpc<T>, ··· 5997 6916 <T as tonic::client::GrpcService<tonic::body::BoxBody>>::ResponseBody, 5998 6917 >, 5999 6918 >, 6000 - <T as tonic::codegen::Service<http::Request<tonic::body::BoxBody>>>::Error: 6001 - Into<StdError> + std::marker::Send + std::marker::Sync, 6919 + <T as tonic::codegen::Service< 6920 + http::Request<tonic::body::BoxBody>, 6921 + >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync, 6002 6922 { 6003 6923 SettingsServiceClient::new(InterceptedService::new(inner, interceptor)) 6004 6924 } ··· 6036 6956 pub async fn get_settings_list( 6037 6957 &mut self, 6038 6958 request: impl tonic::IntoRequest<super::GetSettingsListRequest>, 6039 - ) -> std::result::Result<tonic::Response<super::GetSettingsListResponse>, tonic::Status> 6040 - { 6041 - self.inner.ready().await.map_err(|e| { 6042 - tonic::Status::unknown(format!("Service was not ready: {}", e.into())) 6043 - })?; 6959 + ) -> std::result::Result< 6960 + tonic::Response<super::GetSettingsListResponse>, 6961 + tonic::Status, 6962 + > { 6963 + self.inner 6964 + .ready() 6965 + .await 6966 + .map_err(|e| { 6967 + tonic::Status::unknown( 6968 + format!("Service was not ready: {}", e.into()), 6969 + ) 6970 + })?; 6044 6971 let codec = tonic::codec::ProstCodec::default(); 6045 6972 let path = http::uri::PathAndQuery::from_static( 6046 6973 "/rockbox.v1alpha1.SettingsService/GetSettingsList", 6047 6974 ); 6048 6975 let mut req = request.into_request(); 6049 - req.extensions_mut().insert(GrpcMethod::new( 6050 - "rockbox.v1alpha1.SettingsService", 6051 - "GetSettingsList", 6052 - )); 6976 + req.extensions_mut() 6977 + .insert( 6978 + GrpcMethod::new( 6979 + "rockbox.v1alpha1.SettingsService", 6980 + "GetSettingsList", 6981 + ), 6982 + ); 6053 6983 self.inner.unary(req, path, codec).await 6054 6984 } 6055 6985 pub async fn get_global_settings( 6056 6986 &mut self, 6057 6987 request: impl tonic::IntoRequest<super::GetGlobalSettingsRequest>, 6058 - ) -> std::result::Result<tonic::Response<super::GetGlobalSettingsResponse>, tonic::Status> 6059 - { 6060 - self.inner.ready().await.map_err(|e| { 6061 - tonic::Status::unknown(format!("Service was not ready: {}", e.into())) 6062 - })?; 6988 + ) -> std::result::Result< 6989 + tonic::Response<super::GetGlobalSettingsResponse>, 6990 + tonic::Status, 6991 + > { 6992 + self.inner 6993 + .ready() 6994 + .await 6995 + .map_err(|e| { 6996 + tonic::Status::unknown( 6997 + format!("Service was not ready: {}", e.into()), 6998 + ) 6999 + })?; 6063 7000 let codec = tonic::codec::ProstCodec::default(); 6064 7001 let path = http::uri::PathAndQuery::from_static( 6065 7002 "/rockbox.v1alpha1.SettingsService/GetGlobalSettings", 6066 7003 ); 6067 7004 let mut req = request.into_request(); 6068 - req.extensions_mut().insert(GrpcMethod::new( 6069 - "rockbox.v1alpha1.SettingsService", 6070 - "GetGlobalSettings", 6071 - )); 7005 + req.extensions_mut() 7006 + .insert( 7007 + GrpcMethod::new( 7008 + "rockbox.v1alpha1.SettingsService", 7009 + "GetGlobalSettings", 7010 + ), 7011 + ); 6072 7012 self.inner.unary(req, path, codec).await 6073 7013 } 6074 7014 pub async fn save_settings( 6075 7015 &mut self, 6076 7016 request: impl tonic::IntoRequest<super::SaveSettingsRequest>, 6077 - ) -> std::result::Result<tonic::Response<super::SaveSettingsResponse>, tonic::Status> 6078 - { 6079 - self.inner.ready().await.map_err(|e| { 6080 - tonic::Status::unknown(format!("Service was not ready: {}", e.into())) 6081 - })?; 7017 + ) -> std::result::Result< 7018 + tonic::Response<super::SaveSettingsResponse>, 7019 + tonic::Status, 7020 + > { 7021 + self.inner 7022 + .ready() 7023 + .await 7024 + .map_err(|e| { 7025 + tonic::Status::unknown( 7026 + format!("Service was not ready: {}", e.into()), 7027 + ) 7028 + })?; 6082 7029 let codec = tonic::codec::ProstCodec::default(); 6083 7030 let path = http::uri::PathAndQuery::from_static( 6084 7031 "/rockbox.v1alpha1.SettingsService/SaveSettings", 6085 7032 ); 6086 7033 let mut req = request.into_request(); 6087 - req.extensions_mut().insert(GrpcMethod::new( 6088 - "rockbox.v1alpha1.SettingsService", 6089 - "SaveSettings", 6090 - )); 7034 + req.extensions_mut() 7035 + .insert( 7036 + GrpcMethod::new("rockbox.v1alpha1.SettingsService", "SaveSettings"), 7037 + ); 6091 7038 self.inner.unary(req, path, codec).await 6092 7039 } 6093 7040 } ··· 6099 7046 dead_code, 6100 7047 missing_docs, 6101 7048 clippy::wildcard_imports, 6102 - clippy::let_unit_value 7049 + clippy::let_unit_value, 6103 7050 )] 6104 7051 use tonic::codegen::*; 6105 7052 /// Generated trait containing gRPC methods that should be implemented for use with SettingsServiceServer. ··· 6108 7055 async fn get_settings_list( 6109 7056 &self, 6110 7057 request: tonic::Request<super::GetSettingsListRequest>, 6111 - ) -> std::result::Result<tonic::Response<super::GetSettingsListResponse>, tonic::Status>; 7058 + ) -> std::result::Result< 7059 + tonic::Response<super::GetSettingsListResponse>, 7060 + tonic::Status, 7061 + >; 6112 7062 async fn get_global_settings( 6113 7063 &self, 6114 7064 request: tonic::Request<super::GetGlobalSettingsRequest>, 6115 - ) -> std::result::Result<tonic::Response<super::GetGlobalSettingsResponse>, tonic::Status>; 7065 + ) -> std::result::Result< 7066 + tonic::Response<super::GetGlobalSettingsResponse>, 7067 + tonic::Status, 7068 + >; 6116 7069 async fn save_settings( 6117 7070 &self, 6118 7071 request: tonic::Request<super::SaveSettingsRequest>, 6119 - ) -> std::result::Result<tonic::Response<super::SaveSettingsResponse>, tonic::Status>; 7072 + ) -> std::result::Result< 7073 + tonic::Response<super::SaveSettingsResponse>, 7074 + tonic::Status, 7075 + >; 6120 7076 } 6121 7077 #[derive(Debug)] 6122 7078 pub struct SettingsServiceServer<T> { ··· 6139 7095 max_encoding_message_size: None, 6140 7096 } 6141 7097 } 6142 - pub fn with_interceptor<F>(inner: T, interceptor: F) -> InterceptedService<Self, F> 7098 + pub fn with_interceptor<F>( 7099 + inner: T, 7100 + interceptor: F, 7101 + ) -> InterceptedService<Self, F> 6143 7102 where 6144 7103 F: tonic::service::Interceptor, 6145 7104 { ··· 6194 7153 "/rockbox.v1alpha1.SettingsService/GetSettingsList" => { 6195 7154 #[allow(non_camel_case_types)] 6196 7155 struct GetSettingsListSvc<T: SettingsService>(pub Arc<T>); 6197 - impl<T: SettingsService> 6198 - tonic::server::UnaryService<super::GetSettingsListRequest> 6199 - for GetSettingsListSvc<T> 6200 - { 7156 + impl< 7157 + T: SettingsService, 7158 + > tonic::server::UnaryService<super::GetSettingsListRequest> 7159 + for GetSettingsListSvc<T> { 6201 7160 type Response = super::GetSettingsListResponse; 6202 - type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>; 7161 + type Future = BoxFuture< 7162 + tonic::Response<Self::Response>, 7163 + tonic::Status, 7164 + >; 6203 7165 fn call( 6204 7166 &mut self, 6205 7167 request: tonic::Request<super::GetSettingsListRequest>, 6206 7168 ) -> Self::Future { 6207 7169 let inner = Arc::clone(&self.0); 6208 7170 let fut = async move { 6209 - <T as SettingsService>::get_settings_list(&inner, request).await 7171 + <T as SettingsService>::get_settings_list(&inner, request) 7172 + .await 6210 7173 }; 6211 7174 Box::pin(fut) 6212 7175 } ··· 6236 7199 "/rockbox.v1alpha1.SettingsService/GetGlobalSettings" => { 6237 7200 #[allow(non_camel_case_types)] 6238 7201 struct GetGlobalSettingsSvc<T: SettingsService>(pub Arc<T>); 6239 - impl<T: SettingsService> 6240 - tonic::server::UnaryService<super::GetGlobalSettingsRequest> 6241 - for GetGlobalSettingsSvc<T> 6242 - { 7202 + impl< 7203 + T: SettingsService, 7204 + > tonic::server::UnaryService<super::GetGlobalSettingsRequest> 7205 + for GetGlobalSettingsSvc<T> { 6243 7206 type Response = super::GetGlobalSettingsResponse; 6244 - type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>; 7207 + type Future = BoxFuture< 7208 + tonic::Response<Self::Response>, 7209 + tonic::Status, 7210 + >; 6245 7211 fn call( 6246 7212 &mut self, 6247 7213 request: tonic::Request<super::GetGlobalSettingsRequest>, 6248 7214 ) -> Self::Future { 6249 7215 let inner = Arc::clone(&self.0); 6250 7216 let fut = async move { 6251 - <T as SettingsService>::get_global_settings(&inner, request).await 7217 + <T as SettingsService>::get_global_settings(&inner, request) 7218 + .await 6252 7219 }; 6253 7220 Box::pin(fut) 6254 7221 } ··· 6278 7245 "/rockbox.v1alpha1.SettingsService/SaveSettings" => { 6279 7246 #[allow(non_camel_case_types)] 6280 7247 struct SaveSettingsSvc<T: SettingsService>(pub Arc<T>); 6281 - impl<T: SettingsService> tonic::server::UnaryService<super::SaveSettingsRequest> 6282 - for SaveSettingsSvc<T> 6283 - { 7248 + impl< 7249 + T: SettingsService, 7250 + > tonic::server::UnaryService<super::SaveSettingsRequest> 7251 + for SaveSettingsSvc<T> { 6284 7252 type Response = super::SaveSettingsResponse; 6285 - type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>; 7253 + type Future = BoxFuture< 7254 + tonic::Response<Self::Response>, 7255 + tonic::Status, 7256 + >; 6286 7257 fn call( 6287 7258 &mut self, 6288 7259 request: tonic::Request<super::SaveSettingsRequest>, ··· 6316 7287 }; 6317 7288 Box::pin(fut) 6318 7289 } 6319 - _ => Box::pin(async move { 6320 - let mut response = http::Response::new(empty_body()); 6321 - let headers = response.headers_mut(); 6322 - headers.insert( 6323 - tonic::Status::GRPC_STATUS, 6324 - (tonic::Code::Unimplemented as i32).into(), 6325 - ); 6326 - headers.insert( 6327 - http::header::CONTENT_TYPE, 6328 - tonic::metadata::GRPC_CONTENT_TYPE, 6329 - ); 6330 - Ok(response) 6331 - }), 7290 + _ => { 7291 + Box::pin(async move { 7292 + let mut response = http::Response::new(empty_body()); 7293 + let headers = response.headers_mut(); 7294 + headers 7295 + .insert( 7296 + tonic::Status::GRPC_STATUS, 7297 + (tonic::Code::Unimplemented as i32).into(), 7298 + ); 7299 + headers 7300 + .insert( 7301 + http::header::CONTENT_TYPE, 7302 + tonic::metadata::GRPC_CONTENT_TYPE, 7303 + ); 7304 + Ok(response) 7305 + }) 7306 + } 6332 7307 } 6333 7308 } 6334 7309 } ··· 6486 7461 dead_code, 6487 7462 missing_docs, 6488 7463 clippy::wildcard_imports, 6489 - clippy::let_unit_value 7464 + clippy::let_unit_value, 6490 7465 )] 6491 - use tonic::codegen::http::Uri; 6492 7466 use tonic::codegen::*; 7467 + use tonic::codegen::http::Uri; 6493 7468 #[derive(Debug, Clone)] 6494 7469 pub struct SoundServiceClient<T> { 6495 7470 inner: tonic::client::Grpc<T>, ··· 6533 7508 <T as tonic::client::GrpcService<tonic::body::BoxBody>>::ResponseBody, 6534 7509 >, 6535 7510 >, 6536 - <T as tonic::codegen::Service<http::Request<tonic::body::BoxBody>>>::Error: 6537 - Into<StdError> + std::marker::Send + std::marker::Sync, 7511 + <T as tonic::codegen::Service< 7512 + http::Request<tonic::body::BoxBody>, 7513 + >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync, 6538 7514 { 6539 7515 SoundServiceClient::new(InterceptedService::new(inner, interceptor)) 6540 7516 } ··· 6572 7548 pub async fn adjust_volume( 6573 7549 &mut self, 6574 7550 request: impl tonic::IntoRequest<super::AdjustVolumeRequest>, 6575 - ) -> std::result::Result<tonic::Response<super::AdjustVolumeResponse>, tonic::Status> 6576 - { 6577 - self.inner.ready().await.map_err(|e| { 6578 - tonic::Status::unknown(format!("Service was not ready: {}", e.into())) 6579 - })?; 7551 + ) -> std::result::Result< 7552 + tonic::Response<super::AdjustVolumeResponse>, 7553 + tonic::Status, 7554 + > { 7555 + self.inner 7556 + .ready() 7557 + .await 7558 + .map_err(|e| { 7559 + tonic::Status::unknown( 7560 + format!("Service was not ready: {}", e.into()), 7561 + ) 7562 + })?; 6580 7563 let codec = tonic::codec::ProstCodec::default(); 6581 - let path = 6582 - http::uri::PathAndQuery::from_static("/rockbox.v1alpha1.SoundService/AdjustVolume"); 7564 + let path = http::uri::PathAndQuery::from_static( 7565 + "/rockbox.v1alpha1.SoundService/AdjustVolume", 7566 + ); 6583 7567 let mut req = request.into_request(); 6584 - req.extensions_mut().insert(GrpcMethod::new( 6585 - "rockbox.v1alpha1.SoundService", 6586 - "AdjustVolume", 6587 - )); 7568 + req.extensions_mut() 7569 + .insert( 7570 + GrpcMethod::new("rockbox.v1alpha1.SoundService", "AdjustVolume"), 7571 + ); 6588 7572 self.inner.unary(req, path, codec).await 6589 7573 } 6590 7574 pub async fn sound_set( 6591 7575 &mut self, 6592 7576 request: impl tonic::IntoRequest<super::SoundSetRequest>, 6593 - ) -> std::result::Result<tonic::Response<super::SoundSetResponse>, tonic::Status> { 6594 - self.inner.ready().await.map_err(|e| { 6595 - tonic::Status::unknown(format!("Service was not ready: {}", e.into())) 6596 - })?; 7577 + ) -> std::result::Result< 7578 + tonic::Response<super::SoundSetResponse>, 7579 + tonic::Status, 7580 + > { 7581 + self.inner 7582 + .ready() 7583 + .await 7584 + .map_err(|e| { 7585 + tonic::Status::unknown( 7586 + format!("Service was not ready: {}", e.into()), 7587 + ) 7588 + })?; 6597 7589 let codec = tonic::codec::ProstCodec::default(); 6598 - let path = 6599 - http::uri::PathAndQuery::from_static("/rockbox.v1alpha1.SoundService/SoundSet"); 7590 + let path = http::uri::PathAndQuery::from_static( 7591 + "/rockbox.v1alpha1.SoundService/SoundSet", 7592 + ); 6600 7593 let mut req = request.into_request(); 6601 7594 req.extensions_mut() 6602 7595 .insert(GrpcMethod::new("rockbox.v1alpha1.SoundService", "SoundSet")); ··· 6605 7598 pub async fn sound_current( 6606 7599 &mut self, 6607 7600 request: impl tonic::IntoRequest<super::SoundCurrentRequest>, 6608 - ) -> std::result::Result<tonic::Response<super::SoundCurrentResponse>, tonic::Status> 6609 - { 6610 - self.inner.ready().await.map_err(|e| { 6611 - tonic::Status::unknown(format!("Service was not ready: {}", e.into())) 6612 - })?; 7601 + ) -> std::result::Result< 7602 + tonic::Response<super::SoundCurrentResponse>, 7603 + tonic::Status, 7604 + > { 7605 + self.inner 7606 + .ready() 7607 + .await 7608 + .map_err(|e| { 7609 + tonic::Status::unknown( 7610 + format!("Service was not ready: {}", e.into()), 7611 + ) 7612 + })?; 6613 7613 let codec = tonic::codec::ProstCodec::default(); 6614 - let path = 6615 - http::uri::PathAndQuery::from_static("/rockbox.v1alpha1.SoundService/SoundCurrent"); 7614 + let path = http::uri::PathAndQuery::from_static( 7615 + "/rockbox.v1alpha1.SoundService/SoundCurrent", 7616 + ); 6616 7617 let mut req = request.into_request(); 6617 - req.extensions_mut().insert(GrpcMethod::new( 6618 - "rockbox.v1alpha1.SoundService", 6619 - "SoundCurrent", 6620 - )); 7618 + req.extensions_mut() 7619 + .insert( 7620 + GrpcMethod::new("rockbox.v1alpha1.SoundService", "SoundCurrent"), 7621 + ); 6621 7622 self.inner.unary(req, path, codec).await 6622 7623 } 6623 7624 pub async fn sound_default( 6624 7625 &mut self, 6625 7626 request: impl tonic::IntoRequest<super::SoundDefaultRequest>, 6626 - ) -> std::result::Result<tonic::Response<super::SoundDefaultResponse>, tonic::Status> 6627 - { 6628 - self.inner.ready().await.map_err(|e| { 6629 - tonic::Status::unknown(format!("Service was not ready: {}", e.into())) 6630 - })?; 7627 + ) -> std::result::Result< 7628 + tonic::Response<super::SoundDefaultResponse>, 7629 + tonic::Status, 7630 + > { 7631 + self.inner 7632 + .ready() 7633 + .await 7634 + .map_err(|e| { 7635 + tonic::Status::unknown( 7636 + format!("Service was not ready: {}", e.into()), 7637 + ) 7638 + })?; 6631 7639 let codec = tonic::codec::ProstCodec::default(); 6632 - let path = 6633 - http::uri::PathAndQuery::from_static("/rockbox.v1alpha1.SoundService/SoundDefault"); 7640 + let path = http::uri::PathAndQuery::from_static( 7641 + "/rockbox.v1alpha1.SoundService/SoundDefault", 7642 + ); 6634 7643 let mut req = request.into_request(); 6635 - req.extensions_mut().insert(GrpcMethod::new( 6636 - "rockbox.v1alpha1.SoundService", 6637 - "SoundDefault", 6638 - )); 7644 + req.extensions_mut() 7645 + .insert( 7646 + GrpcMethod::new("rockbox.v1alpha1.SoundService", "SoundDefault"), 7647 + ); 6639 7648 self.inner.unary(req, path, codec).await 6640 7649 } 6641 7650 pub async fn sound_min( 6642 7651 &mut self, 6643 7652 request: impl tonic::IntoRequest<super::SoundMinRequest>, 6644 - ) -> std::result::Result<tonic::Response<super::SoundMinResponse>, tonic::Status> { 6645 - self.inner.ready().await.map_err(|e| { 6646 - tonic::Status::unknown(format!("Service was not ready: {}", e.into())) 6647 - })?; 7653 + ) -> std::result::Result< 7654 + tonic::Response<super::SoundMinResponse>, 7655 + tonic::Status, 7656 + > { 7657 + self.inner 7658 + .ready() 7659 + .await 7660 + .map_err(|e| { 7661 + tonic::Status::unknown( 7662 + format!("Service was not ready: {}", e.into()), 7663 + ) 7664 + })?; 6648 7665 let codec = tonic::codec::ProstCodec::default(); 6649 - let path = 6650 - http::uri::PathAndQuery::from_static("/rockbox.v1alpha1.SoundService/SoundMin"); 7666 + let path = http::uri::PathAndQuery::from_static( 7667 + "/rockbox.v1alpha1.SoundService/SoundMin", 7668 + ); 6651 7669 let mut req = request.into_request(); 6652 7670 req.extensions_mut() 6653 7671 .insert(GrpcMethod::new("rockbox.v1alpha1.SoundService", "SoundMin")); ··· 6656 7674 pub async fn sound_max( 6657 7675 &mut self, 6658 7676 request: impl tonic::IntoRequest<super::SoundMaxRequest>, 6659 - ) -> std::result::Result<tonic::Response<super::SoundMaxResponse>, tonic::Status> { 6660 - self.inner.ready().await.map_err(|e| { 6661 - tonic::Status::unknown(format!("Service was not ready: {}", e.into())) 6662 - })?; 7677 + ) -> std::result::Result< 7678 + tonic::Response<super::SoundMaxResponse>, 7679 + tonic::Status, 7680 + > { 7681 + self.inner 7682 + .ready() 7683 + .await 7684 + .map_err(|e| { 7685 + tonic::Status::unknown( 7686 + format!("Service was not ready: {}", e.into()), 7687 + ) 7688 + })?; 6663 7689 let codec = tonic::codec::ProstCodec::default(); 6664 - let path = 6665 - http::uri::PathAndQuery::from_static("/rockbox.v1alpha1.SoundService/SoundMax"); 7690 + let path = http::uri::PathAndQuery::from_static( 7691 + "/rockbox.v1alpha1.SoundService/SoundMax", 7692 + ); 6666 7693 let mut req = request.into_request(); 6667 7694 req.extensions_mut() 6668 7695 .insert(GrpcMethod::new("rockbox.v1alpha1.SoundService", "SoundMax")); ··· 6671 7698 pub async fn sound_unit( 6672 7699 &mut self, 6673 7700 request: impl tonic::IntoRequest<super::SoundUnitRequest>, 6674 - ) -> std::result::Result<tonic::Response<super::SoundUnitResponse>, tonic::Status> { 6675 - self.inner.ready().await.map_err(|e| { 6676 - tonic::Status::unknown(format!("Service was not ready: {}", e.into())) 6677 - })?; 7701 + ) -> std::result::Result< 7702 + tonic::Response<super::SoundUnitResponse>, 7703 + tonic::Status, 7704 + > { 7705 + self.inner 7706 + .ready() 7707 + .await 7708 + .map_err(|e| { 7709 + tonic::Status::unknown( 7710 + format!("Service was not ready: {}", e.into()), 7711 + ) 7712 + })?; 6678 7713 let codec = tonic::codec::ProstCodec::default(); 6679 - let path = 6680 - http::uri::PathAndQuery::from_static("/rockbox.v1alpha1.SoundService/SoundUnit"); 7714 + let path = http::uri::PathAndQuery::from_static( 7715 + "/rockbox.v1alpha1.SoundService/SoundUnit", 7716 + ); 6681 7717 let mut req = request.into_request(); 6682 - req.extensions_mut().insert(GrpcMethod::new( 6683 - "rockbox.v1alpha1.SoundService", 6684 - "SoundUnit", 6685 - )); 7718 + req.extensions_mut() 7719 + .insert(GrpcMethod::new("rockbox.v1alpha1.SoundService", "SoundUnit")); 6686 7720 self.inner.unary(req, path, codec).await 6687 7721 } 6688 7722 pub async fn sound_val2_phys( 6689 7723 &mut self, 6690 7724 request: impl tonic::IntoRequest<super::SoundVal2PhysRequest>, 6691 - ) -> std::result::Result<tonic::Response<super::SoundVal2PhysResponse>, tonic::Status> 6692 - { 6693 - self.inner.ready().await.map_err(|e| { 6694 - tonic::Status::unknown(format!("Service was not ready: {}", e.into())) 6695 - })?; 7725 + ) -> std::result::Result< 7726 + tonic::Response<super::SoundVal2PhysResponse>, 7727 + tonic::Status, 7728 + > { 7729 + self.inner 7730 + .ready() 7731 + .await 7732 + .map_err(|e| { 7733 + tonic::Status::unknown( 7734 + format!("Service was not ready: {}", e.into()), 7735 + ) 7736 + })?; 6696 7737 let codec = tonic::codec::ProstCodec::default(); 6697 7738 let path = http::uri::PathAndQuery::from_static( 6698 7739 "/rockbox.v1alpha1.SoundService/SoundVal2Phys", 6699 7740 ); 6700 7741 let mut req = request.into_request(); 6701 - req.extensions_mut().insert(GrpcMethod::new( 6702 - "rockbox.v1alpha1.SoundService", 6703 - "SoundVal2Phys", 6704 - )); 7742 + req.extensions_mut() 7743 + .insert( 7744 + GrpcMethod::new("rockbox.v1alpha1.SoundService", "SoundVal2Phys"), 7745 + ); 6705 7746 self.inner.unary(req, path, codec).await 6706 7747 } 6707 7748 pub async fn get_pitch( 6708 7749 &mut self, 6709 7750 request: impl tonic::IntoRequest<super::GetPitchRequest>, 6710 - ) -> std::result::Result<tonic::Response<super::GetPitchResponse>, tonic::Status> { 6711 - self.inner.ready().await.map_err(|e| { 6712 - tonic::Status::unknown(format!("Service was not ready: {}", e.into())) 6713 - })?; 7751 + ) -> std::result::Result< 7752 + tonic::Response<super::GetPitchResponse>, 7753 + tonic::Status, 7754 + > { 7755 + self.inner 7756 + .ready() 7757 + .await 7758 + .map_err(|e| { 7759 + tonic::Status::unknown( 7760 + format!("Service was not ready: {}", e.into()), 7761 + ) 7762 + })?; 6714 7763 let codec = tonic::codec::ProstCodec::default(); 6715 - let path = 6716 - http::uri::PathAndQuery::from_static("/rockbox.v1alpha1.SoundService/GetPitch"); 7764 + let path = http::uri::PathAndQuery::from_static( 7765 + "/rockbox.v1alpha1.SoundService/GetPitch", 7766 + ); 6717 7767 let mut req = request.into_request(); 6718 7768 req.extensions_mut() 6719 7769 .insert(GrpcMethod::new("rockbox.v1alpha1.SoundService", "GetPitch")); ··· 6722 7772 pub async fn set_pitch( 6723 7773 &mut self, 6724 7774 request: impl tonic::IntoRequest<super::SetPitchRequest>, 6725 - ) -> std::result::Result<tonic::Response<super::SetPitchResponse>, tonic::Status> { 6726 - self.inner.ready().await.map_err(|e| { 6727 - tonic::Status::unknown(format!("Service was not ready: {}", e.into())) 6728 - })?; 7775 + ) -> std::result::Result< 7776 + tonic::Response<super::SetPitchResponse>, 7777 + tonic::Status, 7778 + > { 7779 + self.inner 7780 + .ready() 7781 + .await 7782 + .map_err(|e| { 7783 + tonic::Status::unknown( 7784 + format!("Service was not ready: {}", e.into()), 7785 + ) 7786 + })?; 6729 7787 let codec = tonic::codec::ProstCodec::default(); 6730 - let path = 6731 - http::uri::PathAndQuery::from_static("/rockbox.v1alpha1.SoundService/SetPitch"); 7788 + let path = http::uri::PathAndQuery::from_static( 7789 + "/rockbox.v1alpha1.SoundService/SetPitch", 7790 + ); 6732 7791 let mut req = request.into_request(); 6733 7792 req.extensions_mut() 6734 7793 .insert(GrpcMethod::new("rockbox.v1alpha1.SoundService", "SetPitch")); ··· 6737 7796 pub async fn beep_play( 6738 7797 &mut self, 6739 7798 request: impl tonic::IntoRequest<super::BeepPlayRequest>, 6740 - ) -> std::result::Result<tonic::Response<super::BeepPlayResponse>, tonic::Status> { 6741 - self.inner.ready().await.map_err(|e| { 6742 - tonic::Status::unknown(format!("Service was not ready: {}", e.into())) 6743 - })?; 7799 + ) -> std::result::Result< 7800 + tonic::Response<super::BeepPlayResponse>, 7801 + tonic::Status, 7802 + > { 7803 + self.inner 7804 + .ready() 7805 + .await 7806 + .map_err(|e| { 7807 + tonic::Status::unknown( 7808 + format!("Service was not ready: {}", e.into()), 7809 + ) 7810 + })?; 6744 7811 let codec = tonic::codec::ProstCodec::default(); 6745 - let path = 6746 - http::uri::PathAndQuery::from_static("/rockbox.v1alpha1.SoundService/BeepPlay"); 7812 + let path = http::uri::PathAndQuery::from_static( 7813 + "/rockbox.v1alpha1.SoundService/BeepPlay", 7814 + ); 6747 7815 let mut req = request.into_request(); 6748 7816 req.extensions_mut() 6749 7817 .insert(GrpcMethod::new("rockbox.v1alpha1.SoundService", "BeepPlay")); ··· 6752 7820 pub async fn pcmbuf_fade( 6753 7821 &mut self, 6754 7822 request: impl tonic::IntoRequest<super::PcmbufFadeRequest>, 6755 - ) -> std::result::Result<tonic::Response<super::PcmbufFadeResponse>, tonic::Status> 6756 - { 6757 - self.inner.ready().await.map_err(|e| { 6758 - tonic::Status::unknown(format!("Service was not ready: {}", e.into())) 6759 - })?; 7823 + ) -> std::result::Result< 7824 + tonic::Response<super::PcmbufFadeResponse>, 7825 + tonic::Status, 7826 + > { 7827 + self.inner 7828 + .ready() 7829 + .await 7830 + .map_err(|e| { 7831 + tonic::Status::unknown( 7832 + format!("Service was not ready: {}", e.into()), 7833 + ) 7834 + })?; 6760 7835 let codec = tonic::codec::ProstCodec::default(); 6761 - let path = 6762 - http::uri::PathAndQuery::from_static("/rockbox.v1alpha1.SoundService/PcmbufFade"); 7836 + let path = http::uri::PathAndQuery::from_static( 7837 + "/rockbox.v1alpha1.SoundService/PcmbufFade", 7838 + ); 6763 7839 let mut req = request.into_request(); 6764 - req.extensions_mut().insert(GrpcMethod::new( 6765 - "rockbox.v1alpha1.SoundService", 6766 - "PcmbufFade", 6767 - )); 7840 + req.extensions_mut() 7841 + .insert(GrpcMethod::new("rockbox.v1alpha1.SoundService", "PcmbufFade")); 6768 7842 self.inner.unary(req, path, codec).await 6769 7843 } 6770 7844 pub async fn pcmbuf_set_low_latency( 6771 7845 &mut self, 6772 7846 request: impl tonic::IntoRequest<super::PcmbufSetLowLatencyRequest>, 6773 - ) -> std::result::Result<tonic::Response<super::PcmbufSetLowLatencyResponse>, tonic::Status> 6774 - { 6775 - self.inner.ready().await.map_err(|e| { 6776 - tonic::Status::unknown(format!("Service was not ready: {}", e.into())) 6777 - })?; 7847 + ) -> std::result::Result< 7848 + tonic::Response<super::PcmbufSetLowLatencyResponse>, 7849 + tonic::Status, 7850 + > { 7851 + self.inner 7852 + .ready() 7853 + .await 7854 + .map_err(|e| { 7855 + tonic::Status::unknown( 7856 + format!("Service was not ready: {}", e.into()), 7857 + ) 7858 + })?; 6778 7859 let codec = tonic::codec::ProstCodec::default(); 6779 7860 let path = http::uri::PathAndQuery::from_static( 6780 7861 "/rockbox.v1alpha1.SoundService/PcmbufSetLowLatency", 6781 7862 ); 6782 7863 let mut req = request.into_request(); 6783 - req.extensions_mut().insert(GrpcMethod::new( 6784 - "rockbox.v1alpha1.SoundService", 6785 - "PcmbufSetLowLatency", 6786 - )); 7864 + req.extensions_mut() 7865 + .insert( 7866 + GrpcMethod::new( 7867 + "rockbox.v1alpha1.SoundService", 7868 + "PcmbufSetLowLatency", 7869 + ), 7870 + ); 6787 7871 self.inner.unary(req, path, codec).await 6788 7872 } 6789 7873 pub async fn system_sound_play( 6790 7874 &mut self, 6791 7875 request: impl tonic::IntoRequest<super::SystemSoundPlayRequest>, 6792 - ) -> std::result::Result<tonic::Response<super::SystemSoundPlayResponse>, tonic::Status> 6793 - { 6794 - self.inner.ready().await.map_err(|e| { 6795 - tonic::Status::unknown(format!("Service was not ready: {}", e.into())) 6796 - })?; 7876 + ) -> std::result::Result< 7877 + tonic::Response<super::SystemSoundPlayResponse>, 7878 + tonic::Status, 7879 + > { 7880 + self.inner 7881 + .ready() 7882 + .await 7883 + .map_err(|e| { 7884 + tonic::Status::unknown( 7885 + format!("Service was not ready: {}", e.into()), 7886 + ) 7887 + })?; 6797 7888 let codec = tonic::codec::ProstCodec::default(); 6798 7889 let path = http::uri::PathAndQuery::from_static( 6799 7890 "/rockbox.v1alpha1.SoundService/SystemSoundPlay", 6800 7891 ); 6801 7892 let mut req = request.into_request(); 6802 - req.extensions_mut().insert(GrpcMethod::new( 6803 - "rockbox.v1alpha1.SoundService", 6804 - "SystemSoundPlay", 6805 - )); 7893 + req.extensions_mut() 7894 + .insert( 7895 + GrpcMethod::new("rockbox.v1alpha1.SoundService", "SystemSoundPlay"), 7896 + ); 6806 7897 self.inner.unary(req, path, codec).await 6807 7898 } 6808 7899 pub async fn keyclick_click( 6809 7900 &mut self, 6810 7901 request: impl tonic::IntoRequest<super::KeyclickClickRequest>, 6811 - ) -> std::result::Result<tonic::Response<super::KeyclickClickResponse>, tonic::Status> 6812 - { 6813 - self.inner.ready().await.map_err(|e| { 6814 - tonic::Status::unknown(format!("Service was not ready: {}", e.into())) 6815 - })?; 7902 + ) -> std::result::Result< 7903 + tonic::Response<super::KeyclickClickResponse>, 7904 + tonic::Status, 7905 + > { 7906 + self.inner 7907 + .ready() 7908 + .await 7909 + .map_err(|e| { 7910 + tonic::Status::unknown( 7911 + format!("Service was not ready: {}", e.into()), 7912 + ) 7913 + })?; 6816 7914 let codec = tonic::codec::ProstCodec::default(); 6817 7915 let path = http::uri::PathAndQuery::from_static( 6818 7916 "/rockbox.v1alpha1.SoundService/KeyclickClick", 6819 7917 ); 6820 7918 let mut req = request.into_request(); 6821 - req.extensions_mut().insert(GrpcMethod::new( 6822 - "rockbox.v1alpha1.SoundService", 6823 - "KeyclickClick", 6824 - )); 7919 + req.extensions_mut() 7920 + .insert( 7921 + GrpcMethod::new("rockbox.v1alpha1.SoundService", "KeyclickClick"), 7922 + ); 6825 7923 self.inner.unary(req, path, codec).await 6826 7924 } 6827 7925 } ··· 6833 7931 dead_code, 6834 7932 missing_docs, 6835 7933 clippy::wildcard_imports, 6836 - clippy::let_unit_value 7934 + clippy::let_unit_value, 6837 7935 )] 6838 7936 use tonic::codegen::*; 6839 7937 /// Generated trait containing gRPC methods that should be implemented for use with SoundServiceServer. ··· 6842 7940 async fn adjust_volume( 6843 7941 &self, 6844 7942 request: tonic::Request<super::AdjustVolumeRequest>, 6845 - ) -> std::result::Result<tonic::Response<super::AdjustVolumeResponse>, tonic::Status>; 7943 + ) -> std::result::Result< 7944 + tonic::Response<super::AdjustVolumeResponse>, 7945 + tonic::Status, 7946 + >; 6846 7947 async fn sound_set( 6847 7948 &self, 6848 7949 request: tonic::Request<super::SoundSetRequest>, 6849 - ) -> std::result::Result<tonic::Response<super::SoundSetResponse>, tonic::Status>; 7950 + ) -> std::result::Result< 7951 + tonic::Response<super::SoundSetResponse>, 7952 + tonic::Status, 7953 + >; 6850 7954 async fn sound_current( 6851 7955 &self, 6852 7956 request: tonic::Request<super::SoundCurrentRequest>, 6853 - ) -> std::result::Result<tonic::Response<super::SoundCurrentResponse>, tonic::Status>; 7957 + ) -> std::result::Result< 7958 + tonic::Response<super::SoundCurrentResponse>, 7959 + tonic::Status, 7960 + >; 6854 7961 async fn sound_default( 6855 7962 &self, 6856 7963 request: tonic::Request<super::SoundDefaultRequest>, 6857 - ) -> std::result::Result<tonic::Response<super::SoundDefaultResponse>, tonic::Status>; 7964 + ) -> std::result::Result< 7965 + tonic::Response<super::SoundDefaultResponse>, 7966 + tonic::Status, 7967 + >; 6858 7968 async fn sound_min( 6859 7969 &self, 6860 7970 request: tonic::Request<super::SoundMinRequest>, 6861 - ) -> std::result::Result<tonic::Response<super::SoundMinResponse>, tonic::Status>; 7971 + ) -> std::result::Result< 7972 + tonic::Response<super::SoundMinResponse>, 7973 + tonic::Status, 7974 + >; 6862 7975 async fn sound_max( 6863 7976 &self, 6864 7977 request: tonic::Request<super::SoundMaxRequest>, 6865 - ) -> std::result::Result<tonic::Response<super::SoundMaxResponse>, tonic::Status>; 7978 + ) -> std::result::Result< 7979 + tonic::Response<super::SoundMaxResponse>, 7980 + tonic::Status, 7981 + >; 6866 7982 async fn sound_unit( 6867 7983 &self, 6868 7984 request: tonic::Request<super::SoundUnitRequest>, 6869 - ) -> std::result::Result<tonic::Response<super::SoundUnitResponse>, tonic::Status>; 7985 + ) -> std::result::Result< 7986 + tonic::Response<super::SoundUnitResponse>, 7987 + tonic::Status, 7988 + >; 6870 7989 async fn sound_val2_phys( 6871 7990 &self, 6872 7991 request: tonic::Request<super::SoundVal2PhysRequest>, 6873 - ) -> std::result::Result<tonic::Response<super::SoundVal2PhysResponse>, tonic::Status>; 7992 + ) -> std::result::Result< 7993 + tonic::Response<super::SoundVal2PhysResponse>, 7994 + tonic::Status, 7995 + >; 6874 7996 async fn get_pitch( 6875 7997 &self, 6876 7998 request: tonic::Request<super::GetPitchRequest>, 6877 - ) -> std::result::Result<tonic::Response<super::GetPitchResponse>, tonic::Status>; 7999 + ) -> std::result::Result< 8000 + tonic::Response<super::GetPitchResponse>, 8001 + tonic::Status, 8002 + >; 6878 8003 async fn set_pitch( 6879 8004 &self, 6880 8005 request: tonic::Request<super::SetPitchRequest>, 6881 - ) -> std::result::Result<tonic::Response<super::SetPitchResponse>, tonic::Status>; 8006 + ) -> std::result::Result< 8007 + tonic::Response<super::SetPitchResponse>, 8008 + tonic::Status, 8009 + >; 6882 8010 async fn beep_play( 6883 8011 &self, 6884 8012 request: tonic::Request<super::BeepPlayRequest>, 6885 - ) -> std::result::Result<tonic::Response<super::BeepPlayResponse>, tonic::Status>; 8013 + ) -> std::result::Result< 8014 + tonic::Response<super::BeepPlayResponse>, 8015 + tonic::Status, 8016 + >; 6886 8017 async fn pcmbuf_fade( 6887 8018 &self, 6888 8019 request: tonic::Request<super::PcmbufFadeRequest>, 6889 - ) -> std::result::Result<tonic::Response<super::PcmbufFadeResponse>, tonic::Status>; 8020 + ) -> std::result::Result< 8021 + tonic::Response<super::PcmbufFadeResponse>, 8022 + tonic::Status, 8023 + >; 6890 8024 async fn pcmbuf_set_low_latency( 6891 8025 &self, 6892 8026 request: tonic::Request<super::PcmbufSetLowLatencyRequest>, 6893 - ) -> std::result::Result<tonic::Response<super::PcmbufSetLowLatencyResponse>, tonic::Status>; 8027 + ) -> std::result::Result< 8028 + tonic::Response<super::PcmbufSetLowLatencyResponse>, 8029 + tonic::Status, 8030 + >; 6894 8031 async fn system_sound_play( 6895 8032 &self, 6896 8033 request: tonic::Request<super::SystemSoundPlayRequest>, 6897 - ) -> std::result::Result<tonic::Response<super::SystemSoundPlayResponse>, tonic::Status>; 8034 + ) -> std::result::Result< 8035 + tonic::Response<super::SystemSoundPlayResponse>, 8036 + tonic::Status, 8037 + >; 6898 8038 async fn keyclick_click( 6899 8039 &self, 6900 8040 request: tonic::Request<super::KeyclickClickRequest>, 6901 - ) -> std::result::Result<tonic::Response<super::KeyclickClickResponse>, tonic::Status>; 8041 + ) -> std::result::Result< 8042 + tonic::Response<super::KeyclickClickResponse>, 8043 + tonic::Status, 8044 + >; 6902 8045 } 6903 8046 #[derive(Debug)] 6904 8047 pub struct SoundServiceServer<T> { ··· 6921 8064 max_encoding_message_size: None, 6922 8065 } 6923 8066 } 6924 - pub fn with_interceptor<F>(inner: T, interceptor: F) -> InterceptedService<Self, F> 8067 + pub fn with_interceptor<F>( 8068 + inner: T, 8069 + interceptor: F, 8070 + ) -> InterceptedService<Self, F> 6925 8071 where 6926 8072 F: tonic::service::Interceptor, 6927 8073 { ··· 6976 8122 "/rockbox.v1alpha1.SoundService/AdjustVolume" => { 6977 8123 #[allow(non_camel_case_types)] 6978 8124 struct AdjustVolumeSvc<T: SoundService>(pub Arc<T>); 6979 - impl<T: SoundService> tonic::server::UnaryService<super::AdjustVolumeRequest> 6980 - for AdjustVolumeSvc<T> 6981 - { 8125 + impl< 8126 + T: SoundService, 8127 + > tonic::server::UnaryService<super::AdjustVolumeRequest> 8128 + for AdjustVolumeSvc<T> { 6982 8129 type Response = super::AdjustVolumeResponse; 6983 - type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>; 8130 + type Future = BoxFuture< 8131 + tonic::Response<Self::Response>, 8132 + tonic::Status, 8133 + >; 6984 8134 fn call( 6985 8135 &mut self, 6986 8136 request: tonic::Request<super::AdjustVolumeRequest>, ··· 7017 8167 "/rockbox.v1alpha1.SoundService/SoundSet" => { 7018 8168 #[allow(non_camel_case_types)] 7019 8169 struct SoundSetSvc<T: SoundService>(pub Arc<T>); 7020 - impl<T: SoundService> tonic::server::UnaryService<super::SoundSetRequest> for SoundSetSvc<T> { 8170 + impl< 8171 + T: SoundService, 8172 + > tonic::server::UnaryService<super::SoundSetRequest> 8173 + for SoundSetSvc<T> { 7021 8174 type Response = super::SoundSetResponse; 7022 - type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>; 8175 + type Future = BoxFuture< 8176 + tonic::Response<Self::Response>, 8177 + tonic::Status, 8178 + >; 7023 8179 fn call( 7024 8180 &mut self, 7025 8181 request: tonic::Request<super::SoundSetRequest>, ··· 7056 8212 "/rockbox.v1alpha1.SoundService/SoundCurrent" => { 7057 8213 #[allow(non_camel_case_types)] 7058 8214 struct SoundCurrentSvc<T: SoundService>(pub Arc<T>); 7059 - impl<T: SoundService> tonic::server::UnaryService<super::SoundCurrentRequest> 7060 - for SoundCurrentSvc<T> 7061 - { 8215 + impl< 8216 + T: SoundService, 8217 + > tonic::server::UnaryService<super::SoundCurrentRequest> 8218 + for SoundCurrentSvc<T> { 7062 8219 type Response = super::SoundCurrentResponse; 7063 - type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>; 8220 + type Future = BoxFuture< 8221 + tonic::Response<Self::Response>, 8222 + tonic::Status, 8223 + >; 7064 8224 fn call( 7065 8225 &mut self, 7066 8226 request: tonic::Request<super::SoundCurrentRequest>, ··· 7097 8257 "/rockbox.v1alpha1.SoundService/SoundDefault" => { 7098 8258 #[allow(non_camel_case_types)] 7099 8259 struct SoundDefaultSvc<T: SoundService>(pub Arc<T>); 7100 - impl<T: SoundService> tonic::server::UnaryService<super::SoundDefaultRequest> 7101 - for SoundDefaultSvc<T> 7102 - { 8260 + impl< 8261 + T: SoundService, 8262 + > tonic::server::UnaryService<super::SoundDefaultRequest> 8263 + for SoundDefaultSvc<T> { 7103 8264 type Response = super::SoundDefaultResponse; 7104 - type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>; 8265 + type Future = BoxFuture< 8266 + tonic::Response<Self::Response>, 8267 + tonic::Status, 8268 + >; 7105 8269 fn call( 7106 8270 &mut self, 7107 8271 request: tonic::Request<super::SoundDefaultRequest>, ··· 7138 8302 "/rockbox.v1alpha1.SoundService/SoundMin" => { 7139 8303 #[allow(non_camel_case_types)] 7140 8304 struct SoundMinSvc<T: SoundService>(pub Arc<T>); 7141 - impl<T: SoundService> tonic::server::UnaryService<super::SoundMinRequest> for SoundMinSvc<T> { 8305 + impl< 8306 + T: SoundService, 8307 + > tonic::server::UnaryService<super::SoundMinRequest> 8308 + for SoundMinSvc<T> { 7142 8309 type Response = super::SoundMinResponse; 7143 - type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>; 8310 + type Future = BoxFuture< 8311 + tonic::Response<Self::Response>, 8312 + tonic::Status, 8313 + >; 7144 8314 fn call( 7145 8315 &mut self, 7146 8316 request: tonic::Request<super::SoundMinRequest>, ··· 7177 8347 "/rockbox.v1alpha1.SoundService/SoundMax" => { 7178 8348 #[allow(non_camel_case_types)] 7179 8349 struct SoundMaxSvc<T: SoundService>(pub Arc<T>); 7180 - impl<T: SoundService> tonic::server::UnaryService<super::SoundMaxRequest> for SoundMaxSvc<T> { 8350 + impl< 8351 + T: SoundService, 8352 + > tonic::server::UnaryService<super::SoundMaxRequest> 8353 + for SoundMaxSvc<T> { 7181 8354 type Response = super::SoundMaxResponse; 7182 - type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>; 8355 + type Future = BoxFuture< 8356 + tonic::Response<Self::Response>, 8357 + tonic::Status, 8358 + >; 7183 8359 fn call( 7184 8360 &mut self, 7185 8361 request: tonic::Request<super::SoundMaxRequest>, ··· 7216 8392 "/rockbox.v1alpha1.SoundService/SoundUnit" => { 7217 8393 #[allow(non_camel_case_types)] 7218 8394 struct SoundUnitSvc<T: SoundService>(pub Arc<T>); 7219 - impl<T: SoundService> tonic::server::UnaryService<super::SoundUnitRequest> for SoundUnitSvc<T> { 8395 + impl< 8396 + T: SoundService, 8397 + > tonic::server::UnaryService<super::SoundUnitRequest> 8398 + for SoundUnitSvc<T> { 7220 8399 type Response = super::SoundUnitResponse; 7221 - type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>; 8400 + type Future = BoxFuture< 8401 + tonic::Response<Self::Response>, 8402 + tonic::Status, 8403 + >; 7222 8404 fn call( 7223 8405 &mut self, 7224 8406 request: tonic::Request<super::SoundUnitRequest>, ··· 7255 8437 "/rockbox.v1alpha1.SoundService/SoundVal2Phys" => { 7256 8438 #[allow(non_camel_case_types)] 7257 8439 struct SoundVal2PhysSvc<T: SoundService>(pub Arc<T>); 7258 - impl<T: SoundService> tonic::server::UnaryService<super::SoundVal2PhysRequest> 7259 - for SoundVal2PhysSvc<T> 7260 - { 8440 + impl< 8441 + T: SoundService, 8442 + > tonic::server::UnaryService<super::SoundVal2PhysRequest> 8443 + for SoundVal2PhysSvc<T> { 7261 8444 type Response = super::SoundVal2PhysResponse; 7262 - type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>; 8445 + type Future = BoxFuture< 8446 + tonic::Response<Self::Response>, 8447 + tonic::Status, 8448 + >; 7263 8449 fn call( 7264 8450 &mut self, 7265 8451 request: tonic::Request<super::SoundVal2PhysRequest>, ··· 7296 8482 "/rockbox.v1alpha1.SoundService/GetPitch" => { 7297 8483 #[allow(non_camel_case_types)] 7298 8484 struct GetPitchSvc<T: SoundService>(pub Arc<T>); 7299 - impl<T: SoundService> tonic::server::UnaryService<super::GetPitchRequest> for GetPitchSvc<T> { 8485 + impl< 8486 + T: SoundService, 8487 + > tonic::server::UnaryService<super::GetPitchRequest> 8488 + for GetPitchSvc<T> { 7300 8489 type Response = super::GetPitchResponse; 7301 - type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>; 8490 + type Future = BoxFuture< 8491 + tonic::Response<Self::Response>, 8492 + tonic::Status, 8493 + >; 7302 8494 fn call( 7303 8495 &mut self, 7304 8496 request: tonic::Request<super::GetPitchRequest>, ··· 7335 8527 "/rockbox.v1alpha1.SoundService/SetPitch" => { 7336 8528 #[allow(non_camel_case_types)] 7337 8529 struct SetPitchSvc<T: SoundService>(pub Arc<T>); 7338 - impl<T: SoundService> tonic::server::UnaryService<super::SetPitchRequest> for SetPitchSvc<T> { 8530 + impl< 8531 + T: SoundService, 8532 + > tonic::server::UnaryService<super::SetPitchRequest> 8533 + for SetPitchSvc<T> { 7339 8534 type Response = super::SetPitchResponse; 7340 - type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>; 8535 + type Future = BoxFuture< 8536 + tonic::Response<Self::Response>, 8537 + tonic::Status, 8538 + >; 7341 8539 fn call( 7342 8540 &mut self, 7343 8541 request: tonic::Request<super::SetPitchRequest>, ··· 7374 8572 "/rockbox.v1alpha1.SoundService/BeepPlay" => { 7375 8573 #[allow(non_camel_case_types)] 7376 8574 struct BeepPlaySvc<T: SoundService>(pub Arc<T>); 7377 - impl<T: SoundService> tonic::server::UnaryService<super::BeepPlayRequest> for BeepPlaySvc<T> { 8575 + impl< 8576 + T: SoundService, 8577 + > tonic::server::UnaryService<super::BeepPlayRequest> 8578 + for BeepPlaySvc<T> { 7378 8579 type Response = super::BeepPlayResponse; 7379 - type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>; 8580 + type Future = BoxFuture< 8581 + tonic::Response<Self::Response>, 8582 + tonic::Status, 8583 + >; 7380 8584 fn call( 7381 8585 &mut self, 7382 8586 request: tonic::Request<super::BeepPlayRequest>, ··· 7413 8617 "/rockbox.v1alpha1.SoundService/PcmbufFade" => { 7414 8618 #[allow(non_camel_case_types)] 7415 8619 struct PcmbufFadeSvc<T: SoundService>(pub Arc<T>); 7416 - impl<T: SoundService> tonic::server::UnaryService<super::PcmbufFadeRequest> for PcmbufFadeSvc<T> { 8620 + impl< 8621 + T: SoundService, 8622 + > tonic::server::UnaryService<super::PcmbufFadeRequest> 8623 + for PcmbufFadeSvc<T> { 7417 8624 type Response = super::PcmbufFadeResponse; 7418 - type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>; 8625 + type Future = BoxFuture< 8626 + tonic::Response<Self::Response>, 8627 + tonic::Status, 8628 + >; 7419 8629 fn call( 7420 8630 &mut self, 7421 8631 request: tonic::Request<super::PcmbufFadeRequest>, ··· 7452 8662 "/rockbox.v1alpha1.SoundService/PcmbufSetLowLatency" => { 7453 8663 #[allow(non_camel_case_types)] 7454 8664 struct PcmbufSetLowLatencySvc<T: SoundService>(pub Arc<T>); 7455 - impl<T: SoundService> 7456 - tonic::server::UnaryService<super::PcmbufSetLowLatencyRequest> 7457 - for PcmbufSetLowLatencySvc<T> 7458 - { 8665 + impl< 8666 + T: SoundService, 8667 + > tonic::server::UnaryService<super::PcmbufSetLowLatencyRequest> 8668 + for PcmbufSetLowLatencySvc<T> { 7459 8669 type Response = super::PcmbufSetLowLatencyResponse; 7460 - type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>; 8670 + type Future = BoxFuture< 8671 + tonic::Response<Self::Response>, 8672 + tonic::Status, 8673 + >; 7461 8674 fn call( 7462 8675 &mut self, 7463 8676 request: tonic::Request<super::PcmbufSetLowLatencyRequest>, 7464 8677 ) -> Self::Future { 7465 8678 let inner = Arc::clone(&self.0); 7466 8679 let fut = async move { 7467 - <T as SoundService>::pcmbuf_set_low_latency(&inner, request).await 8680 + <T as SoundService>::pcmbuf_set_low_latency(&inner, request) 8681 + .await 7468 8682 }; 7469 8683 Box::pin(fut) 7470 8684 } ··· 7494 8708 "/rockbox.v1alpha1.SoundService/SystemSoundPlay" => { 7495 8709 #[allow(non_camel_case_types)] 7496 8710 struct SystemSoundPlaySvc<T: SoundService>(pub Arc<T>); 7497 - impl<T: SoundService> tonic::server::UnaryService<super::SystemSoundPlayRequest> 7498 - for SystemSoundPlaySvc<T> 7499 - { 8711 + impl< 8712 + T: SoundService, 8713 + > tonic::server::UnaryService<super::SystemSoundPlayRequest> 8714 + for SystemSoundPlaySvc<T> { 7500 8715 type Response = super::SystemSoundPlayResponse; 7501 - type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>; 8716 + type Future = BoxFuture< 8717 + tonic::Response<Self::Response>, 8718 + tonic::Status, 8719 + >; 7502 8720 fn call( 7503 8721 &mut self, 7504 8722 request: tonic::Request<super::SystemSoundPlayRequest>, 7505 8723 ) -> Self::Future { 7506 8724 let inner = Arc::clone(&self.0); 7507 8725 let fut = async move { 7508 - <T as SoundService>::system_sound_play(&inner, request).await 8726 + <T as SoundService>::system_sound_play(&inner, request) 8727 + .await 7509 8728 }; 7510 8729 Box::pin(fut) 7511 8730 } ··· 7535 8754 "/rockbox.v1alpha1.SoundService/KeyclickClick" => { 7536 8755 #[allow(non_camel_case_types)] 7537 8756 struct KeyclickClickSvc<T: SoundService>(pub Arc<T>); 7538 - impl<T: SoundService> tonic::server::UnaryService<super::KeyclickClickRequest> 7539 - for KeyclickClickSvc<T> 7540 - { 8757 + impl< 8758 + T: SoundService, 8759 + > tonic::server::UnaryService<super::KeyclickClickRequest> 8760 + for KeyclickClickSvc<T> { 7541 8761 type Response = super::KeyclickClickResponse; 7542 - type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>; 8762 + type Future = BoxFuture< 8763 + tonic::Response<Self::Response>, 8764 + tonic::Status, 8765 + >; 7543 8766 fn call( 7544 8767 &mut self, 7545 8768 request: tonic::Request<super::KeyclickClickRequest>, ··· 7573 8796 }; 7574 8797 Box::pin(fut) 7575 8798 } 7576 - _ => Box::pin(async move { 7577 - let mut response = http::Response::new(empty_body()); 7578 - let headers = response.headers_mut(); 7579 - headers.insert( 7580 - tonic::Status::GRPC_STATUS, 7581 - (tonic::Code::Unimplemented as i32).into(), 7582 - ); 7583 - headers.insert( 7584 - http::header::CONTENT_TYPE, 7585 - tonic::metadata::GRPC_CONTENT_TYPE, 7586 - ); 7587 - Ok(response) 7588 - }), 8799 + _ => { 8800 + Box::pin(async move { 8801 + let mut response = http::Response::new(empty_body()); 8802 + let headers = response.headers_mut(); 8803 + headers 8804 + .insert( 8805 + tonic::Status::GRPC_STATUS, 8806 + (tonic::Code::Unimplemented as i32).into(), 8807 + ); 8808 + headers 8809 + .insert( 8810 + http::header::CONTENT_TYPE, 8811 + tonic::metadata::GRPC_CONTENT_TYPE, 8812 + ); 8813 + Ok(response) 8814 + }) 8815 + } 7589 8816 } 7590 8817 } 7591 8818 } ··· 7646 8873 dead_code, 7647 8874 missing_docs, 7648 8875 clippy::wildcard_imports, 7649 - clippy::let_unit_value 8876 + clippy::let_unit_value, 7650 8877 )] 8878 + use tonic::codegen::*; 7651 8879 use tonic::codegen::http::Uri; 7652 - use tonic::codegen::*; 7653 8880 #[derive(Debug, Clone)] 7654 8881 pub struct SystemServiceClient<T> { 7655 8882 inner: tonic::client::Grpc<T>, ··· 7693 8920 <T as tonic::client::GrpcService<tonic::body::BoxBody>>::ResponseBody, 7694 8921 >, 7695 8922 >, 7696 - <T as tonic::codegen::Service<http::Request<tonic::body::BoxBody>>>::Error: 7697 - Into<StdError> + std::marker::Send + std::marker::Sync, 8923 + <T as tonic::codegen::Service< 8924 + http::Request<tonic::body::BoxBody>, 8925 + >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync, 7698 8926 { 7699 8927 SystemServiceClient::new(InterceptedService::new(inner, interceptor)) 7700 8928 } ··· 7732 8960 pub async fn get_rockbox_version( 7733 8961 &mut self, 7734 8962 request: impl tonic::IntoRequest<super::GetRockboxVersionRequest>, 7735 - ) -> std::result::Result<tonic::Response<super::GetRockboxVersionResponse>, tonic::Status> 7736 - { 7737 - self.inner.ready().await.map_err(|e| { 7738 - tonic::Status::unknown(format!("Service was not ready: {}", e.into())) 7739 - })?; 8963 + ) -> std::result::Result< 8964 + tonic::Response<super::GetRockboxVersionResponse>, 8965 + tonic::Status, 8966 + > { 8967 + self.inner 8968 + .ready() 8969 + .await 8970 + .map_err(|e| { 8971 + tonic::Status::unknown( 8972 + format!("Service was not ready: {}", e.into()), 8973 + ) 8974 + })?; 7740 8975 let codec = tonic::codec::ProstCodec::default(); 7741 8976 let path = http::uri::PathAndQuery::from_static( 7742 8977 "/rockbox.v1alpha1.SystemService/GetRockboxVersion", 7743 8978 ); 7744 8979 let mut req = request.into_request(); 7745 - req.extensions_mut().insert(GrpcMethod::new( 7746 - "rockbox.v1alpha1.SystemService", 7747 - "GetRockboxVersion", 7748 - )); 8980 + req.extensions_mut() 8981 + .insert( 8982 + GrpcMethod::new( 8983 + "rockbox.v1alpha1.SystemService", 8984 + "GetRockboxVersion", 8985 + ), 8986 + ); 7749 8987 self.inner.unary(req, path, codec).await 7750 8988 } 7751 8989 pub async fn get_global_status( 7752 8990 &mut self, 7753 8991 request: impl tonic::IntoRequest<super::GetGlobalStatusRequest>, 7754 - ) -> std::result::Result<tonic::Response<super::GetGlobalStatusResponse>, tonic::Status> 7755 - { 7756 - self.inner.ready().await.map_err(|e| { 7757 - tonic::Status::unknown(format!("Service was not ready: {}", e.into())) 7758 - })?; 8992 + ) -> std::result::Result< 8993 + tonic::Response<super::GetGlobalStatusResponse>, 8994 + tonic::Status, 8995 + > { 8996 + self.inner 8997 + .ready() 8998 + .await 8999 + .map_err(|e| { 9000 + tonic::Status::unknown( 9001 + format!("Service was not ready: {}", e.into()), 9002 + ) 9003 + })?; 7759 9004 let codec = tonic::codec::ProstCodec::default(); 7760 9005 let path = http::uri::PathAndQuery::from_static( 7761 9006 "/rockbox.v1alpha1.SystemService/GetGlobalStatus", 7762 9007 ); 7763 9008 let mut req = request.into_request(); 7764 - req.extensions_mut().insert(GrpcMethod::new( 7765 - "rockbox.v1alpha1.SystemService", 7766 - "GetGlobalStatus", 7767 - )); 9009 + req.extensions_mut() 9010 + .insert( 9011 + GrpcMethod::new("rockbox.v1alpha1.SystemService", "GetGlobalStatus"), 9012 + ); 7768 9013 self.inner.unary(req, path, codec).await 7769 9014 } 7770 9015 } ··· 7776 9021 dead_code, 7777 9022 missing_docs, 7778 9023 clippy::wildcard_imports, 7779 - clippy::let_unit_value 9024 + clippy::let_unit_value, 7780 9025 )] 7781 9026 use tonic::codegen::*; 7782 9027 /// Generated trait containing gRPC methods that should be implemented for use with SystemServiceServer. ··· 7785 9030 async fn get_rockbox_version( 7786 9031 &self, 7787 9032 request: tonic::Request<super::GetRockboxVersionRequest>, 7788 - ) -> std::result::Result<tonic::Response<super::GetRockboxVersionResponse>, tonic::Status>; 9033 + ) -> std::result::Result< 9034 + tonic::Response<super::GetRockboxVersionResponse>, 9035 + tonic::Status, 9036 + >; 7789 9037 async fn get_global_status( 7790 9038 &self, 7791 9039 request: tonic::Request<super::GetGlobalStatusRequest>, 7792 - ) -> std::result::Result<tonic::Response<super::GetGlobalStatusResponse>, tonic::Status>; 9040 + ) -> std::result::Result< 9041 + tonic::Response<super::GetGlobalStatusResponse>, 9042 + tonic::Status, 9043 + >; 7793 9044 } 7794 9045 #[derive(Debug)] 7795 9046 pub struct SystemServiceServer<T> { ··· 7812 9063 max_encoding_message_size: None, 7813 9064 } 7814 9065 } 7815 - pub fn with_interceptor<F>(inner: T, interceptor: F) -> InterceptedService<Self, F> 9066 + pub fn with_interceptor<F>( 9067 + inner: T, 9068 + interceptor: F, 9069 + ) -> InterceptedService<Self, F> 7816 9070 where 7817 9071 F: tonic::service::Interceptor, 7818 9072 { ··· 7867 9121 "/rockbox.v1alpha1.SystemService/GetRockboxVersion" => { 7868 9122 #[allow(non_camel_case_types)] 7869 9123 struct GetRockboxVersionSvc<T: SystemService>(pub Arc<T>); 7870 - impl<T: SystemService> 7871 - tonic::server::UnaryService<super::GetRockboxVersionRequest> 7872 - for GetRockboxVersionSvc<T> 7873 - { 9124 + impl< 9125 + T: SystemService, 9126 + > tonic::server::UnaryService<super::GetRockboxVersionRequest> 9127 + for GetRockboxVersionSvc<T> { 7874 9128 type Response = super::GetRockboxVersionResponse; 7875 - type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>; 9129 + type Future = BoxFuture< 9130 + tonic::Response<Self::Response>, 9131 + tonic::Status, 9132 + >; 7876 9133 fn call( 7877 9134 &mut self, 7878 9135 request: tonic::Request<super::GetRockboxVersionRequest>, 7879 9136 ) -> Self::Future { 7880 9137 let inner = Arc::clone(&self.0); 7881 9138 let fut = async move { 7882 - <T as SystemService>::get_rockbox_version(&inner, request).await 9139 + <T as SystemService>::get_rockbox_version(&inner, request) 9140 + .await 7883 9141 }; 7884 9142 Box::pin(fut) 7885 9143 } ··· 7909 9167 "/rockbox.v1alpha1.SystemService/GetGlobalStatus" => { 7910 9168 #[allow(non_camel_case_types)] 7911 9169 struct GetGlobalStatusSvc<T: SystemService>(pub Arc<T>); 7912 - impl<T: SystemService> 7913 - tonic::server::UnaryService<super::GetGlobalStatusRequest> 7914 - for GetGlobalStatusSvc<T> 7915 - { 9170 + impl< 9171 + T: SystemService, 9172 + > tonic::server::UnaryService<super::GetGlobalStatusRequest> 9173 + for GetGlobalStatusSvc<T> { 7916 9174 type Response = super::GetGlobalStatusResponse; 7917 - type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>; 9175 + type Future = BoxFuture< 9176 + tonic::Response<Self::Response>, 9177 + tonic::Status, 9178 + >; 7918 9179 fn call( 7919 9180 &mut self, 7920 9181 request: tonic::Request<super::GetGlobalStatusRequest>, 7921 9182 ) -> Self::Future { 7922 9183 let inner = Arc::clone(&self.0); 7923 9184 let fut = async move { 7924 - <T as SystemService>::get_global_status(&inner, request).await 9185 + <T as SystemService>::get_global_status(&inner, request) 9186 + .await 7925 9187 }; 7926 9188 Box::pin(fut) 7927 9189 } ··· 7948 9210 }; 7949 9211 Box::pin(fut) 7950 9212 } 7951 - _ => Box::pin(async move { 7952 - let mut response = http::Response::new(empty_body()); 7953 - let headers = response.headers_mut(); 7954 - headers.insert( 7955 - tonic::Status::GRPC_STATUS, 7956 - (tonic::Code::Unimplemented as i32).into(), 7957 - ); 7958 - headers.insert( 7959 - http::header::CONTENT_TYPE, 7960 - tonic::metadata::GRPC_CONTENT_TYPE, 7961 - ); 7962 - Ok(response) 7963 - }), 9213 + _ => { 9214 + Box::pin(async move { 9215 + let mut response = http::Response::new(empty_body()); 9216 + let headers = response.headers_mut(); 9217 + headers 9218 + .insert( 9219 + tonic::Status::GRPC_STATUS, 9220 + (tonic::Code::Unimplemented as i32).into(), 9221 + ); 9222 + headers 9223 + .insert( 9224 + http::header::CONTENT_TYPE, 9225 + tonic::metadata::GRPC_CONTENT_TYPE, 9226 + ); 9227 + Ok(response) 9228 + }) 9229 + } 7964 9230 } 7965 9231 } 7966 9232 }
+2
crates/rpc/src/lib.rs
··· 931 931 }), 932 932 audio_output: None, 933 933 fifo_path: None, 934 + airplay_host: None, 935 + airplay_port: None, 934 936 } 935 937 } 936 938 }
-1
crates/server/src/http.rs
··· 1 1 use anyhow::Error; 2 - use owo_colors::OwoColorize; 3 2 use rockbox_library::entity::track::Track; 4 3 use rockbox_sys::{ 5 4 self as rb,
+6
crates/settings/src/lib.rs
··· 33 33 let path = settings.fifo_path.as_deref().unwrap_or("/tmp/rockbox.fifo"); 34 34 pcm::fifo_set_path(path); 35 35 pcm::switch_sink(pcm::PCM_SINK_FIFO); 36 + } else if output == "airplay" { 37 + if let Some(ref host) = settings.airplay_host { 38 + let port = settings.airplay_port.unwrap_or(5000); 39 + pcm::airplay_set_host(host, port); 40 + pcm::switch_sink(pcm::PCM_SINK_AIRPLAY); 41 + } 36 42 } 37 43 } 38 44
+2 -1
crates/sys/src/lib.rs
··· 1 - use std::ffi::{c_char, c_int, c_long, c_uchar, c_uint, c_ulong, c_void}; 1 + use std::ffi::{c_char, c_int, c_long, c_uchar, c_uint, c_ulong, c_ushort, c_void}; 2 2 3 3 pub mod browse; 4 4 pub mod dir; ··· 1148 1148 fn pcm_play_unlock(); 1149 1149 fn pcm_switch_sink(sink: c_int) -> c_uchar; 1150 1150 fn pcm_fifo_set_path(path: *const c_char); 1151 + fn pcm_airplay_set_host(host: *const c_char, port: c_ushort); 1151 1152 fn beep_play(frequency: c_uint, duration: c_uint, amplitude: c_uint); 1152 1153 fn dsp_set_crossfeed_type(r#type: c_int); 1153 1154 fn dsp_eq_enable(enable: c_uchar);
+8
crates/sys/src/sound/pcm.rs
··· 4 4 5 5 pub const PCM_SINK_BUILTIN: i32 = 0; 6 6 pub const PCM_SINK_FIFO: i32 = 1; 7 + pub const PCM_SINK_AIRPLAY: i32 = 2; 7 8 8 9 pub fn apply_settings() { 9 10 unsafe { ··· 49 50 50 51 pub fn switch_sink(sink: i32) -> bool { 51 52 unsafe { crate::pcm_switch_sink(sink) != 0 } 53 + } 54 + 55 + pub fn airplay_set_host(host: &str, port: u16) { 56 + use std::ffi::CString; 57 + let chost = CString::new(host).expect("host must not contain null bytes"); 58 + unsafe { crate::pcm_airplay_set_host(chost.as_ptr(), port) } 59 + std::mem::forget(chost); 52 60 } 53 61 54 62 pub fn fifo_set_path(path: &str) {
+7 -1
crates/sys/src/types/user_settings.rs
··· 677 677 pub eq_band_settings: Option<Vec<EqBandSetting>>, 678 678 pub replaygain_settings: Option<ReplaygainSettings>, 679 679 pub compressor_settings: Option<CompressorSettings>, 680 - /// Audio output sink: "builtin" (default) or "fifo" 680 + /// Audio output sink: "builtin" (default), "fifo", or "airplay" 681 681 pub audio_output: Option<String>, 682 682 /// Path for the FIFO sink, e.g. "/tmp/rockbox.fifo" or "-" for stdout 683 683 pub fifo_path: Option<String>, 684 + /// IP address or hostname of the AirPlay (RAOP) receiver 685 + pub airplay_host: Option<String>, 686 + /// RAOP port on the receiver (default: 5000) 687 + pub airplay_port: Option<u16>, 684 688 } 685 689 686 690 impl From<UserSettings> for NewGlobalSettings { ··· 716 720 compressor_settings: Some(settings.compressor_settings), 717 721 audio_output: None, 718 722 fifo_path: None, 723 + airplay_host: None, 724 + airplay_port: None, 719 725 } 720 726 } 721 727 }
+1
firmware/SOURCES
··· 537 537 pcm_mixer.c 538 538 #if (CONFIG_PLATFORM & PLATFORM_HOSTED) 539 539 target/hosted/pcm-fifo.c 540 + target/hosted/pcm-airplay.c 540 541 #endif 541 542 #ifdef HAVE_SW_VOLUME_CONTROL 542 543 pcm_sw_volume.c
+4
firmware/export/pcm_sink.h
··· 54 54 PCM_SINK_BUILTIN = 0, 55 55 #if (CONFIG_PLATFORM & PLATFORM_HOSTED) 56 56 PCM_SINK_FIFO, 57 + PCM_SINK_AIRPLAY, 57 58 #endif 58 59 PCM_SINK_NUM 59 60 }; ··· 65 66 /* FIFO/pipe sink — writes raw S16LE stereo PCM to a named FIFO or stdout */ 66 67 extern struct pcm_sink fifo_pcm_sink; 67 68 void pcm_fifo_set_path(const char *path); 69 + 70 + /* AirPlay (RAOP) sink — streams ALAC-encoded audio over RTP */ 71 + extern struct pcm_sink airplay_pcm_sink; 68 72 #endif
+3 -2
firmware/pcm.c
··· 79 79 */ 80 80 81 81 static struct pcm_sink* sinks[PCM_SINK_NUM] = { 82 - [PCM_SINK_BUILTIN] = &builtin_pcm_sink, 82 + [PCM_SINK_BUILTIN] = &builtin_pcm_sink, 83 83 #if (CONFIG_PLATFORM & PLATFORM_HOSTED) 84 - [PCM_SINK_FIFO] = &fifo_pcm_sink, 84 + [PCM_SINK_FIFO] = &fifo_pcm_sink, 85 + [PCM_SINK_AIRPLAY] = &airplay_pcm_sink, 85 86 #endif 86 87 }; 87 88 static enum pcm_sink_ids cur_sink = PCM_SINK_BUILTIN;
+177
firmware/target/hosted/pcm-airplay.c
··· 1 + /*************************************************************************** 2 + * PCM sink that encodes S16LE stereo PCM as ALAC escape frames and streams 3 + * them over RAOP (AirPlay 1) via UDP/RTP to a compatible receiver. 4 + * 5 + * Usage: 6 + * pcm_airplay_set_host("192.168.1.x", 5000); 7 + * pcm_switch_sink(PCM_SINK_AIRPLAY); 8 + * 9 + * Copyright (C) 2026 Rockbox contributors 10 + * 11 + * This program is free software; you can redistribute it and/or 12 + * modify it under the terms of the GNU General Public License 13 + * as published by the Free Software Foundation; either version 2 14 + * of the License, or (at your option) any later version. 15 + * 16 + * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY 17 + * KIND, either express or implied. 18 + * 19 + ****************************************************************************/ 20 + 21 + #include "autoconf.h" 22 + #include "config.h" 23 + 24 + #include <pthread.h> 25 + #include <stdbool.h> 26 + #include <stddef.h> 27 + #include <stdint.h> 28 + #include <string.h> 29 + 30 + #include "pcm.h" 31 + #include "pcm-internal.h" 32 + #include "pcm_mixer.h" 33 + #include "pcm_sampr.h" 34 + #include "pcm_sink.h" 35 + 36 + #define LOGF_ENABLE 37 + #include "logf.h" 38 + 39 + /* Rust C API — symbols are provided by the rockbox-airplay crate via 40 + * librockbox_cli.a. */ 41 + extern void pcm_airplay_set_host(const char *host, uint16_t port); 42 + extern int pcm_airplay_connect(void); 43 + extern int pcm_airplay_write(const uint8_t *data, size_t len); 44 + extern void pcm_airplay_stop(void); 45 + extern void pcm_airplay_close(void); 46 + 47 + static const void *pcm_data = NULL; 48 + static size_t pcm_size = 0; 49 + 50 + static pthread_mutex_t airplay_mtx; 51 + static pthread_t airplay_tid; 52 + static volatile bool airplay_running = false; 53 + static volatile bool airplay_stop = false; 54 + 55 + static void *airplay_thread(void *arg) 56 + { 57 + (void)arg; 58 + 59 + while (!airplay_stop) { 60 + pthread_mutex_lock(&airplay_mtx); 61 + const void *data = pcm_data; 62 + size_t size = pcm_size; 63 + pcm_data = NULL; 64 + pcm_size = 0; 65 + pthread_mutex_unlock(&airplay_mtx); 66 + 67 + if (data && size > 0) { 68 + if (pcm_airplay_write((const uint8_t *)data, size) < 0) { 69 + logf("pcm-airplay: write error"); 70 + airplay_stop = true; 71 + break; 72 + } 73 + } 74 + 75 + if (airplay_stop) 76 + break; 77 + 78 + pthread_mutex_lock(&airplay_mtx); 79 + bool got_more = pcm_play_dma_complete_callback(PCM_DMAST_OK, 80 + &pcm_data, &pcm_size); 81 + pthread_mutex_unlock(&airplay_mtx); 82 + 83 + if (!got_more) { 84 + logf("pcm-airplay: no more PCM data"); 85 + break; 86 + } 87 + 88 + pcm_play_dma_status_callback(PCM_DMAST_STARTED); 89 + } 90 + 91 + airplay_running = false; 92 + return NULL; 93 + } 94 + 95 + static void sink_dma_init(void) 96 + { 97 + pthread_mutexattr_t attr; 98 + pthread_mutexattr_init(&attr); 99 + pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE); 100 + pthread_mutex_init(&airplay_mtx, &attr); 101 + pthread_mutexattr_destroy(&attr); 102 + } 103 + 104 + static void sink_dma_postinit(void) 105 + { 106 + } 107 + 108 + static void sink_set_freq(uint16_t freq) 109 + { 110 + (void)freq; 111 + } 112 + 113 + static void sink_lock(void) 114 + { 115 + pthread_mutex_lock(&airplay_mtx); 116 + } 117 + 118 + static void sink_unlock(void) 119 + { 120 + pthread_mutex_unlock(&airplay_mtx); 121 + } 122 + 123 + static void sink_dma_start(const void *addr, size_t size) 124 + { 125 + logf("pcm-airplay: start (%p, %zu)", addr, size); 126 + 127 + /* Connect if not already connected */ 128 + if (pcm_airplay_connect() < 0) { 129 + logf("pcm-airplay: connect failed"); 130 + return; 131 + } 132 + 133 + pthread_mutex_lock(&airplay_mtx); 134 + pcm_data = addr; 135 + pcm_size = size; 136 + pthread_mutex_unlock(&airplay_mtx); 137 + 138 + airplay_stop = false; 139 + airplay_running = true; 140 + pthread_create(&airplay_tid, NULL, airplay_thread, NULL); 141 + } 142 + 143 + static void sink_dma_stop(void) 144 + { 145 + logf("pcm-airplay: stop"); 146 + 147 + airplay_stop = true; 148 + 149 + if (airplay_running) { 150 + pthread_join(airplay_tid, NULL); 151 + airplay_running = false; 152 + } 153 + 154 + pthread_mutex_lock(&airplay_mtx); 155 + pcm_data = NULL; 156 + pcm_size = 0; 157 + pthread_mutex_unlock(&airplay_mtx); 158 + 159 + pcm_airplay_stop(); 160 + } 161 + 162 + struct pcm_sink airplay_pcm_sink = { 163 + .caps = { 164 + .samprs = hw_freq_sampr, 165 + .num_samprs = HW_NUM_FREQ, 166 + .default_freq = HW_FREQ_DEFAULT, 167 + }, 168 + .ops = { 169 + .init = sink_dma_init, 170 + .postinit = sink_dma_postinit, 171 + .set_freq = sink_set_freq, 172 + .lock = sink_lock, 173 + .unlock = sink_unlock, 174 + .play = sink_dma_start, 175 + .stop = sink_dma_stop, 176 + }, 177 + };