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.

Add Squeezelite (Slim) PCM sink

Introduce a squeezelite sink: add rockbox-slim crate implementing a
broadcast buffer, Slim protocol server and HTTP audio endpoint; add
firmware pcm-squeezelite.c and register PCM_SINK_SQUEEZELITE. Add FFI
bindings, sys constant, and CLI force-link. Update settings to accept
audio_output = "squeezelite" and expose squeezelite_port /
squeezelite_http_port. Defaults: Slim 3483, HTTP 9999; streams raw S16LE
stereo to squeezelite clients.

+3222 -1248
+9
Cargo.lock
··· 9163 9163 "rockbox-library", 9164 9164 "rockbox-rocksky", 9165 9165 "rockbox-settings", 9166 + "rockbox-slim", 9166 9167 "rockbox-typesense", 9167 9168 "tokio", 9168 9169 "tracing", ··· 9405 9406 "anyhow", 9406 9407 "rockbox-sys", 9407 9408 "toml 0.8.19", 9409 + "tracing", 9410 + ] 9411 + 9412 + [[package]] 9413 + name = "rockbox-slim" 9414 + version = "0.1.0" 9415 + dependencies = [ 9416 + "tracing", 9408 9417 ] 9409 9418 9410 9419 [[package]]
+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 }
+1
crates/cli/Cargo.toml
··· 9 9 [dependencies] 10 10 anyhow = "1.0.90" 11 11 rockbox-airplay = {path = "../airplay"} 12 + rockbox-slim = {path = "../slim"} 12 13 clap = "4.5.16" 13 14 owo-colors = "4.1.0" 14 15 rockbox-library = {path = "../library"}
+3 -1
crates/cli/src/lib.rs
··· 1 1 use anyhow::Error; 2 2 3 - // Force rockbox-airplay symbols into librockbox_cli.a 3 + // Force rockbox-airplay and rockbox-slim symbols into librockbox_cli.a 4 4 use clap::Command; 5 5 use owo_colors::OwoColorize; 6 6 #[allow(unused_imports)] 7 7 use rockbox_airplay::_link_airplay as _; 8 + #[allow(unused_imports)] 9 + use rockbox_slim::_link_slim as _; 8 10 use rockbox_library::audio_scan::{save_audio_metadata, scan_audio_files}; 9 11 use rockbox_library::{create_connection_pool, repo}; 10 12 use rockbox_typesense::client::*;
+2
crates/rpc/src/lib.rs
··· 933 933 fifo_path: None, 934 934 airplay_host: None, 935 935 airplay_port: None, 936 + squeezelite_http_port: None, 937 + squeezelite_port: None, 936 938 } 937 939 } 938 940 }
+1
crates/settings/Cargo.toml
··· 7 7 anyhow = "1.0.91" 8 8 rockbox-sys = {path = "../sys"} 9 9 toml = "0.8.19" 10 + tracing = { workspace = true }
+24 -3
crates/settings/src/lib.rs
··· 28 28 29 29 rb::settings::save_settings(settings.clone(), new_settings.is_none()); 30 30 31 - if let Some(ref output) = settings.audio_output { 32 - if output == "fifo" { 31 + match settings.audio_output.as_deref() { 32 + Some("fifo") => { 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" { 36 + tracing::info!("audio output: fifo ({})", path); 37 + } 38 + Some("airplay") => { 37 39 if let Some(ref host) = settings.airplay_host { 38 40 let port = settings.airplay_port.unwrap_or(5000); 39 41 pcm::airplay_set_host(host, port); 40 42 pcm::switch_sink(pcm::PCM_SINK_AIRPLAY); 43 + tracing::info!("audio output: airplay ({}:{})", host, port); 44 + } else { 45 + tracing::warn!("audio output: airplay selected but airplay_host is not set"); 41 46 } 47 + } 48 + Some("squeezelite") => { 49 + let slim_port = settings.squeezelite_port.unwrap_or(3483); 50 + let http_port = settings.squeezelite_http_port.unwrap_or(9999); 51 + pcm::squeezelite_set_slim_port(slim_port); 52 + pcm::squeezelite_set_http_port(http_port); 53 + pcm::switch_sink(pcm::PCM_SINK_SQUEEZELITE); 54 + tracing::info!( 55 + "audio output: squeezelite (Slim Protocol :{slim_port}, HTTP audio :{http_port})" 56 + ); 57 + } 58 + Some("builtin") | None => { 59 + tracing::info!("audio output: builtin (SDL)"); 60 + } 61 + Some(other) => { 62 + tracing::warn!("audio output: unknown value {:?}, falling back to builtin", other); 42 63 } 43 64 } 44 65
+10
crates/slim/Cargo.toml
··· 1 + [package] 2 + name = "rockbox-slim" 3 + version = "0.1.0" 4 + edition = "2021" 5 + 6 + [lib] 7 + crate-type = ["rlib"] 8 + 9 + [dependencies] 10 + tracing = { workspace = true }
+78
crates/slim/src/http.rs
··· 1 + use crate::{BroadcastBuffer, RecvResult}; 2 + use std::io::Write; 3 + use std::net::TcpListener; 4 + use std::sync::Arc; 5 + 6 + /// HTTP audio stream server. Each accepted connection is handled in its own 7 + /// thread and receives an independent BroadcastReceiver cursor into the shared 8 + /// PCM buffer, so any number of squeezelite clients can play simultaneously. 9 + pub fn serve(port: u16, buf: Arc<BroadcastBuffer>) { 10 + let listener = match TcpListener::bind(("0.0.0.0", port)) { 11 + Ok(l) => l, 12 + Err(e) => { 13 + tracing::error!("slim/http: bind :{port} failed: {e}"); 14 + return; 15 + } 16 + }; 17 + tracing::info!("slim/http: listening on :{port}"); 18 + 19 + for stream in listener.incoming() { 20 + match stream { 21 + Ok(mut stream) => { 22 + let buf = buf.clone(); 23 + std::thread::spawn(move || { 24 + let peer = stream 25 + .peer_addr() 26 + .map(|a| a.to_string()) 27 + .unwrap_or_default(); 28 + 29 + if let Err(e) = drain_request(&mut stream) { 30 + tracing::warn!("slim/http: request read error from {peer}: {e}"); 31 + return; 32 + } 33 + 34 + let headers = b"HTTP/1.0 200 OK\r\n\ 35 + Content-Type: audio/L16;rate=44100;channels=2\r\n\ 36 + Cache-Control: no-cache\r\n\ 37 + \r\n"; 38 + if let Err(e) = stream.write_all(headers) { 39 + tracing::warn!("slim/http: header write error to {peer}: {e}"); 40 + return; 41 + } 42 + 43 + tracing::info!("slim/http: streaming PCM to {peer}"); 44 + let mut rx = buf.subscribe(); 45 + 46 + loop { 47 + match rx.recv_blocking() { 48 + RecvResult::Data(chunk) => { 49 + if stream.write_all(&chunk).is_err() { 50 + tracing::debug!("slim/http: {peer} disconnected"); 51 + break; 52 + } 53 + } 54 + RecvResult::Closed => break, 55 + } 56 + } 57 + }); 58 + } 59 + Err(e) => tracing::warn!("slim/http: accept error: {e}"), 60 + } 61 + } 62 + } 63 + 64 + fn drain_request(stream: &mut std::net::TcpStream) -> std::io::Result<()> { 65 + use std::io::Read; 66 + let mut buf: Vec<u8> = Vec::with_capacity(512); 67 + let mut byte = [0u8; 1]; 68 + loop { 69 + stream.read_exact(&mut byte)?; 70 + buf.push(byte[0]); 71 + if buf.ends_with(b"\r\n\r\n") || buf.ends_with(b"\n\n") { 72 + return Ok(()); 73 + } 74 + if buf.len() > 8192 { 75 + return Ok(()); 76 + } 77 + } 78 + }
+211
crates/slim/src/lib.rs
··· 1 + mod http; 2 + mod slimproto; 3 + 4 + // Called from rockbox-cli to force this crate's symbols into librockbox_cli.a 5 + #[doc(hidden)] 6 + pub fn _link_slim() {} 7 + 8 + use std::collections::VecDeque; 9 + use std::sync::{Arc, Condvar, Mutex, OnceLock}; 10 + 11 + // --------------------------------------------------------------------------- 12 + // Broadcast buffer — one writer, N independent readers. 13 + // 14 + // Each chunk is stored with a monotonically-increasing sequence number. 15 + // Every reader (one per squeezelite HTTP connection) keeps its own 16 + // `next_seq` cursor and reads chunks independently. Old chunks are evicted 17 + // once the buffer exceeds MAX_BUFFERED bytes; a lagging reader skips forward 18 + // to the oldest available chunk rather than blocking the writer. 19 + // --------------------------------------------------------------------------- 20 + 21 + pub(crate) enum RecvResult { 22 + Data(Vec<u8>), 23 + Closed, 24 + } 25 + 26 + pub(crate) struct BroadcastBuffer { 27 + inner: Mutex<BroadcastInner>, 28 + condvar: Condvar, 29 + } 30 + 31 + struct BroadcastInner { 32 + chunks: VecDeque<(u64, Vec<u8>)>, // (seq, payload) 33 + next_seq: u64, 34 + total_bytes: usize, 35 + closed: bool, 36 + } 37 + 38 + // 4 MB — about 23 s of S16LE stereo at 44100 Hz 39 + const MAX_BUFFERED: usize = 4 * 1024 * 1024; 40 + 41 + impl BroadcastBuffer { 42 + fn new() -> Self { 43 + BroadcastBuffer { 44 + inner: Mutex::new(BroadcastInner { 45 + chunks: VecDeque::new(), 46 + next_seq: 0, 47 + total_bytes: 0, 48 + closed: false, 49 + }), 50 + condvar: Condvar::new(), 51 + } 52 + } 53 + 54 + pub(crate) fn push(&self, data: &[u8]) { 55 + let mut g = self.inner.lock().unwrap(); 56 + if g.closed { 57 + return; 58 + } 59 + let seq = g.next_seq; 60 + g.next_seq += 1; 61 + g.total_bytes += data.len(); 62 + g.chunks.push_back((seq, data.to_vec())); 63 + while g.total_bytes > MAX_BUFFERED { 64 + if let Some((_, old)) = g.chunks.pop_front() { 65 + g.total_bytes -= old.len(); 66 + } else { 67 + break; 68 + } 69 + } 70 + self.condvar.notify_all(); 71 + } 72 + 73 + /// Subscribe from the current write position (live stream, no old data). 74 + pub(crate) fn subscribe(self: &Arc<Self>) -> BroadcastReceiver { 75 + let next_seq = self.inner.lock().unwrap().next_seq; 76 + BroadcastReceiver { buf: Arc::clone(self), next_seq } 77 + } 78 + 79 + fn reset(&self) { 80 + let mut g = self.inner.lock().unwrap(); 81 + g.chunks.clear(); 82 + g.total_bytes = 0; 83 + g.closed = false; 84 + // next_seq is NOT reset — existing receivers skip forward automatically. 85 + } 86 + 87 + fn close(&self) { 88 + let mut g = self.inner.lock().unwrap(); 89 + g.closed = true; 90 + self.condvar.notify_all(); 91 + } 92 + } 93 + 94 + pub(crate) struct BroadcastReceiver { 95 + buf: Arc<BroadcastBuffer>, 96 + next_seq: u64, 97 + } 98 + 99 + impl BroadcastReceiver { 100 + pub(crate) fn recv_blocking(&mut self) -> RecvResult { 101 + let mut g = self.buf.inner.lock().unwrap(); 102 + loop { 103 + if g.closed { 104 + return RecvResult::Closed; 105 + } 106 + if let Some(&(front_seq, _)) = g.chunks.front() { 107 + // Lagging reader: skip to oldest available chunk. 108 + if self.next_seq < front_seq { 109 + tracing::debug!( 110 + "slim/broadcast: receiver lagging, skipping {} → {}", 111 + self.next_seq, front_seq 112 + ); 113 + self.next_seq = front_seq; 114 + } 115 + // Data is available for this reader. 116 + if self.next_seq < g.next_seq { 117 + let idx = (self.next_seq - front_seq) as usize; 118 + let chunk = g.chunks[idx].1.clone(); 119 + self.next_seq += 1; 120 + return RecvResult::Data(chunk); 121 + } 122 + } 123 + g = self.buf.condvar.wait(g).unwrap(); 124 + } 125 + } 126 + } 127 + 128 + // --------------------------------------------------------------------------- 129 + // Global state 130 + // --------------------------------------------------------------------------- 131 + 132 + static BUFFER: OnceLock<Arc<BroadcastBuffer>> = OnceLock::new(); 133 + static STARTED: Mutex<bool> = Mutex::new(false); 134 + 135 + struct SlimConfig { 136 + slim_port: u16, 137 + http_port: u16, 138 + } 139 + 140 + static CONFIG: Mutex<SlimConfig> = Mutex::new(SlimConfig { 141 + slim_port: 3483, 142 + http_port: 9999, 143 + }); 144 + 145 + fn get_buffer() -> Arc<BroadcastBuffer> { 146 + BUFFER.get_or_init(|| Arc::new(BroadcastBuffer::new())).clone() 147 + } 148 + 149 + // --------------------------------------------------------------------------- 150 + // FFI exports 151 + // --------------------------------------------------------------------------- 152 + 153 + #[no_mangle] 154 + pub extern "C" fn pcm_squeezelite_set_slim_port(port: u16) { 155 + CONFIG.lock().unwrap().slim_port = port; 156 + } 157 + 158 + #[no_mangle] 159 + pub extern "C" fn pcm_squeezelite_set_http_port(port: u16) { 160 + CONFIG.lock().unwrap().http_port = port; 161 + } 162 + 163 + /// Start Slim Protocol + HTTP servers. Idempotent. 164 + #[no_mangle] 165 + pub extern "C" fn pcm_squeezelite_start() -> std::os::raw::c_int { 166 + let mut started = STARTED.lock().unwrap(); 167 + if *started { 168 + return 0; 169 + } 170 + 171 + let cfg = CONFIG.lock().unwrap(); 172 + let slim_port = cfg.slim_port; 173 + let http_port = cfg.http_port; 174 + drop(cfg); 175 + 176 + let buf = get_buffer(); 177 + buf.reset(); 178 + 179 + let buf_http = buf.clone(); 180 + std::thread::spawn(move || http::serve(http_port, buf_http)); 181 + std::thread::spawn(move || slimproto::serve(slim_port, http_port)); 182 + 183 + *started = true; 184 + tracing::info!( 185 + "squeezelite sink: Slim Protocol on :{slim_port}, HTTP audio on :{http_port}" 186 + ); 187 + 0 188 + } 189 + 190 + /// Push raw S16LE stereo PCM into the broadcast buffer. 191 + #[no_mangle] 192 + pub extern "C" fn pcm_squeezelite_write(data: *const u8, len: usize) -> std::os::raw::c_int { 193 + if data.is_null() || len == 0 { 194 + return 0; 195 + } 196 + let slice = unsafe { std::slice::from_raw_parts(data, len) }; 197 + get_buffer().push(slice); 198 + 0 199 + } 200 + 201 + /// No-op between tracks — all squeezelite clients keep their HTTP connections. 202 + #[no_mangle] 203 + pub extern "C" fn pcm_squeezelite_stop() {} 204 + 205 + /// Shut down servers (called on daemon exit). 206 + #[no_mangle] 207 + pub extern "C" fn pcm_squeezelite_close() { 208 + let mut started = STARTED.lock().unwrap(); 209 + get_buffer().close(); 210 + *started = false; 211 + }
+137
crates/slim/src/slimproto.rs
··· 1 + use std::io::{Read, Write}; 2 + use std::net::{TcpListener, TcpStream}; 3 + 4 + /// Slim Protocol TCP server. Each squeezelite instance that connects gets a 5 + /// STRM command pointing at our HTTP broadcast endpoint. Multiple clients are 6 + /// fully supported — each connects to the same HTTP port and receives its own 7 + /// independent read cursor into the shared PCM broadcast buffer. 8 + pub fn serve(slim_port: u16, http_port: u16) { 9 + let listener = match TcpListener::bind(("0.0.0.0", slim_port)) { 10 + Ok(l) => l, 11 + Err(e) => { 12 + tracing::error!("slim: bind :{slim_port} failed: {e}"); 13 + return; 14 + } 15 + }; 16 + tracing::info!("slim: listening on :{slim_port}"); 17 + 18 + for stream in listener.incoming() { 19 + match stream { 20 + Ok(stream) => { 21 + std::thread::spawn(move || handle_client(stream, http_port)); 22 + } 23 + Err(e) => tracing::warn!("slim: accept error: {e}"), 24 + } 25 + } 26 + } 27 + 28 + fn handle_client(mut stream: TcpStream, http_port: u16) { 29 + let peer = stream.peer_addr().map(|a| a.to_string()).unwrap_or_default(); 30 + tracing::info!("slim: client connected from {peer}"); 31 + 32 + match read_client_packet(&mut stream) { 33 + Ok((opcode, _body)) if opcode == "HELO" => { 34 + tracing::info!("slim: HELO from {peer}"); 35 + } 36 + Ok((opcode, _)) => { 37 + tracing::warn!("slim: expected HELO, got '{opcode}' from {peer}"); 38 + return; 39 + } 40 + Err(e) => { 41 + tracing::debug!("slim: read error from {peer}: {e}"); 42 + return; 43 + } 44 + } 45 + 46 + if let Err(e) = send_strm_start(&mut stream, http_port) { 47 + tracing::error!("slim: send STRM to {peer} failed: {e}"); 48 + return; 49 + } 50 + tracing::info!("slim: sent STRM to {peer} → http stream on :{http_port}"); 51 + 52 + // Read STAT / DSCO packets. Reply to every STMt heartbeat with audg so 53 + // squeezelite's 36-second "no messages from server" watchdog never fires. 54 + loop { 55 + match read_client_packet(&mut stream) { 56 + Ok((opcode, body)) => { 57 + if opcode == "STAT" && body.len() >= 4 { 58 + let ev = std::str::from_utf8(&body[..4]).unwrap_or("????"); 59 + tracing::debug!("slim: STAT {ev} from {peer}"); 60 + if ev == "STMt" { 61 + if let Err(e) = send_audg(&mut stream) { 62 + tracing::debug!("slim: audg error to {peer}: {e}"); 63 + break; 64 + } 65 + } 66 + } else if opcode == "DSCO" { 67 + tracing::info!("slim: DSCO from {peer}"); 68 + break; 69 + } else { 70 + tracing::debug!("slim: {opcode} from {peer}"); 71 + } 72 + } 73 + Err(_) => { 74 + tracing::info!("slim: {peer} disconnected"); 75 + break; 76 + } 77 + } 78 + } 79 + } 80 + 81 + fn read_client_packet(stream: &mut TcpStream) -> std::io::Result<(String, Vec<u8>)> { 82 + let mut opcode = [0u8; 4]; 83 + stream.read_exact(&mut opcode)?; 84 + 85 + let mut len_buf = [0u8; 4]; 86 + stream.read_exact(&mut len_buf)?; 87 + let len = u32::from_be_bytes(len_buf) as usize; 88 + 89 + let mut payload = vec![0u8; len]; 90 + if len > 0 { 91 + stream.read_exact(&mut payload)?; 92 + } 93 + Ok((String::from_utf8_lossy(&opcode).into_owned(), payload)) 94 + } 95 + 96 + fn send_server_packet( 97 + stream: &mut TcpStream, 98 + opcode: &[u8; 4], 99 + payload: &[u8], 100 + ) -> std::io::Result<()> { 101 + let total = 4usize + payload.len(); 102 + stream.write_all(&(total as u16).to_be_bytes())?; 103 + stream.write_all(opcode)?; 104 + stream.write_all(payload)?; 105 + Ok(()) 106 + } 107 + 108 + fn send_strm_start(stream: &mut TcpStream, http_port: u16) -> std::io::Result<()> { 109 + let request = b"GET /stream.pcm HTTP/1.0\r\n\r\n"; 110 + let mut payload = Vec::with_capacity(24 + request.len()); 111 + payload.push(b's'); // command: start 112 + payload.push(b'1'); // autostart 113 + payload.push(b'p'); // format: raw PCM 114 + payload.push(b'1'); // pcm_sample_size: 16-bit 115 + payload.push(b'3'); // pcm_sample_rate: 44100 Hz 116 + payload.push(b'2'); // pcm_channels: stereo 117 + payload.push(b'1'); // pcm_endianness: little-endian 118 + payload.push(255u8); // threshold: 255 KB 119 + payload.push(0u8); // spdif_enable 120 + payload.push(0u8); // transition_period 121 + payload.push(b'0'); // transition_type: none 122 + payload.push(0u8); // flags 123 + payload.push(0u8); // output_threshold 124 + payload.push(0u8); // slaves 125 + payload.extend_from_slice(&0x00010000u32.to_be_bytes()); // replay_gain = 1.0 126 + payload.extend_from_slice(&http_port.to_be_bytes()); 127 + payload.extend_from_slice(&0u32.to_be_bytes()); // server_ip = 0 → use slimproto_ip 128 + payload.extend_from_slice(request); 129 + send_server_packet(stream, b"strm", &payload) 130 + } 131 + 132 + fn send_audg(stream: &mut TcpStream) -> std::io::Result<()> { 133 + let mut payload = [0u8; 9]; 134 + payload[0..4].copy_from_slice(&0x00010000u32.to_be_bytes()); // left gain = 1.0 135 + payload[4..8].copy_from_slice(&0x00010000u32.to_be_bytes()); // right gain = 1.0 136 + send_server_packet(stream, b"audg", &payload) 137 + }
+2
crates/sys/src/lib.rs
··· 1149 1149 fn pcm_switch_sink(sink: c_int) -> c_uchar; 1150 1150 fn pcm_fifo_set_path(path: *const c_char); 1151 1151 fn pcm_airplay_set_host(host: *const c_char, port: c_ushort); 1152 + fn pcm_squeezelite_set_slim_port(port: c_ushort); 1153 + fn pcm_squeezelite_set_http_port(port: c_ushort); 1152 1154 fn beep_play(frequency: c_uint, duration: c_uint, amplitude: c_uint); 1153 1155 fn dsp_set_crossfeed_type(r#type: c_int); 1154 1156 fn dsp_eq_enable(enable: c_uchar);
+9
crates/sys/src/sound/pcm.rs
··· 5 5 pub const PCM_SINK_BUILTIN: i32 = 0; 6 6 pub const PCM_SINK_FIFO: i32 = 1; 7 7 pub const PCM_SINK_AIRPLAY: i32 = 2; 8 + pub const PCM_SINK_SQUEEZELITE: i32 = 3; 8 9 9 10 pub fn apply_settings() { 10 11 unsafe { ··· 66 67 // so leaking is acceptable here for a startup-time config call. 67 68 std::mem::forget(cpath); 68 69 } 70 + 71 + pub fn squeezelite_set_slim_port(port: u16) { 72 + unsafe { crate::pcm_squeezelite_set_slim_port(port) } 73 + } 74 + 75 + pub fn squeezelite_set_http_port(port: u16) { 76 + unsafe { crate::pcm_squeezelite_set_http_port(port) } 77 + }
+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), "fifo", or "airplay" 680 + /// Audio output sink: "builtin" (default), "fifo", "airplay", or "squeezelite" 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>, ··· 685 685 pub airplay_host: Option<String>, 686 686 /// RAOP port on the receiver (default: 5000) 687 687 pub airplay_port: Option<u16>, 688 + /// Slim Protocol control port for the squeezelite sink (default: 3483) 689 + pub squeezelite_port: Option<u16>, 690 + /// HTTP audio stream port for the squeezelite sink (default: 9999) 691 + pub squeezelite_http_port: Option<u16>, 688 692 } 689 693 690 694 impl From<UserSettings> for NewGlobalSettings { ··· 722 726 fifo_path: None, 723 727 airplay_host: None, 724 728 airplay_port: None, 729 + squeezelite_port: None, 730 + squeezelite_http_port: None, 725 731 } 726 732 } 727 733 }
+1
firmware/SOURCES
··· 538 538 #if (CONFIG_PLATFORM & PLATFORM_HOSTED) 539 539 target/hosted/pcm-fifo.c 540 540 target/hosted/pcm-airplay.c 541 + target/hosted/pcm-squeezelite.c 541 542 #endif 542 543 #ifdef HAVE_SW_VOLUME_CONTROL 543 544 pcm_sw_volume.c
+4
firmware/export/pcm_sink.h
··· 55 55 #if (CONFIG_PLATFORM & PLATFORM_HOSTED) 56 56 PCM_SINK_FIFO, 57 57 PCM_SINK_AIRPLAY, 58 + PCM_SINK_SQUEEZELITE, 58 59 #endif 59 60 PCM_SINK_NUM 60 61 }; ··· 69 70 70 71 /* AirPlay (RAOP) sink — streams ALAC-encoded audio over RTP */ 71 72 extern struct pcm_sink airplay_pcm_sink; 73 + 74 + /* Squeezelite (Slim Protocol) sink — serves PCM via HTTP to squeezelite */ 75 + extern struct pcm_sink squeezelite_pcm_sink; 72 76 #endif
+4 -3
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, 85 - [PCM_SINK_AIRPLAY] = &airplay_pcm_sink, 84 + [PCM_SINK_FIFO] = &fifo_pcm_sink, 85 + [PCM_SINK_AIRPLAY] = &airplay_pcm_sink, 86 + [PCM_SINK_SQUEEZELITE] = &squeezelite_pcm_sink, 86 87 #endif 87 88 }; 88 89 static enum pcm_sink_ids cur_sink = PCM_SINK_BUILTIN;
+213
firmware/target/hosted/pcm-squeezelite.c
··· 1 + /*************************************************************************** 2 + * PCM sink that streams raw S16LE stereo PCM to squeezelite via the Slim 3 + * Protocol (port 3483) + a plain HTTP audio endpoint (port 9999). 4 + * 5 + * Usage: 6 + * pcm_squeezelite_set_slim_port(3483); // optional, this is the default 7 + * pcm_squeezelite_set_http_port(9999); // optional, this is the default 8 + * pcm_switch_sink(PCM_SINK_SQUEEZELITE); 9 + * // Then run: squeezelite -s localhost 10 + * 11 + * Copyright (C) 2026 Rockbox contributors 12 + * 13 + * This program is free software; you can redistribute it and/or 14 + * modify it under the terms of the GNU General Public License 15 + * as published by the Free Software Foundation; either version 2 16 + * of the License, or (at your option) any later version. 17 + * 18 + * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY 19 + * KIND, either express or implied. 20 + * 21 + ****************************************************************************/ 22 + 23 + #include "autoconf.h" 24 + #include "config.h" 25 + 26 + #include <pthread.h> 27 + #include <stdbool.h> 28 + #include <stddef.h> 29 + #include <stdint.h> 30 + #include <time.h> 31 + #include <unistd.h> 32 + 33 + #include "pcm.h" 34 + #include "pcm-internal.h" 35 + #include "pcm_mixer.h" 36 + #include "pcm_sampr.h" 37 + #include "pcm_sink.h" 38 + 39 + #define LOGF_ENABLE 40 + #include "logf.h" 41 + 42 + /* Rust C API — symbols provided by the rockbox-slim crate via librockbox_cli.a */ 43 + extern void pcm_squeezelite_set_slim_port(uint16_t port); 44 + extern void pcm_squeezelite_set_http_port(uint16_t port); 45 + extern int pcm_squeezelite_start(void); 46 + extern int pcm_squeezelite_write(const uint8_t *data, size_t len); 47 + extern void pcm_squeezelite_stop(void); 48 + extern void pcm_squeezelite_close(void); 49 + 50 + static const void *pcm_data = NULL; 51 + static size_t pcm_size = 0; 52 + 53 + static pthread_mutex_t squeezelite_mtx; 54 + static pthread_t squeezelite_tid; 55 + static volatile bool squeezelite_running = false; 56 + static volatile bool squeezelite_stop = false; 57 + 58 + /* Real-time pacing state — reset on every sink_dma_start(). */ 59 + static struct timespec play_start; 60 + static uint64_t play_bytes; 61 + 62 + /* Actual sample rate set by sink_set_freq(); defaults to 44100. 63 + * bytes_per_sec = sample_rate * 2 channels * 2 bytes/sample. */ 64 + static unsigned long current_sample_rate = 44100; 65 + 66 + static void *squeezelite_thread(void *arg) 67 + { 68 + (void)arg; 69 + 70 + while (!squeezelite_stop) { 71 + pthread_mutex_lock(&squeezelite_mtx); 72 + const void *data = pcm_data; 73 + size_t size = pcm_size; 74 + pcm_data = NULL; 75 + pcm_size = 0; 76 + pthread_mutex_unlock(&squeezelite_mtx); 77 + 78 + if (data && size > 0) { 79 + if (pcm_squeezelite_write((const uint8_t *)data, size) < 0) { 80 + logf("pcm-squeezelite: write error"); 81 + squeezelite_stop = true; 82 + break; 83 + } 84 + 85 + /* Pace to real-time so the DMA loop does not drain the entire 86 + * track instantly. We track total bytes written and sleep 87 + * whenever we are ahead of the expected wall-clock position. 88 + * 89 + * bytes_per_sec = sample_rate * 2 channels * 2 bytes/sample */ 90 + play_bytes += size; 91 + uint64_t bps = (uint64_t)current_sample_rate * 4; 92 + uint64_t expected_us = play_bytes * 1000000ULL / bps; 93 + 94 + struct timespec now; 95 + clock_gettime(CLOCK_MONOTONIC, &now); 96 + /* Use signed arithmetic to avoid uint64_t wrap when tv_nsec 97 + * rolls over (happens every second on a monotonic clock). */ 98 + int64_t elapsed_us = 99 + (int64_t)(now.tv_sec - play_start.tv_sec) * 1000000LL + 100 + ((int64_t)now.tv_nsec - (int64_t)play_start.tv_nsec) / 1000LL; 101 + 102 + if (elapsed_us >= 0 && expected_us > (uint64_t)elapsed_us) { 103 + usleep((useconds_t)(expected_us - (uint64_t)elapsed_us)); 104 + } 105 + } 106 + 107 + if (squeezelite_stop) 108 + break; 109 + 110 + pthread_mutex_lock(&squeezelite_mtx); 111 + bool got_more = pcm_play_dma_complete_callback(PCM_DMAST_OK, 112 + &pcm_data, &pcm_size); 113 + pthread_mutex_unlock(&squeezelite_mtx); 114 + 115 + if (!got_more) { 116 + logf("pcm-squeezelite: no more PCM data"); 117 + break; 118 + } 119 + 120 + pcm_play_dma_status_callback(PCM_DMAST_STARTED); 121 + } 122 + 123 + squeezelite_running = false; 124 + return NULL; 125 + } 126 + 127 + static void sink_dma_init(void) 128 + { 129 + pthread_mutexattr_t attr; 130 + pthread_mutexattr_init(&attr); 131 + pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE); 132 + pthread_mutex_init(&squeezelite_mtx, &attr); 133 + pthread_mutexattr_destroy(&attr); 134 + } 135 + 136 + static void sink_dma_postinit(void) 137 + { 138 + } 139 + 140 + static void sink_set_freq(uint16_t freq) 141 + { 142 + current_sample_rate = hw_freq_sampr[freq]; 143 + logf("pcm-squeezelite: sample rate %lu Hz", current_sample_rate); 144 + } 145 + 146 + static void sink_lock(void) 147 + { 148 + pthread_mutex_lock(&squeezelite_mtx); 149 + } 150 + 151 + static void sink_unlock(void) 152 + { 153 + pthread_mutex_unlock(&squeezelite_mtx); 154 + } 155 + 156 + static void sink_dma_start(const void *addr, size_t size) 157 + { 158 + logf("pcm-squeezelite: start (%p, %zu)", addr, size); 159 + 160 + if (pcm_squeezelite_start() < 0) { 161 + logf("pcm-squeezelite: server start failed"); 162 + return; 163 + } 164 + 165 + /* Reset real-time pacing for this track. */ 166 + clock_gettime(CLOCK_MONOTONIC, &play_start); 167 + play_bytes = 0; 168 + 169 + pthread_mutex_lock(&squeezelite_mtx); 170 + pcm_data = addr; 171 + pcm_size = size; 172 + pthread_mutex_unlock(&squeezelite_mtx); 173 + 174 + squeezelite_stop = false; 175 + squeezelite_running = true; 176 + pthread_create(&squeezelite_tid, NULL, squeezelite_thread, NULL); 177 + } 178 + 179 + static void sink_dma_stop(void) 180 + { 181 + logf("pcm-squeezelite: stop"); 182 + 183 + squeezelite_stop = true; 184 + 185 + if (squeezelite_running) { 186 + pthread_join(squeezelite_tid, NULL); 187 + squeezelite_running = false; 188 + } 189 + 190 + pthread_mutex_lock(&squeezelite_mtx); 191 + pcm_data = NULL; 192 + pcm_size = 0; 193 + pthread_mutex_unlock(&squeezelite_mtx); 194 + 195 + pcm_squeezelite_stop(); 196 + } 197 + 198 + struct pcm_sink squeezelite_pcm_sink = { 199 + .caps = { 200 + .samprs = hw_freq_sampr, 201 + .num_samprs = HW_NUM_FREQ, 202 + .default_freq = HW_FREQ_DEFAULT, 203 + }, 204 + .ops = { 205 + .init = sink_dma_init, 206 + .postinit = sink_dma_postinit, 207 + .set_freq = sink_set_freq, 208 + .lock = sink_lock, 209 + .unlock = sink_unlock, 210 + .play = sink_dma_start, 211 + .stop = sink_dma_stop, 212 + }, 213 + };