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 Gleam SDK docs, examples, rules builder

+4175 -1261
+2532 -1255
crates/upnp/src/api/rockbox.v1alpha1.rs
··· 45 45 dead_code, 46 46 missing_docs, 47 47 clippy::wildcard_imports, 48 - clippy::let_unit_value 48 + clippy::let_unit_value, 49 49 )] 50 - use tonic::codegen::http::Uri; 51 50 use tonic::codegen::*; 51 + use tonic::codegen::http::Uri; 52 52 #[derive(Debug, Clone)] 53 53 pub struct BrowseServiceClient<T> { 54 54 inner: tonic::client::Grpc<T>, ··· 92 92 <T as tonic::client::GrpcService<tonic::body::BoxBody>>::ResponseBody, 93 93 >, 94 94 >, 95 - <T as tonic::codegen::Service<http::Request<tonic::body::BoxBody>>>::Error: 96 - Into<StdError> + std::marker::Send + std::marker::Sync, 95 + <T as tonic::codegen::Service< 96 + http::Request<tonic::body::BoxBody>, 97 + >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync, 97 98 { 98 99 BrowseServiceClient::new(InterceptedService::new(inner, interceptor)) 99 100 } ··· 131 132 pub async fn tree_get_entries( 132 133 &mut self, 133 134 request: impl tonic::IntoRequest<super::TreeGetEntriesRequest>, 134 - ) -> std::result::Result<tonic::Response<super::TreeGetEntriesResponse>, tonic::Status> 135 - { 136 - self.inner.ready().await.map_err(|e| { 137 - tonic::Status::unknown(format!("Service was not ready: {}", e.into())) 138 - })?; 135 + ) -> std::result::Result< 136 + tonic::Response<super::TreeGetEntriesResponse>, 137 + tonic::Status, 138 + > { 139 + self.inner 140 + .ready() 141 + .await 142 + .map_err(|e| { 143 + tonic::Status::unknown( 144 + format!("Service was not ready: {}", e.into()), 145 + ) 146 + })?; 139 147 let codec = tonic::codec::ProstCodec::default(); 140 148 let path = http::uri::PathAndQuery::from_static( 141 149 "/rockbox.v1alpha1.BrowseService/TreeGetEntries", 142 150 ); 143 151 let mut req = request.into_request(); 144 - req.extensions_mut().insert(GrpcMethod::new( 145 - "rockbox.v1alpha1.BrowseService", 146 - "TreeGetEntries", 147 - )); 152 + req.extensions_mut() 153 + .insert( 154 + GrpcMethod::new("rockbox.v1alpha1.BrowseService", "TreeGetEntries"), 155 + ); 148 156 self.inner.unary(req, path, codec).await 149 157 } 150 158 } ··· 156 164 dead_code, 157 165 missing_docs, 158 166 clippy::wildcard_imports, 159 - clippy::let_unit_value 167 + clippy::let_unit_value, 160 168 )] 161 169 use tonic::codegen::*; 162 170 /// Generated trait containing gRPC methods that should be implemented for use with BrowseServiceServer. ··· 165 173 async fn tree_get_entries( 166 174 &self, 167 175 request: tonic::Request<super::TreeGetEntriesRequest>, 168 - ) -> std::result::Result<tonic::Response<super::TreeGetEntriesResponse>, tonic::Status>; 176 + ) -> std::result::Result< 177 + tonic::Response<super::TreeGetEntriesResponse>, 178 + tonic::Status, 179 + >; 169 180 } 170 181 #[derive(Debug)] 171 182 pub struct BrowseServiceServer<T> { ··· 188 199 max_encoding_message_size: None, 189 200 } 190 201 } 191 - pub fn with_interceptor<F>(inner: T, interceptor: F) -> InterceptedService<Self, F> 202 + pub fn with_interceptor<F>( 203 + inner: T, 204 + interceptor: F, 205 + ) -> InterceptedService<Self, F> 192 206 where 193 207 F: tonic::service::Interceptor, 194 208 { ··· 243 257 "/rockbox.v1alpha1.BrowseService/TreeGetEntries" => { 244 258 #[allow(non_camel_case_types)] 245 259 struct TreeGetEntriesSvc<T: BrowseService>(pub Arc<T>); 246 - impl<T: BrowseService> tonic::server::UnaryService<super::TreeGetEntriesRequest> 247 - for TreeGetEntriesSvc<T> 248 - { 260 + impl< 261 + T: BrowseService, 262 + > tonic::server::UnaryService<super::TreeGetEntriesRequest> 263 + for TreeGetEntriesSvc<T> { 249 264 type Response = super::TreeGetEntriesResponse; 250 - type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>; 265 + type Future = BoxFuture< 266 + tonic::Response<Self::Response>, 267 + tonic::Status, 268 + >; 251 269 fn call( 252 270 &mut self, 253 271 request: tonic::Request<super::TreeGetEntriesRequest>, 254 272 ) -> Self::Future { 255 273 let inner = Arc::clone(&self.0); 256 274 let fut = async move { 257 - <T as BrowseService>::tree_get_entries(&inner, request).await 275 + <T as BrowseService>::tree_get_entries(&inner, request) 276 + .await 258 277 }; 259 278 Box::pin(fut) 260 279 } ··· 281 300 }; 282 301 Box::pin(fut) 283 302 } 284 - _ => Box::pin(async move { 285 - let mut response = http::Response::new(empty_body()); 286 - let headers = response.headers_mut(); 287 - headers.insert( 288 - tonic::Status::GRPC_STATUS, 289 - (tonic::Code::Unimplemented as i32).into(), 290 - ); 291 - headers.insert( 292 - http::header::CONTENT_TYPE, 293 - tonic::metadata::GRPC_CONTENT_TYPE, 294 - ); 295 - Ok(response) 296 - }), 303 + _ => { 304 + Box::pin(async move { 305 + let mut response = http::Response::new(empty_body()); 306 + let headers = response.headers_mut(); 307 + headers 308 + .insert( 309 + tonic::Status::GRPC_STATUS, 310 + (tonic::Code::Unimplemented as i32).into(), 311 + ); 312 + headers 313 + .insert( 314 + http::header::CONTENT_TYPE, 315 + tonic::metadata::GRPC_CONTENT_TYPE, 316 + ); 317 + Ok(response) 318 + }) 319 + } 297 320 } 298 321 } 299 322 } ··· 550 573 dead_code, 551 574 missing_docs, 552 575 clippy::wildcard_imports, 553 - clippy::let_unit_value 576 + clippy::let_unit_value, 554 577 )] 555 - use tonic::codegen::http::Uri; 556 578 use tonic::codegen::*; 579 + use tonic::codegen::http::Uri; 557 580 #[derive(Debug, Clone)] 558 581 pub struct LibraryServiceClient<T> { 559 582 inner: tonic::client::Grpc<T>, ··· 597 620 <T as tonic::client::GrpcService<tonic::body::BoxBody>>::ResponseBody, 598 621 >, 599 622 >, 600 - <T as tonic::codegen::Service<http::Request<tonic::body::BoxBody>>>::Error: 601 - Into<StdError> + std::marker::Send + std::marker::Sync, 623 + <T as tonic::codegen::Service< 624 + http::Request<tonic::body::BoxBody>, 625 + >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync, 602 626 { 603 627 LibraryServiceClient::new(InterceptedService::new(inner, interceptor)) 604 628 } ··· 636 660 pub async fn get_albums( 637 661 &mut self, 638 662 request: impl tonic::IntoRequest<super::GetAlbumsRequest>, 639 - ) -> std::result::Result<tonic::Response<super::GetAlbumsResponse>, tonic::Status> { 640 - self.inner.ready().await.map_err(|e| { 641 - tonic::Status::unknown(format!("Service was not ready: {}", e.into())) 642 - })?; 663 + ) -> std::result::Result< 664 + tonic::Response<super::GetAlbumsResponse>, 665 + tonic::Status, 666 + > { 667 + self.inner 668 + .ready() 669 + .await 670 + .map_err(|e| { 671 + tonic::Status::unknown( 672 + format!("Service was not ready: {}", e.into()), 673 + ) 674 + })?; 643 675 let codec = tonic::codec::ProstCodec::default(); 644 - let path = 645 - http::uri::PathAndQuery::from_static("/rockbox.v1alpha1.LibraryService/GetAlbums"); 676 + let path = http::uri::PathAndQuery::from_static( 677 + "/rockbox.v1alpha1.LibraryService/GetAlbums", 678 + ); 646 679 let mut req = request.into_request(); 647 - req.extensions_mut().insert(GrpcMethod::new( 648 - "rockbox.v1alpha1.LibraryService", 649 - "GetAlbums", 650 - )); 680 + req.extensions_mut() 681 + .insert(GrpcMethod::new("rockbox.v1alpha1.LibraryService", "GetAlbums")); 651 682 self.inner.unary(req, path, codec).await 652 683 } 653 684 pub async fn get_artists( 654 685 &mut self, 655 686 request: impl tonic::IntoRequest<super::GetArtistsRequest>, 656 - ) -> std::result::Result<tonic::Response<super::GetArtistsResponse>, tonic::Status> 657 - { 658 - self.inner.ready().await.map_err(|e| { 659 - tonic::Status::unknown(format!("Service was not ready: {}", e.into())) 660 - })?; 687 + ) -> std::result::Result< 688 + tonic::Response<super::GetArtistsResponse>, 689 + tonic::Status, 690 + > { 691 + self.inner 692 + .ready() 693 + .await 694 + .map_err(|e| { 695 + tonic::Status::unknown( 696 + format!("Service was not ready: {}", e.into()), 697 + ) 698 + })?; 661 699 let codec = tonic::codec::ProstCodec::default(); 662 - let path = 663 - http::uri::PathAndQuery::from_static("/rockbox.v1alpha1.LibraryService/GetArtists"); 700 + let path = http::uri::PathAndQuery::from_static( 701 + "/rockbox.v1alpha1.LibraryService/GetArtists", 702 + ); 664 703 let mut req = request.into_request(); 665 - req.extensions_mut().insert(GrpcMethod::new( 666 - "rockbox.v1alpha1.LibraryService", 667 - "GetArtists", 668 - )); 704 + req.extensions_mut() 705 + .insert( 706 + GrpcMethod::new("rockbox.v1alpha1.LibraryService", "GetArtists"), 707 + ); 669 708 self.inner.unary(req, path, codec).await 670 709 } 671 710 pub async fn get_tracks( 672 711 &mut self, 673 712 request: impl tonic::IntoRequest<super::GetTracksRequest>, 674 - ) -> std::result::Result<tonic::Response<super::GetTracksResponse>, tonic::Status> { 675 - self.inner.ready().await.map_err(|e| { 676 - tonic::Status::unknown(format!("Service was not ready: {}", e.into())) 677 - })?; 713 + ) -> std::result::Result< 714 + tonic::Response<super::GetTracksResponse>, 715 + tonic::Status, 716 + > { 717 + self.inner 718 + .ready() 719 + .await 720 + .map_err(|e| { 721 + tonic::Status::unknown( 722 + format!("Service was not ready: {}", e.into()), 723 + ) 724 + })?; 678 725 let codec = tonic::codec::ProstCodec::default(); 679 - let path = 680 - http::uri::PathAndQuery::from_static("/rockbox.v1alpha1.LibraryService/GetTracks"); 726 + let path = http::uri::PathAndQuery::from_static( 727 + "/rockbox.v1alpha1.LibraryService/GetTracks", 728 + ); 681 729 let mut req = request.into_request(); 682 - req.extensions_mut().insert(GrpcMethod::new( 683 - "rockbox.v1alpha1.LibraryService", 684 - "GetTracks", 685 - )); 730 + req.extensions_mut() 731 + .insert(GrpcMethod::new("rockbox.v1alpha1.LibraryService", "GetTracks")); 686 732 self.inner.unary(req, path, codec).await 687 733 } 688 734 pub async fn get_album( 689 735 &mut self, 690 736 request: impl tonic::IntoRequest<super::GetAlbumRequest>, 691 - ) -> std::result::Result<tonic::Response<super::GetAlbumResponse>, tonic::Status> { 692 - self.inner.ready().await.map_err(|e| { 693 - tonic::Status::unknown(format!("Service was not ready: {}", e.into())) 694 - })?; 737 + ) -> std::result::Result< 738 + tonic::Response<super::GetAlbumResponse>, 739 + tonic::Status, 740 + > { 741 + self.inner 742 + .ready() 743 + .await 744 + .map_err(|e| { 745 + tonic::Status::unknown( 746 + format!("Service was not ready: {}", e.into()), 747 + ) 748 + })?; 695 749 let codec = tonic::codec::ProstCodec::default(); 696 - let path = 697 - http::uri::PathAndQuery::from_static("/rockbox.v1alpha1.LibraryService/GetAlbum"); 750 + let path = http::uri::PathAndQuery::from_static( 751 + "/rockbox.v1alpha1.LibraryService/GetAlbum", 752 + ); 698 753 let mut req = request.into_request(); 699 - req.extensions_mut().insert(GrpcMethod::new( 700 - "rockbox.v1alpha1.LibraryService", 701 - "GetAlbum", 702 - )); 754 + req.extensions_mut() 755 + .insert(GrpcMethod::new("rockbox.v1alpha1.LibraryService", "GetAlbum")); 703 756 self.inner.unary(req, path, codec).await 704 757 } 705 758 pub async fn get_artist( 706 759 &mut self, 707 760 request: impl tonic::IntoRequest<super::GetArtistRequest>, 708 - ) -> std::result::Result<tonic::Response<super::GetArtistResponse>, tonic::Status> { 709 - self.inner.ready().await.map_err(|e| { 710 - tonic::Status::unknown(format!("Service was not ready: {}", e.into())) 711 - })?; 761 + ) -> std::result::Result< 762 + tonic::Response<super::GetArtistResponse>, 763 + tonic::Status, 764 + > { 765 + self.inner 766 + .ready() 767 + .await 768 + .map_err(|e| { 769 + tonic::Status::unknown( 770 + format!("Service was not ready: {}", e.into()), 771 + ) 772 + })?; 712 773 let codec = tonic::codec::ProstCodec::default(); 713 - let path = 714 - http::uri::PathAndQuery::from_static("/rockbox.v1alpha1.LibraryService/GetArtist"); 774 + let path = http::uri::PathAndQuery::from_static( 775 + "/rockbox.v1alpha1.LibraryService/GetArtist", 776 + ); 715 777 let mut req = request.into_request(); 716 - req.extensions_mut().insert(GrpcMethod::new( 717 - "rockbox.v1alpha1.LibraryService", 718 - "GetArtist", 719 - )); 778 + req.extensions_mut() 779 + .insert(GrpcMethod::new("rockbox.v1alpha1.LibraryService", "GetArtist")); 720 780 self.inner.unary(req, path, codec).await 721 781 } 722 782 pub async fn get_track( 723 783 &mut self, 724 784 request: impl tonic::IntoRequest<super::GetTrackRequest>, 725 - ) -> std::result::Result<tonic::Response<super::GetTrackResponse>, tonic::Status> { 726 - self.inner.ready().await.map_err(|e| { 727 - tonic::Status::unknown(format!("Service was not ready: {}", e.into())) 728 - })?; 785 + ) -> std::result::Result< 786 + tonic::Response<super::GetTrackResponse>, 787 + tonic::Status, 788 + > { 789 + self.inner 790 + .ready() 791 + .await 792 + .map_err(|e| { 793 + tonic::Status::unknown( 794 + format!("Service was not ready: {}", e.into()), 795 + ) 796 + })?; 729 797 let codec = tonic::codec::ProstCodec::default(); 730 - let path = 731 - http::uri::PathAndQuery::from_static("/rockbox.v1alpha1.LibraryService/GetTrack"); 798 + let path = http::uri::PathAndQuery::from_static( 799 + "/rockbox.v1alpha1.LibraryService/GetTrack", 800 + ); 732 801 let mut req = request.into_request(); 733 - req.extensions_mut().insert(GrpcMethod::new( 734 - "rockbox.v1alpha1.LibraryService", 735 - "GetTrack", 736 - )); 802 + req.extensions_mut() 803 + .insert(GrpcMethod::new("rockbox.v1alpha1.LibraryService", "GetTrack")); 737 804 self.inner.unary(req, path, codec).await 738 805 } 739 806 pub async fn like_track( 740 807 &mut self, 741 808 request: impl tonic::IntoRequest<super::LikeTrackRequest>, 742 - ) -> std::result::Result<tonic::Response<super::LikeTrackResponse>, tonic::Status> { 743 - self.inner.ready().await.map_err(|e| { 744 - tonic::Status::unknown(format!("Service was not ready: {}", e.into())) 745 - })?; 809 + ) -> std::result::Result< 810 + tonic::Response<super::LikeTrackResponse>, 811 + tonic::Status, 812 + > { 813 + self.inner 814 + .ready() 815 + .await 816 + .map_err(|e| { 817 + tonic::Status::unknown( 818 + format!("Service was not ready: {}", e.into()), 819 + ) 820 + })?; 746 821 let codec = tonic::codec::ProstCodec::default(); 747 - let path = 748 - http::uri::PathAndQuery::from_static("/rockbox.v1alpha1.LibraryService/LikeTrack"); 822 + let path = http::uri::PathAndQuery::from_static( 823 + "/rockbox.v1alpha1.LibraryService/LikeTrack", 824 + ); 749 825 let mut req = request.into_request(); 750 - req.extensions_mut().insert(GrpcMethod::new( 751 - "rockbox.v1alpha1.LibraryService", 752 - "LikeTrack", 753 - )); 826 + req.extensions_mut() 827 + .insert(GrpcMethod::new("rockbox.v1alpha1.LibraryService", "LikeTrack")); 754 828 self.inner.unary(req, path, codec).await 755 829 } 756 830 pub async fn unlike_track( 757 831 &mut self, 758 832 request: impl tonic::IntoRequest<super::UnlikeTrackRequest>, 759 - ) -> std::result::Result<tonic::Response<super::UnlikeTrackResponse>, tonic::Status> 760 - { 761 - self.inner.ready().await.map_err(|e| { 762 - tonic::Status::unknown(format!("Service was not ready: {}", e.into())) 763 - })?; 833 + ) -> std::result::Result< 834 + tonic::Response<super::UnlikeTrackResponse>, 835 + tonic::Status, 836 + > { 837 + self.inner 838 + .ready() 839 + .await 840 + .map_err(|e| { 841 + tonic::Status::unknown( 842 + format!("Service was not ready: {}", e.into()), 843 + ) 844 + })?; 764 845 let codec = tonic::codec::ProstCodec::default(); 765 846 let path = http::uri::PathAndQuery::from_static( 766 847 "/rockbox.v1alpha1.LibraryService/UnlikeTrack", 767 848 ); 768 849 let mut req = request.into_request(); 769 - req.extensions_mut().insert(GrpcMethod::new( 770 - "rockbox.v1alpha1.LibraryService", 771 - "UnlikeTrack", 772 - )); 850 + req.extensions_mut() 851 + .insert( 852 + GrpcMethod::new("rockbox.v1alpha1.LibraryService", "UnlikeTrack"), 853 + ); 773 854 self.inner.unary(req, path, codec).await 774 855 } 775 856 pub async fn like_album( 776 857 &mut self, 777 858 request: impl tonic::IntoRequest<super::LikeAlbumRequest>, 778 - ) -> std::result::Result<tonic::Response<super::LikeAlbumResponse>, tonic::Status> { 779 - self.inner.ready().await.map_err(|e| { 780 - tonic::Status::unknown(format!("Service was not ready: {}", e.into())) 781 - })?; 859 + ) -> std::result::Result< 860 + tonic::Response<super::LikeAlbumResponse>, 861 + tonic::Status, 862 + > { 863 + self.inner 864 + .ready() 865 + .await 866 + .map_err(|e| { 867 + tonic::Status::unknown( 868 + format!("Service was not ready: {}", e.into()), 869 + ) 870 + })?; 782 871 let codec = tonic::codec::ProstCodec::default(); 783 - let path = 784 - http::uri::PathAndQuery::from_static("/rockbox.v1alpha1.LibraryService/LikeAlbum"); 872 + let path = http::uri::PathAndQuery::from_static( 873 + "/rockbox.v1alpha1.LibraryService/LikeAlbum", 874 + ); 785 875 let mut req = request.into_request(); 786 - req.extensions_mut().insert(GrpcMethod::new( 787 - "rockbox.v1alpha1.LibraryService", 788 - "LikeAlbum", 789 - )); 876 + req.extensions_mut() 877 + .insert(GrpcMethod::new("rockbox.v1alpha1.LibraryService", "LikeAlbum")); 790 878 self.inner.unary(req, path, codec).await 791 879 } 792 880 pub async fn unlike_album( 793 881 &mut self, 794 882 request: impl tonic::IntoRequest<super::UnlikeAlbumRequest>, 795 - ) -> std::result::Result<tonic::Response<super::UnlikeAlbumResponse>, tonic::Status> 796 - { 797 - self.inner.ready().await.map_err(|e| { 798 - tonic::Status::unknown(format!("Service was not ready: {}", e.into())) 799 - })?; 883 + ) -> std::result::Result< 884 + tonic::Response<super::UnlikeAlbumResponse>, 885 + tonic::Status, 886 + > { 887 + self.inner 888 + .ready() 889 + .await 890 + .map_err(|e| { 891 + tonic::Status::unknown( 892 + format!("Service was not ready: {}", e.into()), 893 + ) 894 + })?; 800 895 let codec = tonic::codec::ProstCodec::default(); 801 896 let path = http::uri::PathAndQuery::from_static( 802 897 "/rockbox.v1alpha1.LibraryService/UnlikeAlbum", 803 898 ); 804 899 let mut req = request.into_request(); 805 - req.extensions_mut().insert(GrpcMethod::new( 806 - "rockbox.v1alpha1.LibraryService", 807 - "UnlikeAlbum", 808 - )); 900 + req.extensions_mut() 901 + .insert( 902 + GrpcMethod::new("rockbox.v1alpha1.LibraryService", "UnlikeAlbum"), 903 + ); 809 904 self.inner.unary(req, path, codec).await 810 905 } 811 906 pub async fn get_liked_tracks( 812 907 &mut self, 813 908 request: impl tonic::IntoRequest<super::GetLikedTracksRequest>, 814 - ) -> std::result::Result<tonic::Response<super::GetLikedTracksResponse>, tonic::Status> 815 - { 816 - self.inner.ready().await.map_err(|e| { 817 - tonic::Status::unknown(format!("Service was not ready: {}", e.into())) 818 - })?; 909 + ) -> std::result::Result< 910 + tonic::Response<super::GetLikedTracksResponse>, 911 + tonic::Status, 912 + > { 913 + self.inner 914 + .ready() 915 + .await 916 + .map_err(|e| { 917 + tonic::Status::unknown( 918 + format!("Service was not ready: {}", e.into()), 919 + ) 920 + })?; 819 921 let codec = tonic::codec::ProstCodec::default(); 820 922 let path = http::uri::PathAndQuery::from_static( 821 923 "/rockbox.v1alpha1.LibraryService/GetLikedTracks", 822 924 ); 823 925 let mut req = request.into_request(); 824 - req.extensions_mut().insert(GrpcMethod::new( 825 - "rockbox.v1alpha1.LibraryService", 826 - "GetLikedTracks", 827 - )); 926 + req.extensions_mut() 927 + .insert( 928 + GrpcMethod::new("rockbox.v1alpha1.LibraryService", "GetLikedTracks"), 929 + ); 828 930 self.inner.unary(req, path, codec).await 829 931 } 830 932 pub async fn get_liked_albums( 831 933 &mut self, 832 934 request: impl tonic::IntoRequest<super::GetLikedAlbumsRequest>, 833 - ) -> std::result::Result<tonic::Response<super::GetLikedAlbumsResponse>, tonic::Status> 834 - { 835 - self.inner.ready().await.map_err(|e| { 836 - tonic::Status::unknown(format!("Service was not ready: {}", e.into())) 837 - })?; 935 + ) -> std::result::Result< 936 + tonic::Response<super::GetLikedAlbumsResponse>, 937 + tonic::Status, 938 + > { 939 + self.inner 940 + .ready() 941 + .await 942 + .map_err(|e| { 943 + tonic::Status::unknown( 944 + format!("Service was not ready: {}", e.into()), 945 + ) 946 + })?; 838 947 let codec = tonic::codec::ProstCodec::default(); 839 948 let path = http::uri::PathAndQuery::from_static( 840 949 "/rockbox.v1alpha1.LibraryService/GetLikedAlbums", 841 950 ); 842 951 let mut req = request.into_request(); 843 - req.extensions_mut().insert(GrpcMethod::new( 844 - "rockbox.v1alpha1.LibraryService", 845 - "GetLikedAlbums", 846 - )); 952 + req.extensions_mut() 953 + .insert( 954 + GrpcMethod::new("rockbox.v1alpha1.LibraryService", "GetLikedAlbums"), 955 + ); 847 956 self.inner.unary(req, path, codec).await 848 957 } 849 958 pub async fn scan_library( 850 959 &mut self, 851 960 request: impl tonic::IntoRequest<super::ScanLibraryRequest>, 852 - ) -> std::result::Result<tonic::Response<super::ScanLibraryResponse>, tonic::Status> 853 - { 854 - self.inner.ready().await.map_err(|e| { 855 - tonic::Status::unknown(format!("Service was not ready: {}", e.into())) 856 - })?; 961 + ) -> std::result::Result< 962 + tonic::Response<super::ScanLibraryResponse>, 963 + tonic::Status, 964 + > { 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 + })?; 857 973 let codec = tonic::codec::ProstCodec::default(); 858 974 let path = http::uri::PathAndQuery::from_static( 859 975 "/rockbox.v1alpha1.LibraryService/ScanLibrary", 860 976 ); 861 977 let mut req = request.into_request(); 862 - req.extensions_mut().insert(GrpcMethod::new( 863 - "rockbox.v1alpha1.LibraryService", 864 - "ScanLibrary", 865 - )); 978 + req.extensions_mut() 979 + .insert( 980 + GrpcMethod::new("rockbox.v1alpha1.LibraryService", "ScanLibrary"), 981 + ); 866 982 self.inner.unary(req, path, codec).await 867 983 } 868 984 pub async fn stream_library( ··· 872 988 tonic::Response<tonic::codec::Streaming<super::StreamLibraryResponse>>, 873 989 tonic::Status, 874 990 > { 875 - self.inner.ready().await.map_err(|e| { 876 - tonic::Status::unknown(format!("Service was not ready: {}", e.into())) 877 - })?; 991 + self.inner 992 + .ready() 993 + .await 994 + .map_err(|e| { 995 + tonic::Status::unknown( 996 + format!("Service was not ready: {}", e.into()), 997 + ) 998 + })?; 878 999 let codec = tonic::codec::ProstCodec::default(); 879 1000 let path = http::uri::PathAndQuery::from_static( 880 1001 "/rockbox.v1alpha1.LibraryService/StreamLibrary", 881 1002 ); 882 1003 let mut req = request.into_request(); 883 - req.extensions_mut().insert(GrpcMethod::new( 884 - "rockbox.v1alpha1.LibraryService", 885 - "StreamLibrary", 886 - )); 1004 + req.extensions_mut() 1005 + .insert( 1006 + GrpcMethod::new("rockbox.v1alpha1.LibraryService", "StreamLibrary"), 1007 + ); 887 1008 self.inner.server_streaming(req, path, codec).await 888 1009 } 889 1010 pub async fn search( 890 1011 &mut self, 891 1012 request: impl tonic::IntoRequest<super::SearchRequest>, 892 1013 ) -> std::result::Result<tonic::Response<super::SearchResponse>, tonic::Status> { 893 - self.inner.ready().await.map_err(|e| { 894 - tonic::Status::unknown(format!("Service was not ready: {}", e.into())) 895 - })?; 1014 + self.inner 1015 + .ready() 1016 + .await 1017 + .map_err(|e| { 1018 + tonic::Status::unknown( 1019 + format!("Service was not ready: {}", e.into()), 1020 + ) 1021 + })?; 896 1022 let codec = tonic::codec::ProstCodec::default(); 897 - let path = 898 - http::uri::PathAndQuery::from_static("/rockbox.v1alpha1.LibraryService/Search"); 1023 + let path = http::uri::PathAndQuery::from_static( 1024 + "/rockbox.v1alpha1.LibraryService/Search", 1025 + ); 899 1026 let mut req = request.into_request(); 900 1027 req.extensions_mut() 901 1028 .insert(GrpcMethod::new("rockbox.v1alpha1.LibraryService", "Search")); ··· 910 1037 dead_code, 911 1038 missing_docs, 912 1039 clippy::wildcard_imports, 913 - clippy::let_unit_value 1040 + clippy::let_unit_value, 914 1041 )] 915 1042 use tonic::codegen::*; 916 1043 /// Generated trait containing gRPC methods that should be implemented for use with LibraryServiceServer. ··· 919 1046 async fn get_albums( 920 1047 &self, 921 1048 request: tonic::Request<super::GetAlbumsRequest>, 922 - ) -> std::result::Result<tonic::Response<super::GetAlbumsResponse>, tonic::Status>; 1049 + ) -> std::result::Result< 1050 + tonic::Response<super::GetAlbumsResponse>, 1051 + tonic::Status, 1052 + >; 923 1053 async fn get_artists( 924 1054 &self, 925 1055 request: tonic::Request<super::GetArtistsRequest>, 926 - ) -> std::result::Result<tonic::Response<super::GetArtistsResponse>, tonic::Status>; 1056 + ) -> std::result::Result< 1057 + tonic::Response<super::GetArtistsResponse>, 1058 + tonic::Status, 1059 + >; 927 1060 async fn get_tracks( 928 1061 &self, 929 1062 request: tonic::Request<super::GetTracksRequest>, 930 - ) -> std::result::Result<tonic::Response<super::GetTracksResponse>, tonic::Status>; 1063 + ) -> std::result::Result< 1064 + tonic::Response<super::GetTracksResponse>, 1065 + tonic::Status, 1066 + >; 931 1067 async fn get_album( 932 1068 &self, 933 1069 request: tonic::Request<super::GetAlbumRequest>, 934 - ) -> std::result::Result<tonic::Response<super::GetAlbumResponse>, tonic::Status>; 1070 + ) -> std::result::Result< 1071 + tonic::Response<super::GetAlbumResponse>, 1072 + tonic::Status, 1073 + >; 935 1074 async fn get_artist( 936 1075 &self, 937 1076 request: tonic::Request<super::GetArtistRequest>, 938 - ) -> std::result::Result<tonic::Response<super::GetArtistResponse>, tonic::Status>; 1077 + ) -> std::result::Result< 1078 + tonic::Response<super::GetArtistResponse>, 1079 + tonic::Status, 1080 + >; 939 1081 async fn get_track( 940 1082 &self, 941 1083 request: tonic::Request<super::GetTrackRequest>, 942 - ) -> std::result::Result<tonic::Response<super::GetTrackResponse>, tonic::Status>; 1084 + ) -> std::result::Result< 1085 + tonic::Response<super::GetTrackResponse>, 1086 + tonic::Status, 1087 + >; 943 1088 async fn like_track( 944 1089 &self, 945 1090 request: tonic::Request<super::LikeTrackRequest>, 946 - ) -> std::result::Result<tonic::Response<super::LikeTrackResponse>, tonic::Status>; 1091 + ) -> std::result::Result< 1092 + tonic::Response<super::LikeTrackResponse>, 1093 + tonic::Status, 1094 + >; 947 1095 async fn unlike_track( 948 1096 &self, 949 1097 request: tonic::Request<super::UnlikeTrackRequest>, 950 - ) -> std::result::Result<tonic::Response<super::UnlikeTrackResponse>, tonic::Status>; 1098 + ) -> std::result::Result< 1099 + tonic::Response<super::UnlikeTrackResponse>, 1100 + tonic::Status, 1101 + >; 951 1102 async fn like_album( 952 1103 &self, 953 1104 request: tonic::Request<super::LikeAlbumRequest>, 954 - ) -> std::result::Result<tonic::Response<super::LikeAlbumResponse>, tonic::Status>; 1105 + ) -> std::result::Result< 1106 + tonic::Response<super::LikeAlbumResponse>, 1107 + tonic::Status, 1108 + >; 955 1109 async fn unlike_album( 956 1110 &self, 957 1111 request: tonic::Request<super::UnlikeAlbumRequest>, 958 - ) -> std::result::Result<tonic::Response<super::UnlikeAlbumResponse>, tonic::Status>; 1112 + ) -> std::result::Result< 1113 + tonic::Response<super::UnlikeAlbumResponse>, 1114 + tonic::Status, 1115 + >; 959 1116 async fn get_liked_tracks( 960 1117 &self, 961 1118 request: tonic::Request<super::GetLikedTracksRequest>, 962 - ) -> std::result::Result<tonic::Response<super::GetLikedTracksResponse>, tonic::Status>; 1119 + ) -> std::result::Result< 1120 + tonic::Response<super::GetLikedTracksResponse>, 1121 + tonic::Status, 1122 + >; 963 1123 async fn get_liked_albums( 964 1124 &self, 965 1125 request: tonic::Request<super::GetLikedAlbumsRequest>, 966 - ) -> std::result::Result<tonic::Response<super::GetLikedAlbumsResponse>, tonic::Status>; 1126 + ) -> std::result::Result< 1127 + tonic::Response<super::GetLikedAlbumsResponse>, 1128 + tonic::Status, 1129 + >; 967 1130 async fn scan_library( 968 1131 &self, 969 1132 request: tonic::Request<super::ScanLibraryRequest>, 970 - ) -> std::result::Result<tonic::Response<super::ScanLibraryResponse>, tonic::Status>; 1133 + ) -> std::result::Result< 1134 + tonic::Response<super::ScanLibraryResponse>, 1135 + tonic::Status, 1136 + >; 971 1137 /// Server streaming response type for the StreamLibrary method. 972 1138 type StreamLibraryStream: tonic::codegen::tokio_stream::Stream< 973 1139 Item = std::result::Result<super::StreamLibraryResponse, tonic::Status>, 974 - > + std::marker::Send 1140 + > 1141 + + std::marker::Send 975 1142 + 'static; 976 1143 async fn stream_library( 977 1144 &self, 978 1145 request: tonic::Request<super::StreamLibraryRequest>, 979 - ) -> std::result::Result<tonic::Response<Self::StreamLibraryStream>, tonic::Status>; 1146 + ) -> std::result::Result< 1147 + tonic::Response<Self::StreamLibraryStream>, 1148 + tonic::Status, 1149 + >; 980 1150 async fn search( 981 1151 &self, 982 1152 request: tonic::Request<super::SearchRequest>, ··· 1003 1173 max_encoding_message_size: None, 1004 1174 } 1005 1175 } 1006 - pub fn with_interceptor<F>(inner: T, interceptor: F) -> InterceptedService<Self, F> 1176 + pub fn with_interceptor<F>( 1177 + inner: T, 1178 + interceptor: F, 1179 + ) -> InterceptedService<Self, F> 1007 1180 where 1008 1181 F: tonic::service::Interceptor, 1009 1182 { ··· 1058 1231 "/rockbox.v1alpha1.LibraryService/GetAlbums" => { 1059 1232 #[allow(non_camel_case_types)] 1060 1233 struct GetAlbumsSvc<T: LibraryService>(pub Arc<T>); 1061 - impl<T: LibraryService> tonic::server::UnaryService<super::GetAlbumsRequest> for GetAlbumsSvc<T> { 1234 + impl< 1235 + T: LibraryService, 1236 + > tonic::server::UnaryService<super::GetAlbumsRequest> 1237 + for GetAlbumsSvc<T> { 1062 1238 type Response = super::GetAlbumsResponse; 1063 - type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>; 1239 + type Future = BoxFuture< 1240 + tonic::Response<Self::Response>, 1241 + tonic::Status, 1242 + >; 1064 1243 fn call( 1065 1244 &mut self, 1066 1245 request: tonic::Request<super::GetAlbumsRequest>, ··· 1097 1276 "/rockbox.v1alpha1.LibraryService/GetArtists" => { 1098 1277 #[allow(non_camel_case_types)] 1099 1278 struct GetArtistsSvc<T: LibraryService>(pub Arc<T>); 1100 - impl<T: LibraryService> tonic::server::UnaryService<super::GetArtistsRequest> for GetArtistsSvc<T> { 1279 + impl< 1280 + T: LibraryService, 1281 + > tonic::server::UnaryService<super::GetArtistsRequest> 1282 + for GetArtistsSvc<T> { 1101 1283 type Response = super::GetArtistsResponse; 1102 - type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>; 1284 + type Future = BoxFuture< 1285 + tonic::Response<Self::Response>, 1286 + tonic::Status, 1287 + >; 1103 1288 fn call( 1104 1289 &mut self, 1105 1290 request: tonic::Request<super::GetArtistsRequest>, ··· 1136 1321 "/rockbox.v1alpha1.LibraryService/GetTracks" => { 1137 1322 #[allow(non_camel_case_types)] 1138 1323 struct GetTracksSvc<T: LibraryService>(pub Arc<T>); 1139 - impl<T: LibraryService> tonic::server::UnaryService<super::GetTracksRequest> for GetTracksSvc<T> { 1324 + impl< 1325 + T: LibraryService, 1326 + > tonic::server::UnaryService<super::GetTracksRequest> 1327 + for GetTracksSvc<T> { 1140 1328 type Response = super::GetTracksResponse; 1141 - type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>; 1329 + type Future = BoxFuture< 1330 + tonic::Response<Self::Response>, 1331 + tonic::Status, 1332 + >; 1142 1333 fn call( 1143 1334 &mut self, 1144 1335 request: tonic::Request<super::GetTracksRequest>, ··· 1175 1366 "/rockbox.v1alpha1.LibraryService/GetAlbum" => { 1176 1367 #[allow(non_camel_case_types)] 1177 1368 struct GetAlbumSvc<T: LibraryService>(pub Arc<T>); 1178 - impl<T: LibraryService> tonic::server::UnaryService<super::GetAlbumRequest> for GetAlbumSvc<T> { 1369 + impl< 1370 + T: LibraryService, 1371 + > tonic::server::UnaryService<super::GetAlbumRequest> 1372 + for GetAlbumSvc<T> { 1179 1373 type Response = super::GetAlbumResponse; 1180 - type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>; 1374 + type Future = BoxFuture< 1375 + tonic::Response<Self::Response>, 1376 + tonic::Status, 1377 + >; 1181 1378 fn call( 1182 1379 &mut self, 1183 1380 request: tonic::Request<super::GetAlbumRequest>, ··· 1214 1411 "/rockbox.v1alpha1.LibraryService/GetArtist" => { 1215 1412 #[allow(non_camel_case_types)] 1216 1413 struct GetArtistSvc<T: LibraryService>(pub Arc<T>); 1217 - impl<T: LibraryService> tonic::server::UnaryService<super::GetArtistRequest> for GetArtistSvc<T> { 1414 + impl< 1415 + T: LibraryService, 1416 + > tonic::server::UnaryService<super::GetArtistRequest> 1417 + for GetArtistSvc<T> { 1218 1418 type Response = super::GetArtistResponse; 1219 - type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>; 1419 + type Future = BoxFuture< 1420 + tonic::Response<Self::Response>, 1421 + tonic::Status, 1422 + >; 1220 1423 fn call( 1221 1424 &mut self, 1222 1425 request: tonic::Request<super::GetArtistRequest>, ··· 1253 1456 "/rockbox.v1alpha1.LibraryService/GetTrack" => { 1254 1457 #[allow(non_camel_case_types)] 1255 1458 struct GetTrackSvc<T: LibraryService>(pub Arc<T>); 1256 - impl<T: LibraryService> tonic::server::UnaryService<super::GetTrackRequest> for GetTrackSvc<T> { 1459 + impl< 1460 + T: LibraryService, 1461 + > tonic::server::UnaryService<super::GetTrackRequest> 1462 + for GetTrackSvc<T> { 1257 1463 type Response = super::GetTrackResponse; 1258 - type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>; 1464 + type Future = BoxFuture< 1465 + tonic::Response<Self::Response>, 1466 + tonic::Status, 1467 + >; 1259 1468 fn call( 1260 1469 &mut self, 1261 1470 request: tonic::Request<super::GetTrackRequest>, ··· 1292 1501 "/rockbox.v1alpha1.LibraryService/LikeTrack" => { 1293 1502 #[allow(non_camel_case_types)] 1294 1503 struct LikeTrackSvc<T: LibraryService>(pub Arc<T>); 1295 - impl<T: LibraryService> tonic::server::UnaryService<super::LikeTrackRequest> for LikeTrackSvc<T> { 1504 + impl< 1505 + T: LibraryService, 1506 + > tonic::server::UnaryService<super::LikeTrackRequest> 1507 + for LikeTrackSvc<T> { 1296 1508 type Response = super::LikeTrackResponse; 1297 - type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>; 1509 + type Future = BoxFuture< 1510 + tonic::Response<Self::Response>, 1511 + tonic::Status, 1512 + >; 1298 1513 fn call( 1299 1514 &mut self, 1300 1515 request: tonic::Request<super::LikeTrackRequest>, ··· 1331 1546 "/rockbox.v1alpha1.LibraryService/UnlikeTrack" => { 1332 1547 #[allow(non_camel_case_types)] 1333 1548 struct UnlikeTrackSvc<T: LibraryService>(pub Arc<T>); 1334 - impl<T: LibraryService> tonic::server::UnaryService<super::UnlikeTrackRequest> 1335 - for UnlikeTrackSvc<T> 1336 - { 1549 + impl< 1550 + T: LibraryService, 1551 + > tonic::server::UnaryService<super::UnlikeTrackRequest> 1552 + for UnlikeTrackSvc<T> { 1337 1553 type Response = super::UnlikeTrackResponse; 1338 - type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>; 1554 + type Future = BoxFuture< 1555 + tonic::Response<Self::Response>, 1556 + tonic::Status, 1557 + >; 1339 1558 fn call( 1340 1559 &mut self, 1341 1560 request: tonic::Request<super::UnlikeTrackRequest>, ··· 1372 1591 "/rockbox.v1alpha1.LibraryService/LikeAlbum" => { 1373 1592 #[allow(non_camel_case_types)] 1374 1593 struct LikeAlbumSvc<T: LibraryService>(pub Arc<T>); 1375 - impl<T: LibraryService> tonic::server::UnaryService<super::LikeAlbumRequest> for LikeAlbumSvc<T> { 1594 + impl< 1595 + T: LibraryService, 1596 + > tonic::server::UnaryService<super::LikeAlbumRequest> 1597 + for LikeAlbumSvc<T> { 1376 1598 type Response = super::LikeAlbumResponse; 1377 - type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>; 1599 + type Future = BoxFuture< 1600 + tonic::Response<Self::Response>, 1601 + tonic::Status, 1602 + >; 1378 1603 fn call( 1379 1604 &mut self, 1380 1605 request: tonic::Request<super::LikeAlbumRequest>, ··· 1411 1636 "/rockbox.v1alpha1.LibraryService/UnlikeAlbum" => { 1412 1637 #[allow(non_camel_case_types)] 1413 1638 struct UnlikeAlbumSvc<T: LibraryService>(pub Arc<T>); 1414 - impl<T: LibraryService> tonic::server::UnaryService<super::UnlikeAlbumRequest> 1415 - for UnlikeAlbumSvc<T> 1416 - { 1639 + impl< 1640 + T: LibraryService, 1641 + > tonic::server::UnaryService<super::UnlikeAlbumRequest> 1642 + for UnlikeAlbumSvc<T> { 1417 1643 type Response = super::UnlikeAlbumResponse; 1418 - type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>; 1644 + type Future = BoxFuture< 1645 + tonic::Response<Self::Response>, 1646 + tonic::Status, 1647 + >; 1419 1648 fn call( 1420 1649 &mut self, 1421 1650 request: tonic::Request<super::UnlikeAlbumRequest>, ··· 1452 1681 "/rockbox.v1alpha1.LibraryService/GetLikedTracks" => { 1453 1682 #[allow(non_camel_case_types)] 1454 1683 struct GetLikedTracksSvc<T: LibraryService>(pub Arc<T>); 1455 - impl<T: LibraryService> 1456 - tonic::server::UnaryService<super::GetLikedTracksRequest> 1457 - for GetLikedTracksSvc<T> 1458 - { 1684 + impl< 1685 + T: LibraryService, 1686 + > tonic::server::UnaryService<super::GetLikedTracksRequest> 1687 + for GetLikedTracksSvc<T> { 1459 1688 type Response = super::GetLikedTracksResponse; 1460 - type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>; 1689 + type Future = BoxFuture< 1690 + tonic::Response<Self::Response>, 1691 + tonic::Status, 1692 + >; 1461 1693 fn call( 1462 1694 &mut self, 1463 1695 request: tonic::Request<super::GetLikedTracksRequest>, 1464 1696 ) -> Self::Future { 1465 1697 let inner = Arc::clone(&self.0); 1466 1698 let fut = async move { 1467 - <T as LibraryService>::get_liked_tracks(&inner, request).await 1699 + <T as LibraryService>::get_liked_tracks(&inner, request) 1700 + .await 1468 1701 }; 1469 1702 Box::pin(fut) 1470 1703 } ··· 1494 1727 "/rockbox.v1alpha1.LibraryService/GetLikedAlbums" => { 1495 1728 #[allow(non_camel_case_types)] 1496 1729 struct GetLikedAlbumsSvc<T: LibraryService>(pub Arc<T>); 1497 - impl<T: LibraryService> 1498 - tonic::server::UnaryService<super::GetLikedAlbumsRequest> 1499 - for GetLikedAlbumsSvc<T> 1500 - { 1730 + impl< 1731 + T: LibraryService, 1732 + > tonic::server::UnaryService<super::GetLikedAlbumsRequest> 1733 + for GetLikedAlbumsSvc<T> { 1501 1734 type Response = super::GetLikedAlbumsResponse; 1502 - type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>; 1735 + type Future = BoxFuture< 1736 + tonic::Response<Self::Response>, 1737 + tonic::Status, 1738 + >; 1503 1739 fn call( 1504 1740 &mut self, 1505 1741 request: tonic::Request<super::GetLikedAlbumsRequest>, 1506 1742 ) -> Self::Future { 1507 1743 let inner = Arc::clone(&self.0); 1508 1744 let fut = async move { 1509 - <T as LibraryService>::get_liked_albums(&inner, request).await 1745 + <T as LibraryService>::get_liked_albums(&inner, request) 1746 + .await 1510 1747 }; 1511 1748 Box::pin(fut) 1512 1749 } ··· 1536 1773 "/rockbox.v1alpha1.LibraryService/ScanLibrary" => { 1537 1774 #[allow(non_camel_case_types)] 1538 1775 struct ScanLibrarySvc<T: LibraryService>(pub Arc<T>); 1539 - impl<T: LibraryService> tonic::server::UnaryService<super::ScanLibraryRequest> 1540 - for ScanLibrarySvc<T> 1541 - { 1776 + impl< 1777 + T: LibraryService, 1778 + > tonic::server::UnaryService<super::ScanLibraryRequest> 1779 + for ScanLibrarySvc<T> { 1542 1780 type Response = super::ScanLibraryResponse; 1543 - type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>; 1781 + type Future = BoxFuture< 1782 + tonic::Response<Self::Response>, 1783 + tonic::Status, 1784 + >; 1544 1785 fn call( 1545 1786 &mut self, 1546 1787 request: tonic::Request<super::ScanLibraryRequest>, ··· 1577 1818 "/rockbox.v1alpha1.LibraryService/StreamLibrary" => { 1578 1819 #[allow(non_camel_case_types)] 1579 1820 struct StreamLibrarySvc<T: LibraryService>(pub Arc<T>); 1580 - impl<T: LibraryService> 1581 - tonic::server::ServerStreamingService<super::StreamLibraryRequest> 1582 - for StreamLibrarySvc<T> 1583 - { 1821 + impl< 1822 + T: LibraryService, 1823 + > tonic::server::ServerStreamingService<super::StreamLibraryRequest> 1824 + for StreamLibrarySvc<T> { 1584 1825 type Response = super::StreamLibraryResponse; 1585 1826 type ResponseStream = T::StreamLibraryStream; 1586 - type Future = 1587 - BoxFuture<tonic::Response<Self::ResponseStream>, tonic::Status>; 1827 + type Future = BoxFuture< 1828 + tonic::Response<Self::ResponseStream>, 1829 + tonic::Status, 1830 + >; 1588 1831 fn call( 1589 1832 &mut self, 1590 1833 request: tonic::Request<super::StreamLibraryRequest>, ··· 1621 1864 "/rockbox.v1alpha1.LibraryService/Search" => { 1622 1865 #[allow(non_camel_case_types)] 1623 1866 struct SearchSvc<T: LibraryService>(pub Arc<T>); 1624 - impl<T: LibraryService> tonic::server::UnaryService<super::SearchRequest> for SearchSvc<T> { 1867 + impl< 1868 + T: LibraryService, 1869 + > tonic::server::UnaryService<super::SearchRequest> 1870 + for SearchSvc<T> { 1625 1871 type Response = super::SearchResponse; 1626 - type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>; 1872 + type Future = BoxFuture< 1873 + tonic::Response<Self::Response>, 1874 + tonic::Status, 1875 + >; 1627 1876 fn call( 1628 1877 &mut self, 1629 1878 request: tonic::Request<super::SearchRequest>, 1630 1879 ) -> Self::Future { 1631 1880 let inner = Arc::clone(&self.0); 1632 - let fut = 1633 - async move { <T as LibraryService>::search(&inner, request).await }; 1881 + let fut = async move { 1882 + <T as LibraryService>::search(&inner, request).await 1883 + }; 1634 1884 Box::pin(fut) 1635 1885 } 1636 1886 } ··· 1656 1906 }; 1657 1907 Box::pin(fut) 1658 1908 } 1659 - _ => Box::pin(async move { 1660 - let mut response = http::Response::new(empty_body()); 1661 - let headers = response.headers_mut(); 1662 - headers.insert( 1663 - tonic::Status::GRPC_STATUS, 1664 - (tonic::Code::Unimplemented as i32).into(), 1665 - ); 1666 - headers.insert( 1667 - http::header::CONTENT_TYPE, 1668 - tonic::metadata::GRPC_CONTENT_TYPE, 1669 - ); 1670 - Ok(response) 1671 - }), 1909 + _ => { 1910 + Box::pin(async move { 1911 + let mut response = http::Response::new(empty_body()); 1912 + let headers = response.headers_mut(); 1913 + headers 1914 + .insert( 1915 + tonic::Status::GRPC_STATUS, 1916 + (tonic::Code::Unimplemented as i32).into(), 1917 + ); 1918 + headers 1919 + .insert( 1920 + http::header::CONTENT_TYPE, 1921 + tonic::metadata::GRPC_CONTENT_TYPE, 1922 + ); 1923 + Ok(response) 1924 + }) 1925 + } 1672 1926 } 1673 1927 } 1674 1928 } ··· 1697 1951 dead_code, 1698 1952 missing_docs, 1699 1953 clippy::wildcard_imports, 1700 - clippy::let_unit_value 1954 + clippy::let_unit_value, 1701 1955 )] 1702 - use tonic::codegen::http::Uri; 1703 1956 use tonic::codegen::*; 1957 + use tonic::codegen::http::Uri; 1704 1958 #[derive(Debug, Clone)] 1705 1959 pub struct MetadataServiceClient<T> { 1706 1960 inner: tonic::client::Grpc<T>, ··· 1744 1998 <T as tonic::client::GrpcService<tonic::body::BoxBody>>::ResponseBody, 1745 1999 >, 1746 2000 >, 1747 - <T as tonic::codegen::Service<http::Request<tonic::body::BoxBody>>>::Error: 1748 - Into<StdError> + std::marker::Send + std::marker::Sync, 2001 + <T as tonic::codegen::Service< 2002 + http::Request<tonic::body::BoxBody>, 2003 + >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync, 1749 2004 { 1750 2005 MetadataServiceClient::new(InterceptedService::new(inner, interceptor)) 1751 2006 } ··· 1789 2044 dead_code, 1790 2045 missing_docs, 1791 2046 clippy::wildcard_imports, 1792 - clippy::let_unit_value 2047 + clippy::let_unit_value, 1793 2048 )] 1794 2049 use tonic::codegen::*; 1795 2050 /// Generated trait containing gRPC methods that should be implemented for use with MetadataServiceServer. ··· 1816 2071 max_encoding_message_size: None, 1817 2072 } 1818 2073 } 1819 - pub fn with_interceptor<F>(inner: T, interceptor: F) -> InterceptedService<Self, F> 2074 + pub fn with_interceptor<F>( 2075 + inner: T, 2076 + interceptor: F, 2077 + ) -> InterceptedService<Self, F> 1820 2078 where 1821 2079 F: tonic::service::Interceptor, 1822 2080 { ··· 1868 2126 } 1869 2127 fn call(&mut self, req: http::Request<B>) -> Self::Future { 1870 2128 match req.uri().path() { 1871 - _ => Box::pin(async move { 1872 - let mut response = http::Response::new(empty_body()); 1873 - let headers = response.headers_mut(); 1874 - headers.insert( 1875 - tonic::Status::GRPC_STATUS, 1876 - (tonic::Code::Unimplemented as i32).into(), 1877 - ); 1878 - headers.insert( 1879 - http::header::CONTENT_TYPE, 1880 - tonic::metadata::GRPC_CONTENT_TYPE, 1881 - ); 1882 - Ok(response) 1883 - }), 2129 + _ => { 2130 + Box::pin(async move { 2131 + let mut response = http::Response::new(empty_body()); 2132 + let headers = response.headers_mut(); 2133 + headers 2134 + .insert( 2135 + tonic::Status::GRPC_STATUS, 2136 + (tonic::Code::Unimplemented as i32).into(), 2137 + ); 2138 + headers 2139 + .insert( 2140 + http::header::CONTENT_TYPE, 2141 + tonic::metadata::GRPC_CONTENT_TYPE, 2142 + ); 2143 + Ok(response) 2144 + }) 2145 + } 1884 2146 } 1885 2147 } 1886 2148 } ··· 2164 2426 dead_code, 2165 2427 missing_docs, 2166 2428 clippy::wildcard_imports, 2167 - clippy::let_unit_value 2429 + clippy::let_unit_value, 2168 2430 )] 2169 - use tonic::codegen::http::Uri; 2170 2431 use tonic::codegen::*; 2432 + use tonic::codegen::http::Uri; 2171 2433 #[derive(Debug, Clone)] 2172 2434 pub struct PlaybackServiceClient<T> { 2173 2435 inner: tonic::client::Grpc<T>, ··· 2211 2473 <T as tonic::client::GrpcService<tonic::body::BoxBody>>::ResponseBody, 2212 2474 >, 2213 2475 >, 2214 - <T as tonic::codegen::Service<http::Request<tonic::body::BoxBody>>>::Error: 2215 - Into<StdError> + std::marker::Send + std::marker::Sync, 2476 + <T as tonic::codegen::Service< 2477 + http::Request<tonic::body::BoxBody>, 2478 + >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync, 2216 2479 { 2217 2480 PlaybackServiceClient::new(InterceptedService::new(inner, interceptor)) 2218 2481 } ··· 2251 2514 &mut self, 2252 2515 request: impl tonic::IntoRequest<super::PlayRequest>, 2253 2516 ) -> std::result::Result<tonic::Response<super::PlayResponse>, tonic::Status> { 2254 - self.inner.ready().await.map_err(|e| { 2255 - tonic::Status::unknown(format!("Service was not ready: {}", e.into())) 2256 - })?; 2517 + self.inner 2518 + .ready() 2519 + .await 2520 + .map_err(|e| { 2521 + tonic::Status::unknown( 2522 + format!("Service was not ready: {}", e.into()), 2523 + ) 2524 + })?; 2257 2525 let codec = tonic::codec::ProstCodec::default(); 2258 - let path = 2259 - http::uri::PathAndQuery::from_static("/rockbox.v1alpha1.PlaybackService/Play"); 2526 + let path = http::uri::PathAndQuery::from_static( 2527 + "/rockbox.v1alpha1.PlaybackService/Play", 2528 + ); 2260 2529 let mut req = request.into_request(); 2261 2530 req.extensions_mut() 2262 2531 .insert(GrpcMethod::new("rockbox.v1alpha1.PlaybackService", "Play")); ··· 2266 2535 &mut self, 2267 2536 request: impl tonic::IntoRequest<super::PauseRequest>, 2268 2537 ) -> std::result::Result<tonic::Response<super::PauseResponse>, tonic::Status> { 2269 - self.inner.ready().await.map_err(|e| { 2270 - tonic::Status::unknown(format!("Service was not ready: {}", e.into())) 2271 - })?; 2538 + self.inner 2539 + .ready() 2540 + .await 2541 + .map_err(|e| { 2542 + tonic::Status::unknown( 2543 + format!("Service was not ready: {}", e.into()), 2544 + ) 2545 + })?; 2272 2546 let codec = tonic::codec::ProstCodec::default(); 2273 - let path = 2274 - http::uri::PathAndQuery::from_static("/rockbox.v1alpha1.PlaybackService/Pause"); 2547 + let path = http::uri::PathAndQuery::from_static( 2548 + "/rockbox.v1alpha1.PlaybackService/Pause", 2549 + ); 2275 2550 let mut req = request.into_request(); 2276 2551 req.extensions_mut() 2277 2552 .insert(GrpcMethod::new("rockbox.v1alpha1.PlaybackService", "Pause")); ··· 2280 2555 pub async fn play_or_pause( 2281 2556 &mut self, 2282 2557 request: impl tonic::IntoRequest<super::PlayOrPauseRequest>, 2283 - ) -> std::result::Result<tonic::Response<super::PlayOrPauseResponse>, tonic::Status> 2284 - { 2285 - self.inner.ready().await.map_err(|e| { 2286 - tonic::Status::unknown(format!("Service was not ready: {}", e.into())) 2287 - })?; 2558 + ) -> std::result::Result< 2559 + tonic::Response<super::PlayOrPauseResponse>, 2560 + tonic::Status, 2561 + > { 2562 + self.inner 2563 + .ready() 2564 + .await 2565 + .map_err(|e| { 2566 + tonic::Status::unknown( 2567 + format!("Service was not ready: {}", e.into()), 2568 + ) 2569 + })?; 2288 2570 let codec = tonic::codec::ProstCodec::default(); 2289 2571 let path = http::uri::PathAndQuery::from_static( 2290 2572 "/rockbox.v1alpha1.PlaybackService/PlayOrPause", 2291 2573 ); 2292 2574 let mut req = request.into_request(); 2293 - req.extensions_mut().insert(GrpcMethod::new( 2294 - "rockbox.v1alpha1.PlaybackService", 2295 - "PlayOrPause", 2296 - )); 2575 + req.extensions_mut() 2576 + .insert( 2577 + GrpcMethod::new("rockbox.v1alpha1.PlaybackService", "PlayOrPause"), 2578 + ); 2297 2579 self.inner.unary(req, path, codec).await 2298 2580 } 2299 2581 pub async fn resume( 2300 2582 &mut self, 2301 2583 request: impl tonic::IntoRequest<super::ResumeRequest>, 2302 2584 ) -> std::result::Result<tonic::Response<super::ResumeResponse>, tonic::Status> { 2303 - self.inner.ready().await.map_err(|e| { 2304 - tonic::Status::unknown(format!("Service was not ready: {}", e.into())) 2305 - })?; 2585 + self.inner 2586 + .ready() 2587 + .await 2588 + .map_err(|e| { 2589 + tonic::Status::unknown( 2590 + format!("Service was not ready: {}", e.into()), 2591 + ) 2592 + })?; 2306 2593 let codec = tonic::codec::ProstCodec::default(); 2307 - let path = 2308 - http::uri::PathAndQuery::from_static("/rockbox.v1alpha1.PlaybackService/Resume"); 2594 + let path = http::uri::PathAndQuery::from_static( 2595 + "/rockbox.v1alpha1.PlaybackService/Resume", 2596 + ); 2309 2597 let mut req = request.into_request(); 2310 - req.extensions_mut().insert(GrpcMethod::new( 2311 - "rockbox.v1alpha1.PlaybackService", 2312 - "Resume", 2313 - )); 2598 + req.extensions_mut() 2599 + .insert(GrpcMethod::new("rockbox.v1alpha1.PlaybackService", "Resume")); 2314 2600 self.inner.unary(req, path, codec).await 2315 2601 } 2316 2602 pub async fn next( 2317 2603 &mut self, 2318 2604 request: impl tonic::IntoRequest<super::NextRequest>, 2319 2605 ) -> std::result::Result<tonic::Response<super::NextResponse>, tonic::Status> { 2320 - self.inner.ready().await.map_err(|e| { 2321 - tonic::Status::unknown(format!("Service was not ready: {}", e.into())) 2322 - })?; 2606 + self.inner 2607 + .ready() 2608 + .await 2609 + .map_err(|e| { 2610 + tonic::Status::unknown( 2611 + format!("Service was not ready: {}", e.into()), 2612 + ) 2613 + })?; 2323 2614 let codec = tonic::codec::ProstCodec::default(); 2324 - let path = 2325 - http::uri::PathAndQuery::from_static("/rockbox.v1alpha1.PlaybackService/Next"); 2615 + let path = http::uri::PathAndQuery::from_static( 2616 + "/rockbox.v1alpha1.PlaybackService/Next", 2617 + ); 2326 2618 let mut req = request.into_request(); 2327 2619 req.extensions_mut() 2328 2620 .insert(GrpcMethod::new("rockbox.v1alpha1.PlaybackService", "Next")); ··· 2331 2623 pub async fn previous( 2332 2624 &mut self, 2333 2625 request: impl tonic::IntoRequest<super::PreviousRequest>, 2334 - ) -> std::result::Result<tonic::Response<super::PreviousResponse>, tonic::Status> { 2335 - self.inner.ready().await.map_err(|e| { 2336 - tonic::Status::unknown(format!("Service was not ready: {}", e.into())) 2337 - })?; 2626 + ) -> std::result::Result< 2627 + tonic::Response<super::PreviousResponse>, 2628 + tonic::Status, 2629 + > { 2630 + self.inner 2631 + .ready() 2632 + .await 2633 + .map_err(|e| { 2634 + tonic::Status::unknown( 2635 + format!("Service was not ready: {}", e.into()), 2636 + ) 2637 + })?; 2338 2638 let codec = tonic::codec::ProstCodec::default(); 2339 - let path = 2340 - http::uri::PathAndQuery::from_static("/rockbox.v1alpha1.PlaybackService/Previous"); 2639 + let path = http::uri::PathAndQuery::from_static( 2640 + "/rockbox.v1alpha1.PlaybackService/Previous", 2641 + ); 2341 2642 let mut req = request.into_request(); 2342 - req.extensions_mut().insert(GrpcMethod::new( 2343 - "rockbox.v1alpha1.PlaybackService", 2344 - "Previous", 2345 - )); 2643 + req.extensions_mut() 2644 + .insert(GrpcMethod::new("rockbox.v1alpha1.PlaybackService", "Previous")); 2346 2645 self.inner.unary(req, path, codec).await 2347 2646 } 2348 2647 pub async fn fast_forward_rewind( 2349 2648 &mut self, 2350 2649 request: impl tonic::IntoRequest<super::FastForwardRewindRequest>, 2351 - ) -> std::result::Result<tonic::Response<super::FastForwardRewindResponse>, tonic::Status> 2352 - { 2353 - self.inner.ready().await.map_err(|e| { 2354 - tonic::Status::unknown(format!("Service was not ready: {}", e.into())) 2355 - })?; 2650 + ) -> std::result::Result< 2651 + tonic::Response<super::FastForwardRewindResponse>, 2652 + tonic::Status, 2653 + > { 2654 + self.inner 2655 + .ready() 2656 + .await 2657 + .map_err(|e| { 2658 + tonic::Status::unknown( 2659 + format!("Service was not ready: {}", e.into()), 2660 + ) 2661 + })?; 2356 2662 let codec = tonic::codec::ProstCodec::default(); 2357 2663 let path = http::uri::PathAndQuery::from_static( 2358 2664 "/rockbox.v1alpha1.PlaybackService/FastForwardRewind", 2359 2665 ); 2360 2666 let mut req = request.into_request(); 2361 - req.extensions_mut().insert(GrpcMethod::new( 2362 - "rockbox.v1alpha1.PlaybackService", 2363 - "FastForwardRewind", 2364 - )); 2667 + req.extensions_mut() 2668 + .insert( 2669 + GrpcMethod::new( 2670 + "rockbox.v1alpha1.PlaybackService", 2671 + "FastForwardRewind", 2672 + ), 2673 + ); 2365 2674 self.inner.unary(req, path, codec).await 2366 2675 } 2367 2676 pub async fn status( 2368 2677 &mut self, 2369 2678 request: impl tonic::IntoRequest<super::StatusRequest>, 2370 2679 ) -> std::result::Result<tonic::Response<super::StatusResponse>, tonic::Status> { 2371 - self.inner.ready().await.map_err(|e| { 2372 - tonic::Status::unknown(format!("Service was not ready: {}", e.into())) 2373 - })?; 2680 + self.inner 2681 + .ready() 2682 + .await 2683 + .map_err(|e| { 2684 + tonic::Status::unknown( 2685 + format!("Service was not ready: {}", e.into()), 2686 + ) 2687 + })?; 2374 2688 let codec = tonic::codec::ProstCodec::default(); 2375 - let path = 2376 - http::uri::PathAndQuery::from_static("/rockbox.v1alpha1.PlaybackService/Status"); 2689 + let path = http::uri::PathAndQuery::from_static( 2690 + "/rockbox.v1alpha1.PlaybackService/Status", 2691 + ); 2377 2692 let mut req = request.into_request(); 2378 - req.extensions_mut().insert(GrpcMethod::new( 2379 - "rockbox.v1alpha1.PlaybackService", 2380 - "Status", 2381 - )); 2693 + req.extensions_mut() 2694 + .insert(GrpcMethod::new("rockbox.v1alpha1.PlaybackService", "Status")); 2382 2695 self.inner.unary(req, path, codec).await 2383 2696 } 2384 2697 pub async fn current_track( 2385 2698 &mut self, 2386 2699 request: impl tonic::IntoRequest<super::CurrentTrackRequest>, 2387 - ) -> std::result::Result<tonic::Response<super::CurrentTrackResponse>, tonic::Status> 2388 - { 2389 - self.inner.ready().await.map_err(|e| { 2390 - tonic::Status::unknown(format!("Service was not ready: {}", e.into())) 2391 - })?; 2700 + ) -> std::result::Result< 2701 + tonic::Response<super::CurrentTrackResponse>, 2702 + tonic::Status, 2703 + > { 2704 + self.inner 2705 + .ready() 2706 + .await 2707 + .map_err(|e| { 2708 + tonic::Status::unknown( 2709 + format!("Service was not ready: {}", e.into()), 2710 + ) 2711 + })?; 2392 2712 let codec = tonic::codec::ProstCodec::default(); 2393 2713 let path = http::uri::PathAndQuery::from_static( 2394 2714 "/rockbox.v1alpha1.PlaybackService/CurrentTrack", 2395 2715 ); 2396 2716 let mut req = request.into_request(); 2397 - req.extensions_mut().insert(GrpcMethod::new( 2398 - "rockbox.v1alpha1.PlaybackService", 2399 - "CurrentTrack", 2400 - )); 2717 + req.extensions_mut() 2718 + .insert( 2719 + GrpcMethod::new("rockbox.v1alpha1.PlaybackService", "CurrentTrack"), 2720 + ); 2401 2721 self.inner.unary(req, path, codec).await 2402 2722 } 2403 2723 pub async fn next_track( 2404 2724 &mut self, 2405 2725 request: impl tonic::IntoRequest<super::NextTrackRequest>, 2406 - ) -> std::result::Result<tonic::Response<super::NextTrackResponse>, tonic::Status> { 2407 - self.inner.ready().await.map_err(|e| { 2408 - tonic::Status::unknown(format!("Service was not ready: {}", e.into())) 2409 - })?; 2726 + ) -> std::result::Result< 2727 + tonic::Response<super::NextTrackResponse>, 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 + })?; 2410 2738 let codec = tonic::codec::ProstCodec::default(); 2411 - let path = 2412 - http::uri::PathAndQuery::from_static("/rockbox.v1alpha1.PlaybackService/NextTrack"); 2739 + let path = http::uri::PathAndQuery::from_static( 2740 + "/rockbox.v1alpha1.PlaybackService/NextTrack", 2741 + ); 2413 2742 let mut req = request.into_request(); 2414 - req.extensions_mut().insert(GrpcMethod::new( 2415 - "rockbox.v1alpha1.PlaybackService", 2416 - "NextTrack", 2417 - )); 2743 + req.extensions_mut() 2744 + .insert( 2745 + GrpcMethod::new("rockbox.v1alpha1.PlaybackService", "NextTrack"), 2746 + ); 2418 2747 self.inner.unary(req, path, codec).await 2419 2748 } 2420 2749 pub async fn flush_and_reload_tracks( 2421 2750 &mut self, 2422 2751 request: impl tonic::IntoRequest<super::FlushAndReloadTracksRequest>, 2423 - ) -> std::result::Result<tonic::Response<super::FlushAndReloadTracksResponse>, tonic::Status> 2424 - { 2425 - self.inner.ready().await.map_err(|e| { 2426 - tonic::Status::unknown(format!("Service was not ready: {}", e.into())) 2427 - })?; 2752 + ) -> std::result::Result< 2753 + tonic::Response<super::FlushAndReloadTracksResponse>, 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 + })?; 2428 2764 let codec = tonic::codec::ProstCodec::default(); 2429 2765 let path = http::uri::PathAndQuery::from_static( 2430 2766 "/rockbox.v1alpha1.PlaybackService/FlushAndReloadTracks", 2431 2767 ); 2432 2768 let mut req = request.into_request(); 2433 - req.extensions_mut().insert(GrpcMethod::new( 2434 - "rockbox.v1alpha1.PlaybackService", 2435 - "FlushAndReloadTracks", 2436 - )); 2769 + req.extensions_mut() 2770 + .insert( 2771 + GrpcMethod::new( 2772 + "rockbox.v1alpha1.PlaybackService", 2773 + "FlushAndReloadTracks", 2774 + ), 2775 + ); 2437 2776 self.inner.unary(req, path, codec).await 2438 2777 } 2439 2778 pub async fn get_file_position( 2440 2779 &mut self, 2441 2780 request: impl tonic::IntoRequest<super::GetFilePositionRequest>, 2442 - ) -> std::result::Result<tonic::Response<super::GetFilePositionResponse>, tonic::Status> 2443 - { 2444 - self.inner.ready().await.map_err(|e| { 2445 - tonic::Status::unknown(format!("Service was not ready: {}", e.into())) 2446 - })?; 2781 + ) -> std::result::Result< 2782 + tonic::Response<super::GetFilePositionResponse>, 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 + })?; 2447 2793 let codec = tonic::codec::ProstCodec::default(); 2448 2794 let path = http::uri::PathAndQuery::from_static( 2449 2795 "/rockbox.v1alpha1.PlaybackService/GetFilePosition", 2450 2796 ); 2451 2797 let mut req = request.into_request(); 2452 - req.extensions_mut().insert(GrpcMethod::new( 2453 - "rockbox.v1alpha1.PlaybackService", 2454 - "GetFilePosition", 2455 - )); 2798 + req.extensions_mut() 2799 + .insert( 2800 + GrpcMethod::new( 2801 + "rockbox.v1alpha1.PlaybackService", 2802 + "GetFilePosition", 2803 + ), 2804 + ); 2456 2805 self.inner.unary(req, path, codec).await 2457 2806 } 2458 2807 pub async fn hard_stop( 2459 2808 &mut self, 2460 2809 request: impl tonic::IntoRequest<super::HardStopRequest>, 2461 - ) -> std::result::Result<tonic::Response<super::HardStopResponse>, tonic::Status> { 2462 - self.inner.ready().await.map_err(|e| { 2463 - tonic::Status::unknown(format!("Service was not ready: {}", e.into())) 2464 - })?; 2810 + ) -> std::result::Result< 2811 + tonic::Response<super::HardStopResponse>, 2812 + tonic::Status, 2813 + > { 2814 + self.inner 2815 + .ready() 2816 + .await 2817 + .map_err(|e| { 2818 + tonic::Status::unknown( 2819 + format!("Service was not ready: {}", e.into()), 2820 + ) 2821 + })?; 2465 2822 let codec = tonic::codec::ProstCodec::default(); 2466 - let path = 2467 - http::uri::PathAndQuery::from_static("/rockbox.v1alpha1.PlaybackService/HardStop"); 2823 + let path = http::uri::PathAndQuery::from_static( 2824 + "/rockbox.v1alpha1.PlaybackService/HardStop", 2825 + ); 2468 2826 let mut req = request.into_request(); 2469 - req.extensions_mut().insert(GrpcMethod::new( 2470 - "rockbox.v1alpha1.PlaybackService", 2471 - "HardStop", 2472 - )); 2827 + req.extensions_mut() 2828 + .insert(GrpcMethod::new("rockbox.v1alpha1.PlaybackService", "HardStop")); 2473 2829 self.inner.unary(req, path, codec).await 2474 2830 } 2475 2831 pub async fn play_album( 2476 2832 &mut self, 2477 2833 request: impl tonic::IntoRequest<super::PlayAlbumRequest>, 2478 - ) -> std::result::Result<tonic::Response<super::PlayAlbumResponse>, tonic::Status> { 2479 - self.inner.ready().await.map_err(|e| { 2480 - tonic::Status::unknown(format!("Service was not ready: {}", e.into())) 2481 - })?; 2834 + ) -> std::result::Result< 2835 + tonic::Response<super::PlayAlbumResponse>, 2836 + tonic::Status, 2837 + > { 2838 + self.inner 2839 + .ready() 2840 + .await 2841 + .map_err(|e| { 2842 + tonic::Status::unknown( 2843 + format!("Service was not ready: {}", e.into()), 2844 + ) 2845 + })?; 2482 2846 let codec = tonic::codec::ProstCodec::default(); 2483 - let path = 2484 - http::uri::PathAndQuery::from_static("/rockbox.v1alpha1.PlaybackService/PlayAlbum"); 2847 + let path = http::uri::PathAndQuery::from_static( 2848 + "/rockbox.v1alpha1.PlaybackService/PlayAlbum", 2849 + ); 2485 2850 let mut req = request.into_request(); 2486 - req.extensions_mut().insert(GrpcMethod::new( 2487 - "rockbox.v1alpha1.PlaybackService", 2488 - "PlayAlbum", 2489 - )); 2851 + req.extensions_mut() 2852 + .insert( 2853 + GrpcMethod::new("rockbox.v1alpha1.PlaybackService", "PlayAlbum"), 2854 + ); 2490 2855 self.inner.unary(req, path, codec).await 2491 2856 } 2492 2857 pub async fn play_artist_tracks( 2493 2858 &mut self, 2494 2859 request: impl tonic::IntoRequest<super::PlayArtistTracksRequest>, 2495 - ) -> std::result::Result<tonic::Response<super::PlayArtistTracksResponse>, tonic::Status> 2496 - { 2497 - self.inner.ready().await.map_err(|e| { 2498 - tonic::Status::unknown(format!("Service was not ready: {}", e.into())) 2499 - })?; 2860 + ) -> std::result::Result< 2861 + tonic::Response<super::PlayArtistTracksResponse>, 2862 + tonic::Status, 2863 + > { 2864 + self.inner 2865 + .ready() 2866 + .await 2867 + .map_err(|e| { 2868 + tonic::Status::unknown( 2869 + format!("Service was not ready: {}", e.into()), 2870 + ) 2871 + })?; 2500 2872 let codec = tonic::codec::ProstCodec::default(); 2501 2873 let path = http::uri::PathAndQuery::from_static( 2502 2874 "/rockbox.v1alpha1.PlaybackService/PlayArtistTracks", 2503 2875 ); 2504 2876 let mut req = request.into_request(); 2505 - req.extensions_mut().insert(GrpcMethod::new( 2506 - "rockbox.v1alpha1.PlaybackService", 2507 - "PlayArtistTracks", 2508 - )); 2877 + req.extensions_mut() 2878 + .insert( 2879 + GrpcMethod::new( 2880 + "rockbox.v1alpha1.PlaybackService", 2881 + "PlayArtistTracks", 2882 + ), 2883 + ); 2509 2884 self.inner.unary(req, path, codec).await 2510 2885 } 2511 2886 pub async fn play_playlist( 2512 2887 &mut self, 2513 2888 request: impl tonic::IntoRequest<super::PlayPlaylistRequest>, 2514 - ) -> std::result::Result<tonic::Response<super::PlayPlaylistResponse>, tonic::Status> 2515 - { 2516 - self.inner.ready().await.map_err(|e| { 2517 - tonic::Status::unknown(format!("Service was not ready: {}", e.into())) 2518 - })?; 2889 + ) -> std::result::Result< 2890 + tonic::Response<super::PlayPlaylistResponse>, 2891 + tonic::Status, 2892 + > { 2893 + self.inner 2894 + .ready() 2895 + .await 2896 + .map_err(|e| { 2897 + tonic::Status::unknown( 2898 + format!("Service was not ready: {}", e.into()), 2899 + ) 2900 + })?; 2519 2901 let codec = tonic::codec::ProstCodec::default(); 2520 2902 let path = http::uri::PathAndQuery::from_static( 2521 2903 "/rockbox.v1alpha1.PlaybackService/PlayPlaylist", 2522 2904 ); 2523 2905 let mut req = request.into_request(); 2524 - req.extensions_mut().insert(GrpcMethod::new( 2525 - "rockbox.v1alpha1.PlaybackService", 2526 - "PlayPlaylist", 2527 - )); 2906 + req.extensions_mut() 2907 + .insert( 2908 + GrpcMethod::new("rockbox.v1alpha1.PlaybackService", "PlayPlaylist"), 2909 + ); 2528 2910 self.inner.unary(req, path, codec).await 2529 2911 } 2530 2912 pub async fn play_directory( 2531 2913 &mut self, 2532 2914 request: impl tonic::IntoRequest<super::PlayDirectoryRequest>, 2533 - ) -> std::result::Result<tonic::Response<super::PlayDirectoryResponse>, tonic::Status> 2534 - { 2535 - self.inner.ready().await.map_err(|e| { 2536 - tonic::Status::unknown(format!("Service was not ready: {}", e.into())) 2537 - })?; 2915 + ) -> std::result::Result< 2916 + tonic::Response<super::PlayDirectoryResponse>, 2917 + tonic::Status, 2918 + > { 2919 + self.inner 2920 + .ready() 2921 + .await 2922 + .map_err(|e| { 2923 + tonic::Status::unknown( 2924 + format!("Service was not ready: {}", e.into()), 2925 + ) 2926 + })?; 2538 2927 let codec = tonic::codec::ProstCodec::default(); 2539 2928 let path = http::uri::PathAndQuery::from_static( 2540 2929 "/rockbox.v1alpha1.PlaybackService/PlayDirectory", 2541 2930 ); 2542 2931 let mut req = request.into_request(); 2543 - req.extensions_mut().insert(GrpcMethod::new( 2544 - "rockbox.v1alpha1.PlaybackService", 2545 - "PlayDirectory", 2546 - )); 2932 + req.extensions_mut() 2933 + .insert( 2934 + GrpcMethod::new("rockbox.v1alpha1.PlaybackService", "PlayDirectory"), 2935 + ); 2547 2936 self.inner.unary(req, path, codec).await 2548 2937 } 2549 2938 pub async fn play_music_directory( 2550 2939 &mut self, 2551 2940 request: impl tonic::IntoRequest<super::PlayMusicDirectoryRequest>, 2552 - ) -> std::result::Result<tonic::Response<super::PlayMusicDirectoryResponse>, tonic::Status> 2553 - { 2554 - self.inner.ready().await.map_err(|e| { 2555 - tonic::Status::unknown(format!("Service was not ready: {}", e.into())) 2556 - })?; 2941 + ) -> std::result::Result< 2942 + tonic::Response<super::PlayMusicDirectoryResponse>, 2943 + tonic::Status, 2944 + > { 2945 + self.inner 2946 + .ready() 2947 + .await 2948 + .map_err(|e| { 2949 + tonic::Status::unknown( 2950 + format!("Service was not ready: {}", e.into()), 2951 + ) 2952 + })?; 2557 2953 let codec = tonic::codec::ProstCodec::default(); 2558 2954 let path = http::uri::PathAndQuery::from_static( 2559 2955 "/rockbox.v1alpha1.PlaybackService/PlayMusicDirectory", 2560 2956 ); 2561 2957 let mut req = request.into_request(); 2562 - req.extensions_mut().insert(GrpcMethod::new( 2563 - "rockbox.v1alpha1.PlaybackService", 2564 - "PlayMusicDirectory", 2565 - )); 2958 + req.extensions_mut() 2959 + .insert( 2960 + GrpcMethod::new( 2961 + "rockbox.v1alpha1.PlaybackService", 2962 + "PlayMusicDirectory", 2963 + ), 2964 + ); 2566 2965 self.inner.unary(req, path, codec).await 2567 2966 } 2568 2967 pub async fn play_track( 2569 2968 &mut self, 2570 2969 request: impl tonic::IntoRequest<super::PlayTrackRequest>, 2571 - ) -> std::result::Result<tonic::Response<super::PlayTrackResponse>, tonic::Status> { 2572 - self.inner.ready().await.map_err(|e| { 2573 - tonic::Status::unknown(format!("Service was not ready: {}", e.into())) 2574 - })?; 2970 + ) -> std::result::Result< 2971 + tonic::Response<super::PlayTrackResponse>, 2972 + tonic::Status, 2973 + > { 2974 + self.inner 2975 + .ready() 2976 + .await 2977 + .map_err(|e| { 2978 + tonic::Status::unknown( 2979 + format!("Service was not ready: {}", e.into()), 2980 + ) 2981 + })?; 2575 2982 let codec = tonic::codec::ProstCodec::default(); 2576 - let path = 2577 - http::uri::PathAndQuery::from_static("/rockbox.v1alpha1.PlaybackService/PlayTrack"); 2983 + let path = http::uri::PathAndQuery::from_static( 2984 + "/rockbox.v1alpha1.PlaybackService/PlayTrack", 2985 + ); 2578 2986 let mut req = request.into_request(); 2579 - req.extensions_mut().insert(GrpcMethod::new( 2580 - "rockbox.v1alpha1.PlaybackService", 2581 - "PlayTrack", 2582 - )); 2987 + req.extensions_mut() 2988 + .insert( 2989 + GrpcMethod::new("rockbox.v1alpha1.PlaybackService", "PlayTrack"), 2990 + ); 2583 2991 self.inner.unary(req, path, codec).await 2584 2992 } 2585 2993 pub async fn play_liked_tracks( 2586 2994 &mut self, 2587 2995 request: impl tonic::IntoRequest<super::PlayLikedTracksRequest>, 2588 - ) -> std::result::Result<tonic::Response<super::PlayLikedTracksResponse>, tonic::Status> 2589 - { 2590 - self.inner.ready().await.map_err(|e| { 2591 - tonic::Status::unknown(format!("Service was not ready: {}", e.into())) 2592 - })?; 2996 + ) -> std::result::Result< 2997 + tonic::Response<super::PlayLikedTracksResponse>, 2998 + tonic::Status, 2999 + > { 3000 + self.inner 3001 + .ready() 3002 + .await 3003 + .map_err(|e| { 3004 + tonic::Status::unknown( 3005 + format!("Service was not ready: {}", e.into()), 3006 + ) 3007 + })?; 2593 3008 let codec = tonic::codec::ProstCodec::default(); 2594 3009 let path = http::uri::PathAndQuery::from_static( 2595 3010 "/rockbox.v1alpha1.PlaybackService/PlayLikedTracks", 2596 3011 ); 2597 3012 let mut req = request.into_request(); 2598 - req.extensions_mut().insert(GrpcMethod::new( 2599 - "rockbox.v1alpha1.PlaybackService", 2600 - "PlayLikedTracks", 2601 - )); 3013 + req.extensions_mut() 3014 + .insert( 3015 + GrpcMethod::new( 3016 + "rockbox.v1alpha1.PlaybackService", 3017 + "PlayLikedTracks", 3018 + ), 3019 + ); 2602 3020 self.inner.unary(req, path, codec).await 2603 3021 } 2604 3022 pub async fn play_all_tracks( 2605 3023 &mut self, 2606 3024 request: impl tonic::IntoRequest<super::PlayAllTracksRequest>, 2607 - ) -> std::result::Result<tonic::Response<super::PlayAllTracksResponse>, tonic::Status> 2608 - { 2609 - self.inner.ready().await.map_err(|e| { 2610 - tonic::Status::unknown(format!("Service was not ready: {}", e.into())) 2611 - })?; 3025 + ) -> std::result::Result< 3026 + tonic::Response<super::PlayAllTracksResponse>, 3027 + tonic::Status, 3028 + > { 3029 + self.inner 3030 + .ready() 3031 + .await 3032 + .map_err(|e| { 3033 + tonic::Status::unknown( 3034 + format!("Service was not ready: {}", e.into()), 3035 + ) 3036 + })?; 2612 3037 let codec = tonic::codec::ProstCodec::default(); 2613 3038 let path = http::uri::PathAndQuery::from_static( 2614 3039 "/rockbox.v1alpha1.PlaybackService/PlayAllTracks", 2615 3040 ); 2616 3041 let mut req = request.into_request(); 2617 - req.extensions_mut().insert(GrpcMethod::new( 2618 - "rockbox.v1alpha1.PlaybackService", 2619 - "PlayAllTracks", 2620 - )); 3042 + req.extensions_mut() 3043 + .insert( 3044 + GrpcMethod::new("rockbox.v1alpha1.PlaybackService", "PlayAllTracks"), 3045 + ); 2621 3046 self.inner.unary(req, path, codec).await 2622 3047 } 2623 3048 pub async fn stream_current_track( ··· 2627 3052 tonic::Response<tonic::codec::Streaming<super::CurrentTrackResponse>>, 2628 3053 tonic::Status, 2629 3054 > { 2630 - self.inner.ready().await.map_err(|e| { 2631 - tonic::Status::unknown(format!("Service was not ready: {}", e.into())) 2632 - })?; 3055 + self.inner 3056 + .ready() 3057 + .await 3058 + .map_err(|e| { 3059 + tonic::Status::unknown( 3060 + format!("Service was not ready: {}", e.into()), 3061 + ) 3062 + })?; 2633 3063 let codec = tonic::codec::ProstCodec::default(); 2634 3064 let path = http::uri::PathAndQuery::from_static( 2635 3065 "/rockbox.v1alpha1.PlaybackService/StreamCurrentTrack", 2636 3066 ); 2637 3067 let mut req = request.into_request(); 2638 - req.extensions_mut().insert(GrpcMethod::new( 2639 - "rockbox.v1alpha1.PlaybackService", 2640 - "StreamCurrentTrack", 2641 - )); 3068 + req.extensions_mut() 3069 + .insert( 3070 + GrpcMethod::new( 3071 + "rockbox.v1alpha1.PlaybackService", 3072 + "StreamCurrentTrack", 3073 + ), 3074 + ); 2642 3075 self.inner.server_streaming(req, path, codec).await 2643 3076 } 2644 3077 pub async fn stream_status( ··· 2648 3081 tonic::Response<tonic::codec::Streaming<super::StatusResponse>>, 2649 3082 tonic::Status, 2650 3083 > { 2651 - self.inner.ready().await.map_err(|e| { 2652 - tonic::Status::unknown(format!("Service was not ready: {}", e.into())) 2653 - })?; 3084 + self.inner 3085 + .ready() 3086 + .await 3087 + .map_err(|e| { 3088 + tonic::Status::unknown( 3089 + format!("Service was not ready: {}", e.into()), 3090 + ) 3091 + })?; 2654 3092 let codec = tonic::codec::ProstCodec::default(); 2655 3093 let path = http::uri::PathAndQuery::from_static( 2656 3094 "/rockbox.v1alpha1.PlaybackService/StreamStatus", 2657 3095 ); 2658 3096 let mut req = request.into_request(); 2659 - req.extensions_mut().insert(GrpcMethod::new( 2660 - "rockbox.v1alpha1.PlaybackService", 2661 - "StreamStatus", 2662 - )); 3097 + req.extensions_mut() 3098 + .insert( 3099 + GrpcMethod::new("rockbox.v1alpha1.PlaybackService", "StreamStatus"), 3100 + ); 2663 3101 self.inner.server_streaming(req, path, codec).await 2664 3102 } 2665 3103 pub async fn stream_playlist( ··· 2669 3107 tonic::Response<tonic::codec::Streaming<super::PlaylistResponse>>, 2670 3108 tonic::Status, 2671 3109 > { 2672 - self.inner.ready().await.map_err(|e| { 2673 - tonic::Status::unknown(format!("Service was not ready: {}", e.into())) 2674 - })?; 3110 + self.inner 3111 + .ready() 3112 + .await 3113 + .map_err(|e| { 3114 + tonic::Status::unknown( 3115 + format!("Service was not ready: {}", e.into()), 3116 + ) 3117 + })?; 2675 3118 let codec = tonic::codec::ProstCodec::default(); 2676 3119 let path = http::uri::PathAndQuery::from_static( 2677 3120 "/rockbox.v1alpha1.PlaybackService/StreamPlaylist", 2678 3121 ); 2679 3122 let mut req = request.into_request(); 2680 - req.extensions_mut().insert(GrpcMethod::new( 2681 - "rockbox.v1alpha1.PlaybackService", 2682 - "StreamPlaylist", 2683 - )); 3123 + req.extensions_mut() 3124 + .insert( 3125 + GrpcMethod::new("rockbox.v1alpha1.PlaybackService", "StreamPlaylist"), 3126 + ); 2684 3127 self.inner.server_streaming(req, path, codec).await 2685 3128 } 2686 3129 } ··· 2692 3135 dead_code, 2693 3136 missing_docs, 2694 3137 clippy::wildcard_imports, 2695 - clippy::let_unit_value 3138 + clippy::let_unit_value, 2696 3139 )] 2697 3140 use tonic::codegen::*; 2698 3141 /// Generated trait containing gRPC methods that should be implemented for use with PlaybackServiceServer. ··· 2709 3152 async fn play_or_pause( 2710 3153 &self, 2711 3154 request: tonic::Request<super::PlayOrPauseRequest>, 2712 - ) -> std::result::Result<tonic::Response<super::PlayOrPauseResponse>, tonic::Status>; 3155 + ) -> std::result::Result< 3156 + tonic::Response<super::PlayOrPauseResponse>, 3157 + tonic::Status, 3158 + >; 2713 3159 async fn resume( 2714 3160 &self, 2715 3161 request: tonic::Request<super::ResumeRequest>, ··· 2721 3167 async fn previous( 2722 3168 &self, 2723 3169 request: tonic::Request<super::PreviousRequest>, 2724 - ) -> std::result::Result<tonic::Response<super::PreviousResponse>, tonic::Status>; 3170 + ) -> std::result::Result< 3171 + tonic::Response<super::PreviousResponse>, 3172 + tonic::Status, 3173 + >; 2725 3174 async fn fast_forward_rewind( 2726 3175 &self, 2727 3176 request: tonic::Request<super::FastForwardRewindRequest>, 2728 - ) -> std::result::Result<tonic::Response<super::FastForwardRewindResponse>, tonic::Status>; 3177 + ) -> std::result::Result< 3178 + tonic::Response<super::FastForwardRewindResponse>, 3179 + tonic::Status, 3180 + >; 2729 3181 async fn status( 2730 3182 &self, 2731 3183 request: tonic::Request<super::StatusRequest>, ··· 2733 3185 async fn current_track( 2734 3186 &self, 2735 3187 request: tonic::Request<super::CurrentTrackRequest>, 2736 - ) -> std::result::Result<tonic::Response<super::CurrentTrackResponse>, tonic::Status>; 3188 + ) -> std::result::Result< 3189 + tonic::Response<super::CurrentTrackResponse>, 3190 + tonic::Status, 3191 + >; 2737 3192 async fn next_track( 2738 3193 &self, 2739 3194 request: tonic::Request<super::NextTrackRequest>, 2740 - ) -> std::result::Result<tonic::Response<super::NextTrackResponse>, tonic::Status>; 3195 + ) -> std::result::Result< 3196 + tonic::Response<super::NextTrackResponse>, 3197 + tonic::Status, 3198 + >; 2741 3199 async fn flush_and_reload_tracks( 2742 3200 &self, 2743 3201 request: tonic::Request<super::FlushAndReloadTracksRequest>, 2744 - ) -> std::result::Result<tonic::Response<super::FlushAndReloadTracksResponse>, tonic::Status>; 3202 + ) -> std::result::Result< 3203 + tonic::Response<super::FlushAndReloadTracksResponse>, 3204 + tonic::Status, 3205 + >; 2745 3206 async fn get_file_position( 2746 3207 &self, 2747 3208 request: tonic::Request<super::GetFilePositionRequest>, 2748 - ) -> std::result::Result<tonic::Response<super::GetFilePositionResponse>, tonic::Status>; 3209 + ) -> std::result::Result< 3210 + tonic::Response<super::GetFilePositionResponse>, 3211 + tonic::Status, 3212 + >; 2749 3213 async fn hard_stop( 2750 3214 &self, 2751 3215 request: tonic::Request<super::HardStopRequest>, 2752 - ) -> std::result::Result<tonic::Response<super::HardStopResponse>, tonic::Status>; 3216 + ) -> std::result::Result< 3217 + tonic::Response<super::HardStopResponse>, 3218 + tonic::Status, 3219 + >; 2753 3220 async fn play_album( 2754 3221 &self, 2755 3222 request: tonic::Request<super::PlayAlbumRequest>, 2756 - ) -> std::result::Result<tonic::Response<super::PlayAlbumResponse>, tonic::Status>; 3223 + ) -> std::result::Result< 3224 + tonic::Response<super::PlayAlbumResponse>, 3225 + tonic::Status, 3226 + >; 2757 3227 async fn play_artist_tracks( 2758 3228 &self, 2759 3229 request: tonic::Request<super::PlayArtistTracksRequest>, 2760 - ) -> std::result::Result<tonic::Response<super::PlayArtistTracksResponse>, tonic::Status>; 3230 + ) -> std::result::Result< 3231 + tonic::Response<super::PlayArtistTracksResponse>, 3232 + tonic::Status, 3233 + >; 2761 3234 async fn play_playlist( 2762 3235 &self, 2763 3236 request: tonic::Request<super::PlayPlaylistRequest>, 2764 - ) -> std::result::Result<tonic::Response<super::PlayPlaylistResponse>, tonic::Status>; 3237 + ) -> std::result::Result< 3238 + tonic::Response<super::PlayPlaylistResponse>, 3239 + tonic::Status, 3240 + >; 2765 3241 async fn play_directory( 2766 3242 &self, 2767 3243 request: tonic::Request<super::PlayDirectoryRequest>, 2768 - ) -> std::result::Result<tonic::Response<super::PlayDirectoryResponse>, tonic::Status>; 3244 + ) -> std::result::Result< 3245 + tonic::Response<super::PlayDirectoryResponse>, 3246 + tonic::Status, 3247 + >; 2769 3248 async fn play_music_directory( 2770 3249 &self, 2771 3250 request: tonic::Request<super::PlayMusicDirectoryRequest>, 2772 - ) -> std::result::Result<tonic::Response<super::PlayMusicDirectoryResponse>, tonic::Status>; 3251 + ) -> std::result::Result< 3252 + tonic::Response<super::PlayMusicDirectoryResponse>, 3253 + tonic::Status, 3254 + >; 2773 3255 async fn play_track( 2774 3256 &self, 2775 3257 request: tonic::Request<super::PlayTrackRequest>, 2776 - ) -> std::result::Result<tonic::Response<super::PlayTrackResponse>, tonic::Status>; 3258 + ) -> std::result::Result< 3259 + tonic::Response<super::PlayTrackResponse>, 3260 + tonic::Status, 3261 + >; 2777 3262 async fn play_liked_tracks( 2778 3263 &self, 2779 3264 request: tonic::Request<super::PlayLikedTracksRequest>, 2780 - ) -> std::result::Result<tonic::Response<super::PlayLikedTracksResponse>, tonic::Status>; 3265 + ) -> std::result::Result< 3266 + tonic::Response<super::PlayLikedTracksResponse>, 3267 + tonic::Status, 3268 + >; 2781 3269 async fn play_all_tracks( 2782 3270 &self, 2783 3271 request: tonic::Request<super::PlayAllTracksRequest>, 2784 - ) -> std::result::Result<tonic::Response<super::PlayAllTracksResponse>, tonic::Status>; 3272 + ) -> std::result::Result< 3273 + tonic::Response<super::PlayAllTracksResponse>, 3274 + tonic::Status, 3275 + >; 2785 3276 /// Server streaming response type for the StreamCurrentTrack method. 2786 3277 type StreamCurrentTrackStream: tonic::codegen::tokio_stream::Stream< 2787 3278 Item = std::result::Result<super::CurrentTrackResponse, tonic::Status>, 2788 - > + std::marker::Send 3279 + > 3280 + + std::marker::Send 2789 3281 + 'static; 2790 3282 async fn stream_current_track( 2791 3283 &self, 2792 3284 request: tonic::Request<super::StreamCurrentTrackRequest>, 2793 - ) -> std::result::Result<tonic::Response<Self::StreamCurrentTrackStream>, tonic::Status>; 3285 + ) -> std::result::Result< 3286 + tonic::Response<Self::StreamCurrentTrackStream>, 3287 + tonic::Status, 3288 + >; 2794 3289 /// Server streaming response type for the StreamStatus method. 2795 3290 type StreamStatusStream: tonic::codegen::tokio_stream::Stream< 2796 3291 Item = std::result::Result<super::StatusResponse, tonic::Status>, 2797 - > + std::marker::Send 3292 + > 3293 + + std::marker::Send 2798 3294 + 'static; 2799 3295 async fn stream_status( 2800 3296 &self, 2801 3297 request: tonic::Request<super::StreamStatusRequest>, 2802 - ) -> std::result::Result<tonic::Response<Self::StreamStatusStream>, tonic::Status>; 3298 + ) -> std::result::Result< 3299 + tonic::Response<Self::StreamStatusStream>, 3300 + tonic::Status, 3301 + >; 2803 3302 /// Server streaming response type for the StreamPlaylist method. 2804 3303 type StreamPlaylistStream: tonic::codegen::tokio_stream::Stream< 2805 3304 Item = std::result::Result<super::PlaylistResponse, tonic::Status>, 2806 - > + std::marker::Send 3305 + > 3306 + + std::marker::Send 2807 3307 + 'static; 2808 3308 async fn stream_playlist( 2809 3309 &self, 2810 3310 request: tonic::Request<super::StreamPlaylistRequest>, 2811 - ) -> std::result::Result<tonic::Response<Self::StreamPlaylistStream>, tonic::Status>; 3311 + ) -> std::result::Result< 3312 + tonic::Response<Self::StreamPlaylistStream>, 3313 + tonic::Status, 3314 + >; 2812 3315 } 2813 3316 #[derive(Debug)] 2814 3317 pub struct PlaybackServiceServer<T> { ··· 2831 3334 max_encoding_message_size: None, 2832 3335 } 2833 3336 } 2834 - pub fn with_interceptor<F>(inner: T, interceptor: F) -> InterceptedService<Self, F> 3337 + pub fn with_interceptor<F>( 3338 + inner: T, 3339 + interceptor: F, 3340 + ) -> InterceptedService<Self, F> 2835 3341 where 2836 3342 F: tonic::service::Interceptor, 2837 3343 { ··· 2886 3392 "/rockbox.v1alpha1.PlaybackService/Play" => { 2887 3393 #[allow(non_camel_case_types)] 2888 3394 struct PlaySvc<T: PlaybackService>(pub Arc<T>); 2889 - impl<T: PlaybackService> tonic::server::UnaryService<super::PlayRequest> for PlaySvc<T> { 3395 + impl< 3396 + T: PlaybackService, 3397 + > tonic::server::UnaryService<super::PlayRequest> for PlaySvc<T> { 2890 3398 type Response = super::PlayResponse; 2891 - type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>; 3399 + type Future = BoxFuture< 3400 + tonic::Response<Self::Response>, 3401 + tonic::Status, 3402 + >; 2892 3403 fn call( 2893 3404 &mut self, 2894 3405 request: tonic::Request<super::PlayRequest>, 2895 3406 ) -> Self::Future { 2896 3407 let inner = Arc::clone(&self.0); 2897 - let fut = 2898 - async move { <T as PlaybackService>::play(&inner, request).await }; 3408 + let fut = async move { 3409 + <T as PlaybackService>::play(&inner, request).await 3410 + }; 2899 3411 Box::pin(fut) 2900 3412 } 2901 3413 } ··· 2924 3436 "/rockbox.v1alpha1.PlaybackService/Pause" => { 2925 3437 #[allow(non_camel_case_types)] 2926 3438 struct PauseSvc<T: PlaybackService>(pub Arc<T>); 2927 - impl<T: PlaybackService> tonic::server::UnaryService<super::PauseRequest> for PauseSvc<T> { 3439 + impl< 3440 + T: PlaybackService, 3441 + > tonic::server::UnaryService<super::PauseRequest> for PauseSvc<T> { 2928 3442 type Response = super::PauseResponse; 2929 - type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>; 3443 + type Future = BoxFuture< 3444 + tonic::Response<Self::Response>, 3445 + tonic::Status, 3446 + >; 2930 3447 fn call( 2931 3448 &mut self, 2932 3449 request: tonic::Request<super::PauseRequest>, 2933 3450 ) -> Self::Future { 2934 3451 let inner = Arc::clone(&self.0); 2935 - let fut = 2936 - async move { <T as PlaybackService>::pause(&inner, request).await }; 3452 + let fut = async move { 3453 + <T as PlaybackService>::pause(&inner, request).await 3454 + }; 2937 3455 Box::pin(fut) 2938 3456 } 2939 3457 } ··· 2962 3480 "/rockbox.v1alpha1.PlaybackService/PlayOrPause" => { 2963 3481 #[allow(non_camel_case_types)] 2964 3482 struct PlayOrPauseSvc<T: PlaybackService>(pub Arc<T>); 2965 - impl<T: PlaybackService> tonic::server::UnaryService<super::PlayOrPauseRequest> 2966 - for PlayOrPauseSvc<T> 2967 - { 3483 + impl< 3484 + T: PlaybackService, 3485 + > tonic::server::UnaryService<super::PlayOrPauseRequest> 3486 + for PlayOrPauseSvc<T> { 2968 3487 type Response = super::PlayOrPauseResponse; 2969 - type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>; 3488 + type Future = BoxFuture< 3489 + tonic::Response<Self::Response>, 3490 + tonic::Status, 3491 + >; 2970 3492 fn call( 2971 3493 &mut self, 2972 3494 request: tonic::Request<super::PlayOrPauseRequest>, ··· 3003 3525 "/rockbox.v1alpha1.PlaybackService/Resume" => { 3004 3526 #[allow(non_camel_case_types)] 3005 3527 struct ResumeSvc<T: PlaybackService>(pub Arc<T>); 3006 - impl<T: PlaybackService> tonic::server::UnaryService<super::ResumeRequest> for ResumeSvc<T> { 3528 + impl< 3529 + T: PlaybackService, 3530 + > tonic::server::UnaryService<super::ResumeRequest> 3531 + for ResumeSvc<T> { 3007 3532 type Response = super::ResumeResponse; 3008 - type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>; 3533 + type Future = BoxFuture< 3534 + tonic::Response<Self::Response>, 3535 + tonic::Status, 3536 + >; 3009 3537 fn call( 3010 3538 &mut self, 3011 3539 request: tonic::Request<super::ResumeRequest>, ··· 3042 3570 "/rockbox.v1alpha1.PlaybackService/Next" => { 3043 3571 #[allow(non_camel_case_types)] 3044 3572 struct NextSvc<T: PlaybackService>(pub Arc<T>); 3045 - impl<T: PlaybackService> tonic::server::UnaryService<super::NextRequest> for NextSvc<T> { 3573 + impl< 3574 + T: PlaybackService, 3575 + > tonic::server::UnaryService<super::NextRequest> for NextSvc<T> { 3046 3576 type Response = super::NextResponse; 3047 - type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>; 3577 + type Future = BoxFuture< 3578 + tonic::Response<Self::Response>, 3579 + tonic::Status, 3580 + >; 3048 3581 fn call( 3049 3582 &mut self, 3050 3583 request: tonic::Request<super::NextRequest>, 3051 3584 ) -> Self::Future { 3052 3585 let inner = Arc::clone(&self.0); 3053 - let fut = 3054 - async move { <T as PlaybackService>::next(&inner, request).await }; 3586 + let fut = async move { 3587 + <T as PlaybackService>::next(&inner, request).await 3588 + }; 3055 3589 Box::pin(fut) 3056 3590 } 3057 3591 } ··· 3080 3614 "/rockbox.v1alpha1.PlaybackService/Previous" => { 3081 3615 #[allow(non_camel_case_types)] 3082 3616 struct PreviousSvc<T: PlaybackService>(pub Arc<T>); 3083 - impl<T: PlaybackService> tonic::server::UnaryService<super::PreviousRequest> for PreviousSvc<T> { 3617 + impl< 3618 + T: PlaybackService, 3619 + > tonic::server::UnaryService<super::PreviousRequest> 3620 + for PreviousSvc<T> { 3084 3621 type Response = super::PreviousResponse; 3085 - type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>; 3622 + type Future = BoxFuture< 3623 + tonic::Response<Self::Response>, 3624 + tonic::Status, 3625 + >; 3086 3626 fn call( 3087 3627 &mut self, 3088 3628 request: tonic::Request<super::PreviousRequest>, ··· 3119 3659 "/rockbox.v1alpha1.PlaybackService/FastForwardRewind" => { 3120 3660 #[allow(non_camel_case_types)] 3121 3661 struct FastForwardRewindSvc<T: PlaybackService>(pub Arc<T>); 3122 - impl<T: PlaybackService> 3123 - tonic::server::UnaryService<super::FastForwardRewindRequest> 3124 - for FastForwardRewindSvc<T> 3125 - { 3662 + impl< 3663 + T: PlaybackService, 3664 + > tonic::server::UnaryService<super::FastForwardRewindRequest> 3665 + for FastForwardRewindSvc<T> { 3126 3666 type Response = super::FastForwardRewindResponse; 3127 - type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>; 3667 + type Future = BoxFuture< 3668 + tonic::Response<Self::Response>, 3669 + tonic::Status, 3670 + >; 3128 3671 fn call( 3129 3672 &mut self, 3130 3673 request: tonic::Request<super::FastForwardRewindRequest>, 3131 3674 ) -> Self::Future { 3132 3675 let inner = Arc::clone(&self.0); 3133 3676 let fut = async move { 3134 - <T as PlaybackService>::fast_forward_rewind(&inner, request).await 3677 + <T as PlaybackService>::fast_forward_rewind(&inner, request) 3678 + .await 3135 3679 }; 3136 3680 Box::pin(fut) 3137 3681 } ··· 3161 3705 "/rockbox.v1alpha1.PlaybackService/Status" => { 3162 3706 #[allow(non_camel_case_types)] 3163 3707 struct StatusSvc<T: PlaybackService>(pub Arc<T>); 3164 - impl<T: PlaybackService> tonic::server::UnaryService<super::StatusRequest> for StatusSvc<T> { 3708 + impl< 3709 + T: PlaybackService, 3710 + > tonic::server::UnaryService<super::StatusRequest> 3711 + for StatusSvc<T> { 3165 3712 type Response = super::StatusResponse; 3166 - type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>; 3713 + type Future = BoxFuture< 3714 + tonic::Response<Self::Response>, 3715 + tonic::Status, 3716 + >; 3167 3717 fn call( 3168 3718 &mut self, 3169 3719 request: tonic::Request<super::StatusRequest>, ··· 3200 3750 "/rockbox.v1alpha1.PlaybackService/CurrentTrack" => { 3201 3751 #[allow(non_camel_case_types)] 3202 3752 struct CurrentTrackSvc<T: PlaybackService>(pub Arc<T>); 3203 - impl<T: PlaybackService> tonic::server::UnaryService<super::CurrentTrackRequest> 3204 - for CurrentTrackSvc<T> 3205 - { 3753 + impl< 3754 + T: PlaybackService, 3755 + > tonic::server::UnaryService<super::CurrentTrackRequest> 3756 + for CurrentTrackSvc<T> { 3206 3757 type Response = super::CurrentTrackResponse; 3207 - type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>; 3758 + type Future = BoxFuture< 3759 + tonic::Response<Self::Response>, 3760 + tonic::Status, 3761 + >; 3208 3762 fn call( 3209 3763 &mut self, 3210 3764 request: tonic::Request<super::CurrentTrackRequest>, ··· 3241 3795 "/rockbox.v1alpha1.PlaybackService/NextTrack" => { 3242 3796 #[allow(non_camel_case_types)] 3243 3797 struct NextTrackSvc<T: PlaybackService>(pub Arc<T>); 3244 - impl<T: PlaybackService> tonic::server::UnaryService<super::NextTrackRequest> for NextTrackSvc<T> { 3798 + impl< 3799 + T: PlaybackService, 3800 + > tonic::server::UnaryService<super::NextTrackRequest> 3801 + for NextTrackSvc<T> { 3245 3802 type Response = super::NextTrackResponse; 3246 - type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>; 3803 + type Future = BoxFuture< 3804 + tonic::Response<Self::Response>, 3805 + tonic::Status, 3806 + >; 3247 3807 fn call( 3248 3808 &mut self, 3249 3809 request: tonic::Request<super::NextTrackRequest>, ··· 3280 3840 "/rockbox.v1alpha1.PlaybackService/FlushAndReloadTracks" => { 3281 3841 #[allow(non_camel_case_types)] 3282 3842 struct FlushAndReloadTracksSvc<T: PlaybackService>(pub Arc<T>); 3283 - impl<T: PlaybackService> 3284 - tonic::server::UnaryService<super::FlushAndReloadTracksRequest> 3285 - for FlushAndReloadTracksSvc<T> 3286 - { 3843 + impl< 3844 + T: PlaybackService, 3845 + > tonic::server::UnaryService<super::FlushAndReloadTracksRequest> 3846 + for FlushAndReloadTracksSvc<T> { 3287 3847 type Response = super::FlushAndReloadTracksResponse; 3288 - type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>; 3848 + type Future = BoxFuture< 3849 + tonic::Response<Self::Response>, 3850 + tonic::Status, 3851 + >; 3289 3852 fn call( 3290 3853 &mut self, 3291 3854 request: tonic::Request<super::FlushAndReloadTracksRequest>, 3292 3855 ) -> Self::Future { 3293 3856 let inner = Arc::clone(&self.0); 3294 3857 let fut = async move { 3295 - <T as PlaybackService>::flush_and_reload_tracks(&inner, request) 3858 + <T as PlaybackService>::flush_and_reload_tracks( 3859 + &inner, 3860 + request, 3861 + ) 3296 3862 .await 3297 3863 }; 3298 3864 Box::pin(fut) ··· 3323 3889 "/rockbox.v1alpha1.PlaybackService/GetFilePosition" => { 3324 3890 #[allow(non_camel_case_types)] 3325 3891 struct GetFilePositionSvc<T: PlaybackService>(pub Arc<T>); 3326 - impl<T: PlaybackService> 3327 - tonic::server::UnaryService<super::GetFilePositionRequest> 3328 - for GetFilePositionSvc<T> 3329 - { 3892 + impl< 3893 + T: PlaybackService, 3894 + > tonic::server::UnaryService<super::GetFilePositionRequest> 3895 + for GetFilePositionSvc<T> { 3330 3896 type Response = super::GetFilePositionResponse; 3331 - type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>; 3897 + type Future = BoxFuture< 3898 + tonic::Response<Self::Response>, 3899 + tonic::Status, 3900 + >; 3332 3901 fn call( 3333 3902 &mut self, 3334 3903 request: tonic::Request<super::GetFilePositionRequest>, 3335 3904 ) -> Self::Future { 3336 3905 let inner = Arc::clone(&self.0); 3337 3906 let fut = async move { 3338 - <T as PlaybackService>::get_file_position(&inner, request).await 3907 + <T as PlaybackService>::get_file_position(&inner, request) 3908 + .await 3339 3909 }; 3340 3910 Box::pin(fut) 3341 3911 } ··· 3365 3935 "/rockbox.v1alpha1.PlaybackService/HardStop" => { 3366 3936 #[allow(non_camel_case_types)] 3367 3937 struct HardStopSvc<T: PlaybackService>(pub Arc<T>); 3368 - impl<T: PlaybackService> tonic::server::UnaryService<super::HardStopRequest> for HardStopSvc<T> { 3938 + impl< 3939 + T: PlaybackService, 3940 + > tonic::server::UnaryService<super::HardStopRequest> 3941 + for HardStopSvc<T> { 3369 3942 type Response = super::HardStopResponse; 3370 - type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>; 3943 + type Future = BoxFuture< 3944 + tonic::Response<Self::Response>, 3945 + tonic::Status, 3946 + >; 3371 3947 fn call( 3372 3948 &mut self, 3373 3949 request: tonic::Request<super::HardStopRequest>, ··· 3404 3980 "/rockbox.v1alpha1.PlaybackService/PlayAlbum" => { 3405 3981 #[allow(non_camel_case_types)] 3406 3982 struct PlayAlbumSvc<T: PlaybackService>(pub Arc<T>); 3407 - impl<T: PlaybackService> tonic::server::UnaryService<super::PlayAlbumRequest> for PlayAlbumSvc<T> { 3983 + impl< 3984 + T: PlaybackService, 3985 + > tonic::server::UnaryService<super::PlayAlbumRequest> 3986 + for PlayAlbumSvc<T> { 3408 3987 type Response = super::PlayAlbumResponse; 3409 - type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>; 3988 + type Future = BoxFuture< 3989 + tonic::Response<Self::Response>, 3990 + tonic::Status, 3991 + >; 3410 3992 fn call( 3411 3993 &mut self, 3412 3994 request: tonic::Request<super::PlayAlbumRequest>, ··· 3443 4025 "/rockbox.v1alpha1.PlaybackService/PlayArtistTracks" => { 3444 4026 #[allow(non_camel_case_types)] 3445 4027 struct PlayArtistTracksSvc<T: PlaybackService>(pub Arc<T>); 3446 - impl<T: PlaybackService> 3447 - tonic::server::UnaryService<super::PlayArtistTracksRequest> 3448 - for PlayArtistTracksSvc<T> 3449 - { 4028 + impl< 4029 + T: PlaybackService, 4030 + > tonic::server::UnaryService<super::PlayArtistTracksRequest> 4031 + for PlayArtistTracksSvc<T> { 3450 4032 type Response = super::PlayArtistTracksResponse; 3451 - type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>; 4033 + type Future = BoxFuture< 4034 + tonic::Response<Self::Response>, 4035 + tonic::Status, 4036 + >; 3452 4037 fn call( 3453 4038 &mut self, 3454 4039 request: tonic::Request<super::PlayArtistTracksRequest>, 3455 4040 ) -> Self::Future { 3456 4041 let inner = Arc::clone(&self.0); 3457 4042 let fut = async move { 3458 - <T as PlaybackService>::play_artist_tracks(&inner, request).await 4043 + <T as PlaybackService>::play_artist_tracks(&inner, request) 4044 + .await 3459 4045 }; 3460 4046 Box::pin(fut) 3461 4047 } ··· 3485 4071 "/rockbox.v1alpha1.PlaybackService/PlayPlaylist" => { 3486 4072 #[allow(non_camel_case_types)] 3487 4073 struct PlayPlaylistSvc<T: PlaybackService>(pub Arc<T>); 3488 - impl<T: PlaybackService> tonic::server::UnaryService<super::PlayPlaylistRequest> 3489 - for PlayPlaylistSvc<T> 3490 - { 4074 + impl< 4075 + T: PlaybackService, 4076 + > tonic::server::UnaryService<super::PlayPlaylistRequest> 4077 + for PlayPlaylistSvc<T> { 3491 4078 type Response = super::PlayPlaylistResponse; 3492 - type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>; 4079 + type Future = BoxFuture< 4080 + tonic::Response<Self::Response>, 4081 + tonic::Status, 4082 + >; 3493 4083 fn call( 3494 4084 &mut self, 3495 4085 request: tonic::Request<super::PlayPlaylistRequest>, ··· 3526 4116 "/rockbox.v1alpha1.PlaybackService/PlayDirectory" => { 3527 4117 #[allow(non_camel_case_types)] 3528 4118 struct PlayDirectorySvc<T: PlaybackService>(pub Arc<T>); 3529 - impl<T: PlaybackService> 3530 - tonic::server::UnaryService<super::PlayDirectoryRequest> 3531 - for PlayDirectorySvc<T> 3532 - { 4119 + impl< 4120 + T: PlaybackService, 4121 + > tonic::server::UnaryService<super::PlayDirectoryRequest> 4122 + for PlayDirectorySvc<T> { 3533 4123 type Response = super::PlayDirectoryResponse; 3534 - type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>; 4124 + type Future = BoxFuture< 4125 + tonic::Response<Self::Response>, 4126 + tonic::Status, 4127 + >; 3535 4128 fn call( 3536 4129 &mut self, 3537 4130 request: tonic::Request<super::PlayDirectoryRequest>, 3538 4131 ) -> Self::Future { 3539 4132 let inner = Arc::clone(&self.0); 3540 4133 let fut = async move { 3541 - <T as PlaybackService>::play_directory(&inner, request).await 4134 + <T as PlaybackService>::play_directory(&inner, request) 4135 + .await 3542 4136 }; 3543 4137 Box::pin(fut) 3544 4138 } ··· 3568 4162 "/rockbox.v1alpha1.PlaybackService/PlayMusicDirectory" => { 3569 4163 #[allow(non_camel_case_types)] 3570 4164 struct PlayMusicDirectorySvc<T: PlaybackService>(pub Arc<T>); 3571 - impl<T: PlaybackService> 3572 - tonic::server::UnaryService<super::PlayMusicDirectoryRequest> 3573 - for PlayMusicDirectorySvc<T> 3574 - { 4165 + impl< 4166 + T: PlaybackService, 4167 + > tonic::server::UnaryService<super::PlayMusicDirectoryRequest> 4168 + for PlayMusicDirectorySvc<T> { 3575 4169 type Response = super::PlayMusicDirectoryResponse; 3576 - type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>; 4170 + type Future = BoxFuture< 4171 + tonic::Response<Self::Response>, 4172 + tonic::Status, 4173 + >; 3577 4174 fn call( 3578 4175 &mut self, 3579 4176 request: tonic::Request<super::PlayMusicDirectoryRequest>, 3580 4177 ) -> Self::Future { 3581 4178 let inner = Arc::clone(&self.0); 3582 4179 let fut = async move { 3583 - <T as PlaybackService>::play_music_directory(&inner, request).await 4180 + <T as PlaybackService>::play_music_directory( 4181 + &inner, 4182 + request, 4183 + ) 4184 + .await 3584 4185 }; 3585 4186 Box::pin(fut) 3586 4187 } ··· 3610 4211 "/rockbox.v1alpha1.PlaybackService/PlayTrack" => { 3611 4212 #[allow(non_camel_case_types)] 3612 4213 struct PlayTrackSvc<T: PlaybackService>(pub Arc<T>); 3613 - impl<T: PlaybackService> tonic::server::UnaryService<super::PlayTrackRequest> for PlayTrackSvc<T> { 4214 + impl< 4215 + T: PlaybackService, 4216 + > tonic::server::UnaryService<super::PlayTrackRequest> 4217 + for PlayTrackSvc<T> { 3614 4218 type Response = super::PlayTrackResponse; 3615 - type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>; 4219 + type Future = BoxFuture< 4220 + tonic::Response<Self::Response>, 4221 + tonic::Status, 4222 + >; 3616 4223 fn call( 3617 4224 &mut self, 3618 4225 request: tonic::Request<super::PlayTrackRequest>, ··· 3649 4256 "/rockbox.v1alpha1.PlaybackService/PlayLikedTracks" => { 3650 4257 #[allow(non_camel_case_types)] 3651 4258 struct PlayLikedTracksSvc<T: PlaybackService>(pub Arc<T>); 3652 - impl<T: PlaybackService> 3653 - tonic::server::UnaryService<super::PlayLikedTracksRequest> 3654 - for PlayLikedTracksSvc<T> 3655 - { 4259 + impl< 4260 + T: PlaybackService, 4261 + > tonic::server::UnaryService<super::PlayLikedTracksRequest> 4262 + for PlayLikedTracksSvc<T> { 3656 4263 type Response = super::PlayLikedTracksResponse; 3657 - type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>; 4264 + type Future = BoxFuture< 4265 + tonic::Response<Self::Response>, 4266 + tonic::Status, 4267 + >; 3658 4268 fn call( 3659 4269 &mut self, 3660 4270 request: tonic::Request<super::PlayLikedTracksRequest>, 3661 4271 ) -> Self::Future { 3662 4272 let inner = Arc::clone(&self.0); 3663 4273 let fut = async move { 3664 - <T as PlaybackService>::play_liked_tracks(&inner, request).await 4274 + <T as PlaybackService>::play_liked_tracks(&inner, request) 4275 + .await 3665 4276 }; 3666 4277 Box::pin(fut) 3667 4278 } ··· 3691 4302 "/rockbox.v1alpha1.PlaybackService/PlayAllTracks" => { 3692 4303 #[allow(non_camel_case_types)] 3693 4304 struct PlayAllTracksSvc<T: PlaybackService>(pub Arc<T>); 3694 - impl<T: PlaybackService> 3695 - tonic::server::UnaryService<super::PlayAllTracksRequest> 3696 - for PlayAllTracksSvc<T> 3697 - { 4305 + impl< 4306 + T: PlaybackService, 4307 + > tonic::server::UnaryService<super::PlayAllTracksRequest> 4308 + for PlayAllTracksSvc<T> { 3698 4309 type Response = super::PlayAllTracksResponse; 3699 - type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>; 4310 + type Future = BoxFuture< 4311 + tonic::Response<Self::Response>, 4312 + tonic::Status, 4313 + >; 3700 4314 fn call( 3701 4315 &mut self, 3702 4316 request: tonic::Request<super::PlayAllTracksRequest>, 3703 4317 ) -> Self::Future { 3704 4318 let inner = Arc::clone(&self.0); 3705 4319 let fut = async move { 3706 - <T as PlaybackService>::play_all_tracks(&inner, request).await 4320 + <T as PlaybackService>::play_all_tracks(&inner, request) 4321 + .await 3707 4322 }; 3708 4323 Box::pin(fut) 3709 4324 } ··· 3733 4348 "/rockbox.v1alpha1.PlaybackService/StreamCurrentTrack" => { 3734 4349 #[allow(non_camel_case_types)] 3735 4350 struct StreamCurrentTrackSvc<T: PlaybackService>(pub Arc<T>); 3736 - impl<T: PlaybackService> 3737 - tonic::server::ServerStreamingService<super::StreamCurrentTrackRequest> 3738 - for StreamCurrentTrackSvc<T> 3739 - { 4351 + impl< 4352 + T: PlaybackService, 4353 + > tonic::server::ServerStreamingService< 4354 + super::StreamCurrentTrackRequest, 4355 + > for StreamCurrentTrackSvc<T> { 3740 4356 type Response = super::CurrentTrackResponse; 3741 4357 type ResponseStream = T::StreamCurrentTrackStream; 3742 - type Future = 3743 - BoxFuture<tonic::Response<Self::ResponseStream>, tonic::Status>; 4358 + type Future = BoxFuture< 4359 + tonic::Response<Self::ResponseStream>, 4360 + tonic::Status, 4361 + >; 3744 4362 fn call( 3745 4363 &mut self, 3746 4364 request: tonic::Request<super::StreamCurrentTrackRequest>, 3747 4365 ) -> Self::Future { 3748 4366 let inner = Arc::clone(&self.0); 3749 4367 let fut = async move { 3750 - <T as PlaybackService>::stream_current_track(&inner, request).await 4368 + <T as PlaybackService>::stream_current_track( 4369 + &inner, 4370 + request, 4371 + ) 4372 + .await 3751 4373 }; 3752 4374 Box::pin(fut) 3753 4375 } ··· 3777 4399 "/rockbox.v1alpha1.PlaybackService/StreamStatus" => { 3778 4400 #[allow(non_camel_case_types)] 3779 4401 struct StreamStatusSvc<T: PlaybackService>(pub Arc<T>); 3780 - impl<T: PlaybackService> 3781 - tonic::server::ServerStreamingService<super::StreamStatusRequest> 3782 - for StreamStatusSvc<T> 3783 - { 4402 + impl< 4403 + T: PlaybackService, 4404 + > tonic::server::ServerStreamingService<super::StreamStatusRequest> 4405 + for StreamStatusSvc<T> { 3784 4406 type Response = super::StatusResponse; 3785 4407 type ResponseStream = T::StreamStatusStream; 3786 - type Future = 3787 - BoxFuture<tonic::Response<Self::ResponseStream>, tonic::Status>; 4408 + type Future = BoxFuture< 4409 + tonic::Response<Self::ResponseStream>, 4410 + tonic::Status, 4411 + >; 3788 4412 fn call( 3789 4413 &mut self, 3790 4414 request: tonic::Request<super::StreamStatusRequest>, ··· 3821 4445 "/rockbox.v1alpha1.PlaybackService/StreamPlaylist" => { 3822 4446 #[allow(non_camel_case_types)] 3823 4447 struct StreamPlaylistSvc<T: PlaybackService>(pub Arc<T>); 3824 - impl<T: PlaybackService> 3825 - tonic::server::ServerStreamingService<super::StreamPlaylistRequest> 3826 - for StreamPlaylistSvc<T> 3827 - { 4448 + impl< 4449 + T: PlaybackService, 4450 + > tonic::server::ServerStreamingService<super::StreamPlaylistRequest> 4451 + for StreamPlaylistSvc<T> { 3828 4452 type Response = super::PlaylistResponse; 3829 4453 type ResponseStream = T::StreamPlaylistStream; 3830 - type Future = 3831 - BoxFuture<tonic::Response<Self::ResponseStream>, tonic::Status>; 4454 + type Future = BoxFuture< 4455 + tonic::Response<Self::ResponseStream>, 4456 + tonic::Status, 4457 + >; 3832 4458 fn call( 3833 4459 &mut self, 3834 4460 request: tonic::Request<super::StreamPlaylistRequest>, 3835 4461 ) -> Self::Future { 3836 4462 let inner = Arc::clone(&self.0); 3837 4463 let fut = async move { 3838 - <T as PlaybackService>::stream_playlist(&inner, request).await 4464 + <T as PlaybackService>::stream_playlist(&inner, request) 4465 + .await 3839 4466 }; 3840 4467 Box::pin(fut) 3841 4468 } ··· 3862 4489 }; 3863 4490 Box::pin(fut) 3864 4491 } 3865 - _ => Box::pin(async move { 3866 - let mut response = http::Response::new(empty_body()); 3867 - let headers = response.headers_mut(); 3868 - headers.insert( 3869 - tonic::Status::GRPC_STATUS, 3870 - (tonic::Code::Unimplemented as i32).into(), 3871 - ); 3872 - headers.insert( 3873 - http::header::CONTENT_TYPE, 3874 - tonic::metadata::GRPC_CONTENT_TYPE, 3875 - ); 3876 - Ok(response) 3877 - }), 4492 + _ => { 4493 + Box::pin(async move { 4494 + let mut response = http::Response::new(empty_body()); 4495 + let headers = response.headers_mut(); 4496 + headers 4497 + .insert( 4498 + tonic::Status::GRPC_STATUS, 4499 + (tonic::Code::Unimplemented as i32).into(), 4500 + ); 4501 + headers 4502 + .insert( 4503 + http::header::CONTENT_TYPE, 4504 + tonic::metadata::GRPC_CONTENT_TYPE, 4505 + ); 4506 + Ok(response) 4507 + }) 4508 + } 3878 4509 } 3879 4510 } 3880 4511 } ··· 4081 4712 dead_code, 4082 4713 missing_docs, 4083 4714 clippy::wildcard_imports, 4084 - clippy::let_unit_value 4715 + clippy::let_unit_value, 4085 4716 )] 4086 - use tonic::codegen::http::Uri; 4087 4717 use tonic::codegen::*; 4718 + use tonic::codegen::http::Uri; 4088 4719 #[derive(Debug, Clone)] 4089 4720 pub struct PlaylistServiceClient<T> { 4090 4721 inner: tonic::client::Grpc<T>, ··· 4128 4759 <T as tonic::client::GrpcService<tonic::body::BoxBody>>::ResponseBody, 4129 4760 >, 4130 4761 >, 4131 - <T as tonic::codegen::Service<http::Request<tonic::body::BoxBody>>>::Error: 4132 - Into<StdError> + std::marker::Send + std::marker::Sync, 4762 + <T as tonic::codegen::Service< 4763 + http::Request<tonic::body::BoxBody>, 4764 + >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync, 4133 4765 { 4134 4766 PlaylistServiceClient::new(InterceptedService::new(inner, interceptor)) 4135 4767 } ··· 4167 4799 pub async fn get_current( 4168 4800 &mut self, 4169 4801 request: impl tonic::IntoRequest<super::GetCurrentRequest>, 4170 - ) -> std::result::Result<tonic::Response<super::GetCurrentResponse>, tonic::Status> 4171 - { 4172 - self.inner.ready().await.map_err(|e| { 4173 - tonic::Status::unknown(format!("Service was not ready: {}", e.into())) 4174 - })?; 4802 + ) -> std::result::Result< 4803 + tonic::Response<super::GetCurrentResponse>, 4804 + tonic::Status, 4805 + > { 4806 + self.inner 4807 + .ready() 4808 + .await 4809 + .map_err(|e| { 4810 + tonic::Status::unknown( 4811 + format!("Service was not ready: {}", e.into()), 4812 + ) 4813 + })?; 4175 4814 let codec = tonic::codec::ProstCodec::default(); 4176 4815 let path = http::uri::PathAndQuery::from_static( 4177 4816 "/rockbox.v1alpha1.PlaylistService/GetCurrent", 4178 4817 ); 4179 4818 let mut req = request.into_request(); 4180 - req.extensions_mut().insert(GrpcMethod::new( 4181 - "rockbox.v1alpha1.PlaylistService", 4182 - "GetCurrent", 4183 - )); 4819 + req.extensions_mut() 4820 + .insert( 4821 + GrpcMethod::new("rockbox.v1alpha1.PlaylistService", "GetCurrent"), 4822 + ); 4184 4823 self.inner.unary(req, path, codec).await 4185 4824 } 4186 4825 pub async fn get_resume_info( 4187 4826 &mut self, 4188 4827 request: impl tonic::IntoRequest<super::GetResumeInfoRequest>, 4189 - ) -> std::result::Result<tonic::Response<super::GetResumeInfoResponse>, tonic::Status> 4190 - { 4191 - self.inner.ready().await.map_err(|e| { 4192 - tonic::Status::unknown(format!("Service was not ready: {}", e.into())) 4193 - })?; 4828 + ) -> std::result::Result< 4829 + tonic::Response<super::GetResumeInfoResponse>, 4830 + tonic::Status, 4831 + > { 4832 + self.inner 4833 + .ready() 4834 + .await 4835 + .map_err(|e| { 4836 + tonic::Status::unknown( 4837 + format!("Service was not ready: {}", e.into()), 4838 + ) 4839 + })?; 4194 4840 let codec = tonic::codec::ProstCodec::default(); 4195 4841 let path = http::uri::PathAndQuery::from_static( 4196 4842 "/rockbox.v1alpha1.PlaylistService/GetResumeInfo", 4197 4843 ); 4198 4844 let mut req = request.into_request(); 4199 - req.extensions_mut().insert(GrpcMethod::new( 4200 - "rockbox.v1alpha1.PlaylistService", 4201 - "GetResumeInfo", 4202 - )); 4845 + req.extensions_mut() 4846 + .insert( 4847 + GrpcMethod::new("rockbox.v1alpha1.PlaylistService", "GetResumeInfo"), 4848 + ); 4203 4849 self.inner.unary(req, path, codec).await 4204 4850 } 4205 4851 pub async fn get_track_info( 4206 4852 &mut self, 4207 4853 request: impl tonic::IntoRequest<super::GetTrackInfoRequest>, 4208 - ) -> std::result::Result<tonic::Response<super::GetTrackInfoResponse>, tonic::Status> 4209 - { 4210 - self.inner.ready().await.map_err(|e| { 4211 - tonic::Status::unknown(format!("Service was not ready: {}", e.into())) 4212 - })?; 4854 + ) -> std::result::Result< 4855 + tonic::Response<super::GetTrackInfoResponse>, 4856 + tonic::Status, 4857 + > { 4858 + self.inner 4859 + .ready() 4860 + .await 4861 + .map_err(|e| { 4862 + tonic::Status::unknown( 4863 + format!("Service was not ready: {}", e.into()), 4864 + ) 4865 + })?; 4213 4866 let codec = tonic::codec::ProstCodec::default(); 4214 4867 let path = http::uri::PathAndQuery::from_static( 4215 4868 "/rockbox.v1alpha1.PlaylistService/GetTrackInfo", 4216 4869 ); 4217 4870 let mut req = request.into_request(); 4218 - req.extensions_mut().insert(GrpcMethod::new( 4219 - "rockbox.v1alpha1.PlaylistService", 4220 - "GetTrackInfo", 4221 - )); 4871 + req.extensions_mut() 4872 + .insert( 4873 + GrpcMethod::new("rockbox.v1alpha1.PlaylistService", "GetTrackInfo"), 4874 + ); 4222 4875 self.inner.unary(req, path, codec).await 4223 4876 } 4224 4877 pub async fn get_first_index( 4225 4878 &mut self, 4226 4879 request: impl tonic::IntoRequest<super::GetFirstIndexRequest>, 4227 - ) -> std::result::Result<tonic::Response<super::GetFirstIndexResponse>, tonic::Status> 4228 - { 4229 - self.inner.ready().await.map_err(|e| { 4230 - tonic::Status::unknown(format!("Service was not ready: {}", e.into())) 4231 - })?; 4880 + ) -> std::result::Result< 4881 + tonic::Response<super::GetFirstIndexResponse>, 4882 + tonic::Status, 4883 + > { 4884 + self.inner 4885 + .ready() 4886 + .await 4887 + .map_err(|e| { 4888 + tonic::Status::unknown( 4889 + format!("Service was not ready: {}", e.into()), 4890 + ) 4891 + })?; 4232 4892 let codec = tonic::codec::ProstCodec::default(); 4233 4893 let path = http::uri::PathAndQuery::from_static( 4234 4894 "/rockbox.v1alpha1.PlaylistService/GetFirstIndex", 4235 4895 ); 4236 4896 let mut req = request.into_request(); 4237 - req.extensions_mut().insert(GrpcMethod::new( 4238 - "rockbox.v1alpha1.PlaylistService", 4239 - "GetFirstIndex", 4240 - )); 4897 + req.extensions_mut() 4898 + .insert( 4899 + GrpcMethod::new("rockbox.v1alpha1.PlaylistService", "GetFirstIndex"), 4900 + ); 4241 4901 self.inner.unary(req, path, codec).await 4242 4902 } 4243 4903 pub async fn get_display_index( 4244 4904 &mut self, 4245 4905 request: impl tonic::IntoRequest<super::GetDisplayIndexRequest>, 4246 - ) -> std::result::Result<tonic::Response<super::GetDisplayIndexResponse>, tonic::Status> 4247 - { 4248 - self.inner.ready().await.map_err(|e| { 4249 - tonic::Status::unknown(format!("Service was not ready: {}", e.into())) 4250 - })?; 4906 + ) -> std::result::Result< 4907 + tonic::Response<super::GetDisplayIndexResponse>, 4908 + tonic::Status, 4909 + > { 4910 + self.inner 4911 + .ready() 4912 + .await 4913 + .map_err(|e| { 4914 + tonic::Status::unknown( 4915 + format!("Service was not ready: {}", e.into()), 4916 + ) 4917 + })?; 4251 4918 let codec = tonic::codec::ProstCodec::default(); 4252 4919 let path = http::uri::PathAndQuery::from_static( 4253 4920 "/rockbox.v1alpha1.PlaylistService/GetDisplayIndex", 4254 4921 ); 4255 4922 let mut req = request.into_request(); 4256 - req.extensions_mut().insert(GrpcMethod::new( 4257 - "rockbox.v1alpha1.PlaylistService", 4258 - "GetDisplayIndex", 4259 - )); 4923 + req.extensions_mut() 4924 + .insert( 4925 + GrpcMethod::new( 4926 + "rockbox.v1alpha1.PlaylistService", 4927 + "GetDisplayIndex", 4928 + ), 4929 + ); 4260 4930 self.inner.unary(req, path, codec).await 4261 4931 } 4262 4932 pub async fn amount( 4263 4933 &mut self, 4264 4934 request: impl tonic::IntoRequest<super::AmountRequest>, 4265 4935 ) -> std::result::Result<tonic::Response<super::AmountResponse>, tonic::Status> { 4266 - self.inner.ready().await.map_err(|e| { 4267 - tonic::Status::unknown(format!("Service was not ready: {}", e.into())) 4268 - })?; 4936 + self.inner 4937 + .ready() 4938 + .await 4939 + .map_err(|e| { 4940 + tonic::Status::unknown( 4941 + format!("Service was not ready: {}", e.into()), 4942 + ) 4943 + })?; 4269 4944 let codec = tonic::codec::ProstCodec::default(); 4270 - let path = 4271 - http::uri::PathAndQuery::from_static("/rockbox.v1alpha1.PlaylistService/Amount"); 4945 + let path = http::uri::PathAndQuery::from_static( 4946 + "/rockbox.v1alpha1.PlaylistService/Amount", 4947 + ); 4272 4948 let mut req = request.into_request(); 4273 - req.extensions_mut().insert(GrpcMethod::new( 4274 - "rockbox.v1alpha1.PlaylistService", 4275 - "Amount", 4276 - )); 4949 + req.extensions_mut() 4950 + .insert(GrpcMethod::new("rockbox.v1alpha1.PlaylistService", "Amount")); 4277 4951 self.inner.unary(req, path, codec).await 4278 4952 } 4279 4953 pub async fn playlist_resume( 4280 4954 &mut self, 4281 4955 request: impl tonic::IntoRequest<super::PlaylistResumeRequest>, 4282 - ) -> std::result::Result<tonic::Response<super::PlaylistResumeResponse>, tonic::Status> 4283 - { 4284 - self.inner.ready().await.map_err(|e| { 4285 - tonic::Status::unknown(format!("Service was not ready: {}", e.into())) 4286 - })?; 4956 + ) -> std::result::Result< 4957 + tonic::Response<super::PlaylistResumeResponse>, 4958 + tonic::Status, 4959 + > { 4960 + self.inner 4961 + .ready() 4962 + .await 4963 + .map_err(|e| { 4964 + tonic::Status::unknown( 4965 + format!("Service was not ready: {}", e.into()), 4966 + ) 4967 + })?; 4287 4968 let codec = tonic::codec::ProstCodec::default(); 4288 4969 let path = http::uri::PathAndQuery::from_static( 4289 4970 "/rockbox.v1alpha1.PlaylistService/PlaylistResume", 4290 4971 ); 4291 4972 let mut req = request.into_request(); 4292 - req.extensions_mut().insert(GrpcMethod::new( 4293 - "rockbox.v1alpha1.PlaylistService", 4294 - "PlaylistResume", 4295 - )); 4973 + req.extensions_mut() 4974 + .insert( 4975 + GrpcMethod::new("rockbox.v1alpha1.PlaylistService", "PlaylistResume"), 4976 + ); 4296 4977 self.inner.unary(req, path, codec).await 4297 4978 } 4298 4979 pub async fn resume_track( 4299 4980 &mut self, 4300 4981 request: impl tonic::IntoRequest<super::ResumeTrackRequest>, 4301 - ) -> std::result::Result<tonic::Response<super::ResumeTrackResponse>, tonic::Status> 4302 - { 4303 - self.inner.ready().await.map_err(|e| { 4304 - tonic::Status::unknown(format!("Service was not ready: {}", e.into())) 4305 - })?; 4982 + ) -> std::result::Result< 4983 + tonic::Response<super::ResumeTrackResponse>, 4984 + tonic::Status, 4985 + > { 4986 + self.inner 4987 + .ready() 4988 + .await 4989 + .map_err(|e| { 4990 + tonic::Status::unknown( 4991 + format!("Service was not ready: {}", e.into()), 4992 + ) 4993 + })?; 4306 4994 let codec = tonic::codec::ProstCodec::default(); 4307 4995 let path = http::uri::PathAndQuery::from_static( 4308 4996 "/rockbox.v1alpha1.PlaylistService/ResumeTrack", 4309 4997 ); 4310 4998 let mut req = request.into_request(); 4311 - req.extensions_mut().insert(GrpcMethod::new( 4312 - "rockbox.v1alpha1.PlaylistService", 4313 - "ResumeTrack", 4314 - )); 4999 + req.extensions_mut() 5000 + .insert( 5001 + GrpcMethod::new("rockbox.v1alpha1.PlaylistService", "ResumeTrack"), 5002 + ); 4315 5003 self.inner.unary(req, path, codec).await 4316 5004 } 4317 5005 pub async fn set_modified( 4318 5006 &mut self, 4319 5007 request: impl tonic::IntoRequest<super::SetModifiedRequest>, 4320 - ) -> std::result::Result<tonic::Response<super::SetModifiedResponse>, tonic::Status> 4321 - { 4322 - self.inner.ready().await.map_err(|e| { 4323 - tonic::Status::unknown(format!("Service was not ready: {}", e.into())) 4324 - })?; 5008 + ) -> std::result::Result< 5009 + tonic::Response<super::SetModifiedResponse>, 5010 + tonic::Status, 5011 + > { 5012 + self.inner 5013 + .ready() 5014 + .await 5015 + .map_err(|e| { 5016 + tonic::Status::unknown( 5017 + format!("Service was not ready: {}", e.into()), 5018 + ) 5019 + })?; 4325 5020 let codec = tonic::codec::ProstCodec::default(); 4326 5021 let path = http::uri::PathAndQuery::from_static( 4327 5022 "/rockbox.v1alpha1.PlaylistService/SetModified", 4328 5023 ); 4329 5024 let mut req = request.into_request(); 4330 - req.extensions_mut().insert(GrpcMethod::new( 4331 - "rockbox.v1alpha1.PlaylistService", 4332 - "SetModified", 4333 - )); 5025 + req.extensions_mut() 5026 + .insert( 5027 + GrpcMethod::new("rockbox.v1alpha1.PlaylistService", "SetModified"), 5028 + ); 4334 5029 self.inner.unary(req, path, codec).await 4335 5030 } 4336 5031 pub async fn start( 4337 5032 &mut self, 4338 5033 request: impl tonic::IntoRequest<super::StartRequest>, 4339 5034 ) -> std::result::Result<tonic::Response<super::StartResponse>, tonic::Status> { 4340 - self.inner.ready().await.map_err(|e| { 4341 - tonic::Status::unknown(format!("Service was not ready: {}", e.into())) 4342 - })?; 5035 + self.inner 5036 + .ready() 5037 + .await 5038 + .map_err(|e| { 5039 + tonic::Status::unknown( 5040 + format!("Service was not ready: {}", e.into()), 5041 + ) 5042 + })?; 4343 5043 let codec = tonic::codec::ProstCodec::default(); 4344 - let path = 4345 - http::uri::PathAndQuery::from_static("/rockbox.v1alpha1.PlaylistService/Start"); 5044 + let path = http::uri::PathAndQuery::from_static( 5045 + "/rockbox.v1alpha1.PlaylistService/Start", 5046 + ); 4346 5047 let mut req = request.into_request(); 4347 5048 req.extensions_mut() 4348 5049 .insert(GrpcMethod::new("rockbox.v1alpha1.PlaylistService", "Start")); ··· 4352 5053 &mut self, 4353 5054 request: impl tonic::IntoRequest<super::SyncRequest>, 4354 5055 ) -> std::result::Result<tonic::Response<super::SyncResponse>, tonic::Status> { 4355 - self.inner.ready().await.map_err(|e| { 4356 - tonic::Status::unknown(format!("Service was not ready: {}", e.into())) 4357 - })?; 5056 + self.inner 5057 + .ready() 5058 + .await 5059 + .map_err(|e| { 5060 + tonic::Status::unknown( 5061 + format!("Service was not ready: {}", e.into()), 5062 + ) 5063 + })?; 4358 5064 let codec = tonic::codec::ProstCodec::default(); 4359 - let path = 4360 - http::uri::PathAndQuery::from_static("/rockbox.v1alpha1.PlaylistService/Sync"); 5065 + let path = http::uri::PathAndQuery::from_static( 5066 + "/rockbox.v1alpha1.PlaylistService/Sync", 5067 + ); 4361 5068 let mut req = request.into_request(); 4362 5069 req.extensions_mut() 4363 5070 .insert(GrpcMethod::new("rockbox.v1alpha1.PlaylistService", "Sync")); ··· 4366 5073 pub async fn remove_all_tracks( 4367 5074 &mut self, 4368 5075 request: impl tonic::IntoRequest<super::RemoveAllTracksRequest>, 4369 - ) -> std::result::Result<tonic::Response<super::RemoveAllTracksResponse>, tonic::Status> 4370 - { 4371 - self.inner.ready().await.map_err(|e| { 4372 - tonic::Status::unknown(format!("Service was not ready: {}", e.into())) 4373 - })?; 5076 + ) -> std::result::Result< 5077 + tonic::Response<super::RemoveAllTracksResponse>, 5078 + tonic::Status, 5079 + > { 5080 + self.inner 5081 + .ready() 5082 + .await 5083 + .map_err(|e| { 5084 + tonic::Status::unknown( 5085 + format!("Service was not ready: {}", e.into()), 5086 + ) 5087 + })?; 4374 5088 let codec = tonic::codec::ProstCodec::default(); 4375 5089 let path = http::uri::PathAndQuery::from_static( 4376 5090 "/rockbox.v1alpha1.PlaylistService/RemoveAllTracks", 4377 5091 ); 4378 5092 let mut req = request.into_request(); 4379 - req.extensions_mut().insert(GrpcMethod::new( 4380 - "rockbox.v1alpha1.PlaylistService", 4381 - "RemoveAllTracks", 4382 - )); 5093 + req.extensions_mut() 5094 + .insert( 5095 + GrpcMethod::new( 5096 + "rockbox.v1alpha1.PlaylistService", 5097 + "RemoveAllTracks", 5098 + ), 5099 + ); 4383 5100 self.inner.unary(req, path, codec).await 4384 5101 } 4385 5102 pub async fn remove_tracks( 4386 5103 &mut self, 4387 5104 request: impl tonic::IntoRequest<super::RemoveTracksRequest>, 4388 - ) -> std::result::Result<tonic::Response<super::RemoveTracksResponse>, tonic::Status> 4389 - { 4390 - self.inner.ready().await.map_err(|e| { 4391 - tonic::Status::unknown(format!("Service was not ready: {}", e.into())) 4392 - })?; 5105 + ) -> std::result::Result< 5106 + tonic::Response<super::RemoveTracksResponse>, 5107 + tonic::Status, 5108 + > { 5109 + self.inner 5110 + .ready() 5111 + .await 5112 + .map_err(|e| { 5113 + tonic::Status::unknown( 5114 + format!("Service was not ready: {}", e.into()), 5115 + ) 5116 + })?; 4393 5117 let codec = tonic::codec::ProstCodec::default(); 4394 5118 let path = http::uri::PathAndQuery::from_static( 4395 5119 "/rockbox.v1alpha1.PlaylistService/RemoveTracks", 4396 5120 ); 4397 5121 let mut req = request.into_request(); 4398 - req.extensions_mut().insert(GrpcMethod::new( 4399 - "rockbox.v1alpha1.PlaylistService", 4400 - "RemoveTracks", 4401 - )); 5122 + req.extensions_mut() 5123 + .insert( 5124 + GrpcMethod::new("rockbox.v1alpha1.PlaylistService", "RemoveTracks"), 5125 + ); 4402 5126 self.inner.unary(req, path, codec).await 4403 5127 } 4404 5128 pub async fn create_playlist( 4405 5129 &mut self, 4406 5130 request: impl tonic::IntoRequest<super::CreatePlaylistRequest>, 4407 - ) -> std::result::Result<tonic::Response<super::CreatePlaylistResponse>, tonic::Status> 4408 - { 4409 - self.inner.ready().await.map_err(|e| { 4410 - tonic::Status::unknown(format!("Service was not ready: {}", e.into())) 4411 - })?; 5131 + ) -> std::result::Result< 5132 + tonic::Response<super::CreatePlaylistResponse>, 5133 + tonic::Status, 5134 + > { 5135 + self.inner 5136 + .ready() 5137 + .await 5138 + .map_err(|e| { 5139 + tonic::Status::unknown( 5140 + format!("Service was not ready: {}", e.into()), 5141 + ) 5142 + })?; 4412 5143 let codec = tonic::codec::ProstCodec::default(); 4413 5144 let path = http::uri::PathAndQuery::from_static( 4414 5145 "/rockbox.v1alpha1.PlaylistService/CreatePlaylist", 4415 5146 ); 4416 5147 let mut req = request.into_request(); 4417 - req.extensions_mut().insert(GrpcMethod::new( 4418 - "rockbox.v1alpha1.PlaylistService", 4419 - "CreatePlaylist", 4420 - )); 5148 + req.extensions_mut() 5149 + .insert( 5150 + GrpcMethod::new("rockbox.v1alpha1.PlaylistService", "CreatePlaylist"), 5151 + ); 4421 5152 self.inner.unary(req, path, codec).await 4422 5153 } 4423 5154 pub async fn insert_tracks( 4424 5155 &mut self, 4425 5156 request: impl tonic::IntoRequest<super::InsertTracksRequest>, 4426 - ) -> std::result::Result<tonic::Response<super::InsertTracksResponse>, tonic::Status> 4427 - { 4428 - self.inner.ready().await.map_err(|e| { 4429 - tonic::Status::unknown(format!("Service was not ready: {}", e.into())) 4430 - })?; 5157 + ) -> std::result::Result< 5158 + tonic::Response<super::InsertTracksResponse>, 5159 + tonic::Status, 5160 + > { 5161 + self.inner 5162 + .ready() 5163 + .await 5164 + .map_err(|e| { 5165 + tonic::Status::unknown( 5166 + format!("Service was not ready: {}", e.into()), 5167 + ) 5168 + })?; 4431 5169 let codec = tonic::codec::ProstCodec::default(); 4432 5170 let path = http::uri::PathAndQuery::from_static( 4433 5171 "/rockbox.v1alpha1.PlaylistService/InsertTracks", 4434 5172 ); 4435 5173 let mut req = request.into_request(); 4436 - req.extensions_mut().insert(GrpcMethod::new( 4437 - "rockbox.v1alpha1.PlaylistService", 4438 - "InsertTracks", 4439 - )); 5174 + req.extensions_mut() 5175 + .insert( 5176 + GrpcMethod::new("rockbox.v1alpha1.PlaylistService", "InsertTracks"), 5177 + ); 4440 5178 self.inner.unary(req, path, codec).await 4441 5179 } 4442 5180 pub async fn insert_directory( 4443 5181 &mut self, 4444 5182 request: impl tonic::IntoRequest<super::InsertDirectoryRequest>, 4445 - ) -> std::result::Result<tonic::Response<super::InsertDirectoryResponse>, tonic::Status> 4446 - { 4447 - self.inner.ready().await.map_err(|e| { 4448 - tonic::Status::unknown(format!("Service was not ready: {}", e.into())) 4449 - })?; 5183 + ) -> std::result::Result< 5184 + tonic::Response<super::InsertDirectoryResponse>, 5185 + tonic::Status, 5186 + > { 5187 + self.inner 5188 + .ready() 5189 + .await 5190 + .map_err(|e| { 5191 + tonic::Status::unknown( 5192 + format!("Service was not ready: {}", e.into()), 5193 + ) 5194 + })?; 4450 5195 let codec = tonic::codec::ProstCodec::default(); 4451 5196 let path = http::uri::PathAndQuery::from_static( 4452 5197 "/rockbox.v1alpha1.PlaylistService/InsertDirectory", 4453 5198 ); 4454 5199 let mut req = request.into_request(); 4455 - req.extensions_mut().insert(GrpcMethod::new( 4456 - "rockbox.v1alpha1.PlaylistService", 4457 - "InsertDirectory", 4458 - )); 5200 + req.extensions_mut() 5201 + .insert( 5202 + GrpcMethod::new( 5203 + "rockbox.v1alpha1.PlaylistService", 5204 + "InsertDirectory", 5205 + ), 5206 + ); 4459 5207 self.inner.unary(req, path, codec).await 4460 5208 } 4461 5209 pub async fn insert_playlist( 4462 5210 &mut self, 4463 5211 request: impl tonic::IntoRequest<super::InsertPlaylistRequest>, 4464 - ) -> std::result::Result<tonic::Response<super::InsertPlaylistResponse>, tonic::Status> 4465 - { 4466 - self.inner.ready().await.map_err(|e| { 4467 - tonic::Status::unknown(format!("Service was not ready: {}", e.into())) 4468 - })?; 5212 + ) -> std::result::Result< 5213 + tonic::Response<super::InsertPlaylistResponse>, 5214 + tonic::Status, 5215 + > { 5216 + self.inner 5217 + .ready() 5218 + .await 5219 + .map_err(|e| { 5220 + tonic::Status::unknown( 5221 + format!("Service was not ready: {}", e.into()), 5222 + ) 5223 + })?; 4469 5224 let codec = tonic::codec::ProstCodec::default(); 4470 5225 let path = http::uri::PathAndQuery::from_static( 4471 5226 "/rockbox.v1alpha1.PlaylistService/InsertPlaylist", 4472 5227 ); 4473 5228 let mut req = request.into_request(); 4474 - req.extensions_mut().insert(GrpcMethod::new( 4475 - "rockbox.v1alpha1.PlaylistService", 4476 - "InsertPlaylist", 4477 - )); 5229 + req.extensions_mut() 5230 + .insert( 5231 + GrpcMethod::new("rockbox.v1alpha1.PlaylistService", "InsertPlaylist"), 5232 + ); 4478 5233 self.inner.unary(req, path, codec).await 4479 5234 } 4480 5235 pub async fn insert_album( 4481 5236 &mut self, 4482 5237 request: impl tonic::IntoRequest<super::InsertAlbumRequest>, 4483 - ) -> std::result::Result<tonic::Response<super::InsertAlbumResponse>, tonic::Status> 4484 - { 4485 - self.inner.ready().await.map_err(|e| { 4486 - tonic::Status::unknown(format!("Service was not ready: {}", e.into())) 4487 - })?; 5238 + ) -> std::result::Result< 5239 + tonic::Response<super::InsertAlbumResponse>, 5240 + tonic::Status, 5241 + > { 5242 + self.inner 5243 + .ready() 5244 + .await 5245 + .map_err(|e| { 5246 + tonic::Status::unknown( 5247 + format!("Service was not ready: {}", e.into()), 5248 + ) 5249 + })?; 4488 5250 let codec = tonic::codec::ProstCodec::default(); 4489 5251 let path = http::uri::PathAndQuery::from_static( 4490 5252 "/rockbox.v1alpha1.PlaylistService/InsertAlbum", 4491 5253 ); 4492 5254 let mut req = request.into_request(); 4493 - req.extensions_mut().insert(GrpcMethod::new( 4494 - "rockbox.v1alpha1.PlaylistService", 4495 - "InsertAlbum", 4496 - )); 5255 + req.extensions_mut() 5256 + .insert( 5257 + GrpcMethod::new("rockbox.v1alpha1.PlaylistService", "InsertAlbum"), 5258 + ); 4497 5259 self.inner.unary(req, path, codec).await 4498 5260 } 4499 5261 pub async fn insert_artist_tracks( 4500 5262 &mut self, 4501 5263 request: impl tonic::IntoRequest<super::InsertArtistTracksRequest>, 4502 - ) -> std::result::Result<tonic::Response<super::InsertArtistTracksResponse>, tonic::Status> 4503 - { 4504 - self.inner.ready().await.map_err(|e| { 4505 - tonic::Status::unknown(format!("Service was not ready: {}", e.into())) 4506 - })?; 5264 + ) -> std::result::Result< 5265 + tonic::Response<super::InsertArtistTracksResponse>, 5266 + tonic::Status, 5267 + > { 5268 + self.inner 5269 + .ready() 5270 + .await 5271 + .map_err(|e| { 5272 + tonic::Status::unknown( 5273 + format!("Service was not ready: {}", e.into()), 5274 + ) 5275 + })?; 4507 5276 let codec = tonic::codec::ProstCodec::default(); 4508 5277 let path = http::uri::PathAndQuery::from_static( 4509 5278 "/rockbox.v1alpha1.PlaylistService/InsertArtistTracks", 4510 5279 ); 4511 5280 let mut req = request.into_request(); 4512 - req.extensions_mut().insert(GrpcMethod::new( 4513 - "rockbox.v1alpha1.PlaylistService", 4514 - "InsertArtistTracks", 4515 - )); 5281 + req.extensions_mut() 5282 + .insert( 5283 + GrpcMethod::new( 5284 + "rockbox.v1alpha1.PlaylistService", 5285 + "InsertArtistTracks", 5286 + ), 5287 + ); 4516 5288 self.inner.unary(req, path, codec).await 4517 5289 } 4518 5290 pub async fn shuffle_playlist( 4519 5291 &mut self, 4520 5292 request: impl tonic::IntoRequest<super::ShufflePlaylistRequest>, 4521 - ) -> std::result::Result<tonic::Response<super::ShufflePlaylistResponse>, tonic::Status> 4522 - { 4523 - self.inner.ready().await.map_err(|e| { 4524 - tonic::Status::unknown(format!("Service was not ready: {}", e.into())) 4525 - })?; 5293 + ) -> std::result::Result< 5294 + tonic::Response<super::ShufflePlaylistResponse>, 5295 + tonic::Status, 5296 + > { 5297 + self.inner 5298 + .ready() 5299 + .await 5300 + .map_err(|e| { 5301 + tonic::Status::unknown( 5302 + format!("Service was not ready: {}", e.into()), 5303 + ) 5304 + })?; 4526 5305 let codec = tonic::codec::ProstCodec::default(); 4527 5306 let path = http::uri::PathAndQuery::from_static( 4528 5307 "/rockbox.v1alpha1.PlaylistService/ShufflePlaylist", 4529 5308 ); 4530 5309 let mut req = request.into_request(); 4531 - req.extensions_mut().insert(GrpcMethod::new( 4532 - "rockbox.v1alpha1.PlaylistService", 4533 - "ShufflePlaylist", 4534 - )); 5310 + req.extensions_mut() 5311 + .insert( 5312 + GrpcMethod::new( 5313 + "rockbox.v1alpha1.PlaylistService", 5314 + "ShufflePlaylist", 5315 + ), 5316 + ); 4535 5317 self.inner.unary(req, path, codec).await 4536 5318 } 4537 5319 } ··· 4543 5325 dead_code, 4544 5326 missing_docs, 4545 5327 clippy::wildcard_imports, 4546 - clippy::let_unit_value 5328 + clippy::let_unit_value, 4547 5329 )] 4548 5330 use tonic::codegen::*; 4549 5331 /// Generated trait containing gRPC methods that should be implemented for use with PlaylistServiceServer. ··· 4552 5334 async fn get_current( 4553 5335 &self, 4554 5336 request: tonic::Request<super::GetCurrentRequest>, 4555 - ) -> std::result::Result<tonic::Response<super::GetCurrentResponse>, tonic::Status>; 5337 + ) -> std::result::Result< 5338 + tonic::Response<super::GetCurrentResponse>, 5339 + tonic::Status, 5340 + >; 4556 5341 async fn get_resume_info( 4557 5342 &self, 4558 5343 request: tonic::Request<super::GetResumeInfoRequest>, 4559 - ) -> std::result::Result<tonic::Response<super::GetResumeInfoResponse>, tonic::Status>; 5344 + ) -> std::result::Result< 5345 + tonic::Response<super::GetResumeInfoResponse>, 5346 + tonic::Status, 5347 + >; 4560 5348 async fn get_track_info( 4561 5349 &self, 4562 5350 request: tonic::Request<super::GetTrackInfoRequest>, 4563 - ) -> std::result::Result<tonic::Response<super::GetTrackInfoResponse>, tonic::Status>; 5351 + ) -> std::result::Result< 5352 + tonic::Response<super::GetTrackInfoResponse>, 5353 + tonic::Status, 5354 + >; 4564 5355 async fn get_first_index( 4565 5356 &self, 4566 5357 request: tonic::Request<super::GetFirstIndexRequest>, 4567 - ) -> std::result::Result<tonic::Response<super::GetFirstIndexResponse>, tonic::Status>; 5358 + ) -> std::result::Result< 5359 + tonic::Response<super::GetFirstIndexResponse>, 5360 + tonic::Status, 5361 + >; 4568 5362 async fn get_display_index( 4569 5363 &self, 4570 5364 request: tonic::Request<super::GetDisplayIndexRequest>, 4571 - ) -> std::result::Result<tonic::Response<super::GetDisplayIndexResponse>, tonic::Status>; 5365 + ) -> std::result::Result< 5366 + tonic::Response<super::GetDisplayIndexResponse>, 5367 + tonic::Status, 5368 + >; 4572 5369 async fn amount( 4573 5370 &self, 4574 5371 request: tonic::Request<super::AmountRequest>, ··· 4576 5373 async fn playlist_resume( 4577 5374 &self, 4578 5375 request: tonic::Request<super::PlaylistResumeRequest>, 4579 - ) -> std::result::Result<tonic::Response<super::PlaylistResumeResponse>, tonic::Status>; 5376 + ) -> std::result::Result< 5377 + tonic::Response<super::PlaylistResumeResponse>, 5378 + tonic::Status, 5379 + >; 4580 5380 async fn resume_track( 4581 5381 &self, 4582 5382 request: tonic::Request<super::ResumeTrackRequest>, 4583 - ) -> std::result::Result<tonic::Response<super::ResumeTrackResponse>, tonic::Status>; 5383 + ) -> std::result::Result< 5384 + tonic::Response<super::ResumeTrackResponse>, 5385 + tonic::Status, 5386 + >; 4584 5387 async fn set_modified( 4585 5388 &self, 4586 5389 request: tonic::Request<super::SetModifiedRequest>, 4587 - ) -> std::result::Result<tonic::Response<super::SetModifiedResponse>, tonic::Status>; 5390 + ) -> std::result::Result< 5391 + tonic::Response<super::SetModifiedResponse>, 5392 + tonic::Status, 5393 + >; 4588 5394 async fn start( 4589 5395 &self, 4590 5396 request: tonic::Request<super::StartRequest>, ··· 4596 5402 async fn remove_all_tracks( 4597 5403 &self, 4598 5404 request: tonic::Request<super::RemoveAllTracksRequest>, 4599 - ) -> std::result::Result<tonic::Response<super::RemoveAllTracksResponse>, tonic::Status>; 5405 + ) -> std::result::Result< 5406 + tonic::Response<super::RemoveAllTracksResponse>, 5407 + tonic::Status, 5408 + >; 4600 5409 async fn remove_tracks( 4601 5410 &self, 4602 5411 request: tonic::Request<super::RemoveTracksRequest>, 4603 - ) -> std::result::Result<tonic::Response<super::RemoveTracksResponse>, tonic::Status>; 5412 + ) -> std::result::Result< 5413 + tonic::Response<super::RemoveTracksResponse>, 5414 + tonic::Status, 5415 + >; 4604 5416 async fn create_playlist( 4605 5417 &self, 4606 5418 request: tonic::Request<super::CreatePlaylistRequest>, 4607 - ) -> std::result::Result<tonic::Response<super::CreatePlaylistResponse>, tonic::Status>; 5419 + ) -> std::result::Result< 5420 + tonic::Response<super::CreatePlaylistResponse>, 5421 + tonic::Status, 5422 + >; 4608 5423 async fn insert_tracks( 4609 5424 &self, 4610 5425 request: tonic::Request<super::InsertTracksRequest>, 4611 - ) -> std::result::Result<tonic::Response<super::InsertTracksResponse>, tonic::Status>; 5426 + ) -> std::result::Result< 5427 + tonic::Response<super::InsertTracksResponse>, 5428 + tonic::Status, 5429 + >; 4612 5430 async fn insert_directory( 4613 5431 &self, 4614 5432 request: tonic::Request<super::InsertDirectoryRequest>, 4615 - ) -> std::result::Result<tonic::Response<super::InsertDirectoryResponse>, tonic::Status>; 5433 + ) -> std::result::Result< 5434 + tonic::Response<super::InsertDirectoryResponse>, 5435 + tonic::Status, 5436 + >; 4616 5437 async fn insert_playlist( 4617 5438 &self, 4618 5439 request: tonic::Request<super::InsertPlaylistRequest>, 4619 - ) -> std::result::Result<tonic::Response<super::InsertPlaylistResponse>, tonic::Status>; 5440 + ) -> std::result::Result< 5441 + tonic::Response<super::InsertPlaylistResponse>, 5442 + tonic::Status, 5443 + >; 4620 5444 async fn insert_album( 4621 5445 &self, 4622 5446 request: tonic::Request<super::InsertAlbumRequest>, 4623 - ) -> std::result::Result<tonic::Response<super::InsertAlbumResponse>, tonic::Status>; 5447 + ) -> std::result::Result< 5448 + tonic::Response<super::InsertAlbumResponse>, 5449 + tonic::Status, 5450 + >; 4624 5451 async fn insert_artist_tracks( 4625 5452 &self, 4626 5453 request: tonic::Request<super::InsertArtistTracksRequest>, 4627 - ) -> std::result::Result<tonic::Response<super::InsertArtistTracksResponse>, tonic::Status>; 5454 + ) -> std::result::Result< 5455 + tonic::Response<super::InsertArtistTracksResponse>, 5456 + tonic::Status, 5457 + >; 4628 5458 async fn shuffle_playlist( 4629 5459 &self, 4630 5460 request: tonic::Request<super::ShufflePlaylistRequest>, 4631 - ) -> std::result::Result<tonic::Response<super::ShufflePlaylistResponse>, tonic::Status>; 5461 + ) -> std::result::Result< 5462 + tonic::Response<super::ShufflePlaylistResponse>, 5463 + tonic::Status, 5464 + >; 4632 5465 } 4633 5466 #[derive(Debug)] 4634 5467 pub struct PlaylistServiceServer<T> { ··· 4651 5484 max_encoding_message_size: None, 4652 5485 } 4653 5486 } 4654 - pub fn with_interceptor<F>(inner: T, interceptor: F) -> InterceptedService<Self, F> 5487 + pub fn with_interceptor<F>( 5488 + inner: T, 5489 + interceptor: F, 5490 + ) -> InterceptedService<Self, F> 4655 5491 where 4656 5492 F: tonic::service::Interceptor, 4657 5493 { ··· 4706 5542 "/rockbox.v1alpha1.PlaylistService/GetCurrent" => { 4707 5543 #[allow(non_camel_case_types)] 4708 5544 struct GetCurrentSvc<T: PlaylistService>(pub Arc<T>); 4709 - impl<T: PlaylistService> tonic::server::UnaryService<super::GetCurrentRequest> 4710 - for GetCurrentSvc<T> 4711 - { 5545 + impl< 5546 + T: PlaylistService, 5547 + > tonic::server::UnaryService<super::GetCurrentRequest> 5548 + for GetCurrentSvc<T> { 4712 5549 type Response = super::GetCurrentResponse; 4713 - type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>; 5550 + type Future = BoxFuture< 5551 + tonic::Response<Self::Response>, 5552 + tonic::Status, 5553 + >; 4714 5554 fn call( 4715 5555 &mut self, 4716 5556 request: tonic::Request<super::GetCurrentRequest>, ··· 4747 5587 "/rockbox.v1alpha1.PlaylistService/GetResumeInfo" => { 4748 5588 #[allow(non_camel_case_types)] 4749 5589 struct GetResumeInfoSvc<T: PlaylistService>(pub Arc<T>); 4750 - impl<T: PlaylistService> 4751 - tonic::server::UnaryService<super::GetResumeInfoRequest> 4752 - for GetResumeInfoSvc<T> 4753 - { 5590 + impl< 5591 + T: PlaylistService, 5592 + > tonic::server::UnaryService<super::GetResumeInfoRequest> 5593 + for GetResumeInfoSvc<T> { 4754 5594 type Response = super::GetResumeInfoResponse; 4755 - type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>; 5595 + type Future = BoxFuture< 5596 + tonic::Response<Self::Response>, 5597 + tonic::Status, 5598 + >; 4756 5599 fn call( 4757 5600 &mut self, 4758 5601 request: tonic::Request<super::GetResumeInfoRequest>, 4759 5602 ) -> Self::Future { 4760 5603 let inner = Arc::clone(&self.0); 4761 5604 let fut = async move { 4762 - <T as PlaylistService>::get_resume_info(&inner, request).await 5605 + <T as PlaylistService>::get_resume_info(&inner, request) 5606 + .await 4763 5607 }; 4764 5608 Box::pin(fut) 4765 5609 } ··· 4789 5633 "/rockbox.v1alpha1.PlaylistService/GetTrackInfo" => { 4790 5634 #[allow(non_camel_case_types)] 4791 5635 struct GetTrackInfoSvc<T: PlaylistService>(pub Arc<T>); 4792 - impl<T: PlaylistService> tonic::server::UnaryService<super::GetTrackInfoRequest> 4793 - for GetTrackInfoSvc<T> 4794 - { 5636 + impl< 5637 + T: PlaylistService, 5638 + > tonic::server::UnaryService<super::GetTrackInfoRequest> 5639 + for GetTrackInfoSvc<T> { 4795 5640 type Response = super::GetTrackInfoResponse; 4796 - type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>; 5641 + type Future = BoxFuture< 5642 + tonic::Response<Self::Response>, 5643 + tonic::Status, 5644 + >; 4797 5645 fn call( 4798 5646 &mut self, 4799 5647 request: tonic::Request<super::GetTrackInfoRequest>, 4800 5648 ) -> Self::Future { 4801 5649 let inner = Arc::clone(&self.0); 4802 5650 let fut = async move { 4803 - <T as PlaylistService>::get_track_info(&inner, request).await 5651 + <T as PlaylistService>::get_track_info(&inner, request) 5652 + .await 4804 5653 }; 4805 5654 Box::pin(fut) 4806 5655 } ··· 4830 5679 "/rockbox.v1alpha1.PlaylistService/GetFirstIndex" => { 4831 5680 #[allow(non_camel_case_types)] 4832 5681 struct GetFirstIndexSvc<T: PlaylistService>(pub Arc<T>); 4833 - impl<T: PlaylistService> 4834 - tonic::server::UnaryService<super::GetFirstIndexRequest> 4835 - for GetFirstIndexSvc<T> 4836 - { 5682 + impl< 5683 + T: PlaylistService, 5684 + > tonic::server::UnaryService<super::GetFirstIndexRequest> 5685 + for GetFirstIndexSvc<T> { 4837 5686 type Response = super::GetFirstIndexResponse; 4838 - type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>; 5687 + type Future = BoxFuture< 5688 + tonic::Response<Self::Response>, 5689 + tonic::Status, 5690 + >; 4839 5691 fn call( 4840 5692 &mut self, 4841 5693 request: tonic::Request<super::GetFirstIndexRequest>, 4842 5694 ) -> Self::Future { 4843 5695 let inner = Arc::clone(&self.0); 4844 5696 let fut = async move { 4845 - <T as PlaylistService>::get_first_index(&inner, request).await 5697 + <T as PlaylistService>::get_first_index(&inner, request) 5698 + .await 4846 5699 }; 4847 5700 Box::pin(fut) 4848 5701 } ··· 4872 5725 "/rockbox.v1alpha1.PlaylistService/GetDisplayIndex" => { 4873 5726 #[allow(non_camel_case_types)] 4874 5727 struct GetDisplayIndexSvc<T: PlaylistService>(pub Arc<T>); 4875 - impl<T: PlaylistService> 4876 - tonic::server::UnaryService<super::GetDisplayIndexRequest> 4877 - for GetDisplayIndexSvc<T> 4878 - { 5728 + impl< 5729 + T: PlaylistService, 5730 + > tonic::server::UnaryService<super::GetDisplayIndexRequest> 5731 + for GetDisplayIndexSvc<T> { 4879 5732 type Response = super::GetDisplayIndexResponse; 4880 - type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>; 5733 + type Future = BoxFuture< 5734 + tonic::Response<Self::Response>, 5735 + tonic::Status, 5736 + >; 4881 5737 fn call( 4882 5738 &mut self, 4883 5739 request: tonic::Request<super::GetDisplayIndexRequest>, 4884 5740 ) -> Self::Future { 4885 5741 let inner = Arc::clone(&self.0); 4886 5742 let fut = async move { 4887 - <T as PlaylistService>::get_display_index(&inner, request).await 5743 + <T as PlaylistService>::get_display_index(&inner, request) 5744 + .await 4888 5745 }; 4889 5746 Box::pin(fut) 4890 5747 } ··· 4914 5771 "/rockbox.v1alpha1.PlaylistService/Amount" => { 4915 5772 #[allow(non_camel_case_types)] 4916 5773 struct AmountSvc<T: PlaylistService>(pub Arc<T>); 4917 - impl<T: PlaylistService> tonic::server::UnaryService<super::AmountRequest> for AmountSvc<T> { 5774 + impl< 5775 + T: PlaylistService, 5776 + > tonic::server::UnaryService<super::AmountRequest> 5777 + for AmountSvc<T> { 4918 5778 type Response = super::AmountResponse; 4919 - type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>; 5779 + type Future = BoxFuture< 5780 + tonic::Response<Self::Response>, 5781 + tonic::Status, 5782 + >; 4920 5783 fn call( 4921 5784 &mut self, 4922 5785 request: tonic::Request<super::AmountRequest>, ··· 4953 5816 "/rockbox.v1alpha1.PlaylistService/PlaylistResume" => { 4954 5817 #[allow(non_camel_case_types)] 4955 5818 struct PlaylistResumeSvc<T: PlaylistService>(pub Arc<T>); 4956 - impl<T: PlaylistService> 4957 - tonic::server::UnaryService<super::PlaylistResumeRequest> 4958 - for PlaylistResumeSvc<T> 4959 - { 5819 + impl< 5820 + T: PlaylistService, 5821 + > tonic::server::UnaryService<super::PlaylistResumeRequest> 5822 + for PlaylistResumeSvc<T> { 4960 5823 type Response = super::PlaylistResumeResponse; 4961 - type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>; 5824 + type Future = BoxFuture< 5825 + tonic::Response<Self::Response>, 5826 + tonic::Status, 5827 + >; 4962 5828 fn call( 4963 5829 &mut self, 4964 5830 request: tonic::Request<super::PlaylistResumeRequest>, 4965 5831 ) -> Self::Future { 4966 5832 let inner = Arc::clone(&self.0); 4967 5833 let fut = async move { 4968 - <T as PlaylistService>::playlist_resume(&inner, request).await 5834 + <T as PlaylistService>::playlist_resume(&inner, request) 5835 + .await 4969 5836 }; 4970 5837 Box::pin(fut) 4971 5838 } ··· 4995 5862 "/rockbox.v1alpha1.PlaylistService/ResumeTrack" => { 4996 5863 #[allow(non_camel_case_types)] 4997 5864 struct ResumeTrackSvc<T: PlaylistService>(pub Arc<T>); 4998 - impl<T: PlaylistService> tonic::server::UnaryService<super::ResumeTrackRequest> 4999 - for ResumeTrackSvc<T> 5000 - { 5865 + impl< 5866 + T: PlaylistService, 5867 + > tonic::server::UnaryService<super::ResumeTrackRequest> 5868 + for ResumeTrackSvc<T> { 5001 5869 type Response = super::ResumeTrackResponse; 5002 - type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>; 5870 + type Future = BoxFuture< 5871 + tonic::Response<Self::Response>, 5872 + tonic::Status, 5873 + >; 5003 5874 fn call( 5004 5875 &mut self, 5005 5876 request: tonic::Request<super::ResumeTrackRequest>, ··· 5036 5907 "/rockbox.v1alpha1.PlaylistService/SetModified" => { 5037 5908 #[allow(non_camel_case_types)] 5038 5909 struct SetModifiedSvc<T: PlaylistService>(pub Arc<T>); 5039 - impl<T: PlaylistService> tonic::server::UnaryService<super::SetModifiedRequest> 5040 - for SetModifiedSvc<T> 5041 - { 5910 + impl< 5911 + T: PlaylistService, 5912 + > tonic::server::UnaryService<super::SetModifiedRequest> 5913 + for SetModifiedSvc<T> { 5042 5914 type Response = super::SetModifiedResponse; 5043 - type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>; 5915 + type Future = BoxFuture< 5916 + tonic::Response<Self::Response>, 5917 + tonic::Status, 5918 + >; 5044 5919 fn call( 5045 5920 &mut self, 5046 5921 request: tonic::Request<super::SetModifiedRequest>, ··· 5077 5952 "/rockbox.v1alpha1.PlaylistService/Start" => { 5078 5953 #[allow(non_camel_case_types)] 5079 5954 struct StartSvc<T: PlaylistService>(pub Arc<T>); 5080 - impl<T: PlaylistService> tonic::server::UnaryService<super::StartRequest> for StartSvc<T> { 5955 + impl< 5956 + T: PlaylistService, 5957 + > tonic::server::UnaryService<super::StartRequest> for StartSvc<T> { 5081 5958 type Response = super::StartResponse; 5082 - type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>; 5959 + type Future = BoxFuture< 5960 + tonic::Response<Self::Response>, 5961 + tonic::Status, 5962 + >; 5083 5963 fn call( 5084 5964 &mut self, 5085 5965 request: tonic::Request<super::StartRequest>, 5086 5966 ) -> Self::Future { 5087 5967 let inner = Arc::clone(&self.0); 5088 - let fut = 5089 - async move { <T as PlaylistService>::start(&inner, request).await }; 5968 + let fut = async move { 5969 + <T as PlaylistService>::start(&inner, request).await 5970 + }; 5090 5971 Box::pin(fut) 5091 5972 } 5092 5973 } ··· 5115 5996 "/rockbox.v1alpha1.PlaylistService/Sync" => { 5116 5997 #[allow(non_camel_case_types)] 5117 5998 struct SyncSvc<T: PlaylistService>(pub Arc<T>); 5118 - impl<T: PlaylistService> tonic::server::UnaryService<super::SyncRequest> for SyncSvc<T> { 5999 + impl< 6000 + T: PlaylistService, 6001 + > tonic::server::UnaryService<super::SyncRequest> for SyncSvc<T> { 5119 6002 type Response = super::SyncResponse; 5120 - type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>; 6003 + type Future = BoxFuture< 6004 + tonic::Response<Self::Response>, 6005 + tonic::Status, 6006 + >; 5121 6007 fn call( 5122 6008 &mut self, 5123 6009 request: tonic::Request<super::SyncRequest>, 5124 6010 ) -> Self::Future { 5125 6011 let inner = Arc::clone(&self.0); 5126 - let fut = 5127 - async move { <T as PlaylistService>::sync(&inner, request).await }; 6012 + let fut = async move { 6013 + <T as PlaylistService>::sync(&inner, request).await 6014 + }; 5128 6015 Box::pin(fut) 5129 6016 } 5130 6017 } ··· 5153 6040 "/rockbox.v1alpha1.PlaylistService/RemoveAllTracks" => { 5154 6041 #[allow(non_camel_case_types)] 5155 6042 struct RemoveAllTracksSvc<T: PlaylistService>(pub Arc<T>); 5156 - impl<T: PlaylistService> 5157 - tonic::server::UnaryService<super::RemoveAllTracksRequest> 5158 - for RemoveAllTracksSvc<T> 5159 - { 6043 + impl< 6044 + T: PlaylistService, 6045 + > tonic::server::UnaryService<super::RemoveAllTracksRequest> 6046 + for RemoveAllTracksSvc<T> { 5160 6047 type Response = super::RemoveAllTracksResponse; 5161 - type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>; 6048 + type Future = BoxFuture< 6049 + tonic::Response<Self::Response>, 6050 + tonic::Status, 6051 + >; 5162 6052 fn call( 5163 6053 &mut self, 5164 6054 request: tonic::Request<super::RemoveAllTracksRequest>, 5165 6055 ) -> Self::Future { 5166 6056 let inner = Arc::clone(&self.0); 5167 6057 let fut = async move { 5168 - <T as PlaylistService>::remove_all_tracks(&inner, request).await 6058 + <T as PlaylistService>::remove_all_tracks(&inner, request) 6059 + .await 5169 6060 }; 5170 6061 Box::pin(fut) 5171 6062 } ··· 5195 6086 "/rockbox.v1alpha1.PlaylistService/RemoveTracks" => { 5196 6087 #[allow(non_camel_case_types)] 5197 6088 struct RemoveTracksSvc<T: PlaylistService>(pub Arc<T>); 5198 - impl<T: PlaylistService> tonic::server::UnaryService<super::RemoveTracksRequest> 5199 - for RemoveTracksSvc<T> 5200 - { 6089 + impl< 6090 + T: PlaylistService, 6091 + > tonic::server::UnaryService<super::RemoveTracksRequest> 6092 + for RemoveTracksSvc<T> { 5201 6093 type Response = super::RemoveTracksResponse; 5202 - type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>; 6094 + type Future = BoxFuture< 6095 + tonic::Response<Self::Response>, 6096 + tonic::Status, 6097 + >; 5203 6098 fn call( 5204 6099 &mut self, 5205 6100 request: tonic::Request<super::RemoveTracksRequest>, ··· 5236 6131 "/rockbox.v1alpha1.PlaylistService/CreatePlaylist" => { 5237 6132 #[allow(non_camel_case_types)] 5238 6133 struct CreatePlaylistSvc<T: PlaylistService>(pub Arc<T>); 5239 - impl<T: PlaylistService> 5240 - tonic::server::UnaryService<super::CreatePlaylistRequest> 5241 - for CreatePlaylistSvc<T> 5242 - { 6134 + impl< 6135 + T: PlaylistService, 6136 + > tonic::server::UnaryService<super::CreatePlaylistRequest> 6137 + for CreatePlaylistSvc<T> { 5243 6138 type Response = super::CreatePlaylistResponse; 5244 - type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>; 6139 + type Future = BoxFuture< 6140 + tonic::Response<Self::Response>, 6141 + tonic::Status, 6142 + >; 5245 6143 fn call( 5246 6144 &mut self, 5247 6145 request: tonic::Request<super::CreatePlaylistRequest>, 5248 6146 ) -> Self::Future { 5249 6147 let inner = Arc::clone(&self.0); 5250 6148 let fut = async move { 5251 - <T as PlaylistService>::create_playlist(&inner, request).await 6149 + <T as PlaylistService>::create_playlist(&inner, request) 6150 + .await 5252 6151 }; 5253 6152 Box::pin(fut) 5254 6153 } ··· 5278 6177 "/rockbox.v1alpha1.PlaylistService/InsertTracks" => { 5279 6178 #[allow(non_camel_case_types)] 5280 6179 struct InsertTracksSvc<T: PlaylistService>(pub Arc<T>); 5281 - impl<T: PlaylistService> tonic::server::UnaryService<super::InsertTracksRequest> 5282 - for InsertTracksSvc<T> 5283 - { 6180 + impl< 6181 + T: PlaylistService, 6182 + > tonic::server::UnaryService<super::InsertTracksRequest> 6183 + for InsertTracksSvc<T> { 5284 6184 type Response = super::InsertTracksResponse; 5285 - type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>; 6185 + type Future = BoxFuture< 6186 + tonic::Response<Self::Response>, 6187 + tonic::Status, 6188 + >; 5286 6189 fn call( 5287 6190 &mut self, 5288 6191 request: tonic::Request<super::InsertTracksRequest>, ··· 5319 6222 "/rockbox.v1alpha1.PlaylistService/InsertDirectory" => { 5320 6223 #[allow(non_camel_case_types)] 5321 6224 struct InsertDirectorySvc<T: PlaylistService>(pub Arc<T>); 5322 - impl<T: PlaylistService> 5323 - tonic::server::UnaryService<super::InsertDirectoryRequest> 5324 - for InsertDirectorySvc<T> 5325 - { 6225 + impl< 6226 + T: PlaylistService, 6227 + > tonic::server::UnaryService<super::InsertDirectoryRequest> 6228 + for InsertDirectorySvc<T> { 5326 6229 type Response = super::InsertDirectoryResponse; 5327 - type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>; 6230 + type Future = BoxFuture< 6231 + tonic::Response<Self::Response>, 6232 + tonic::Status, 6233 + >; 5328 6234 fn call( 5329 6235 &mut self, 5330 6236 request: tonic::Request<super::InsertDirectoryRequest>, 5331 6237 ) -> Self::Future { 5332 6238 let inner = Arc::clone(&self.0); 5333 6239 let fut = async move { 5334 - <T as PlaylistService>::insert_directory(&inner, request).await 6240 + <T as PlaylistService>::insert_directory(&inner, request) 6241 + .await 5335 6242 }; 5336 6243 Box::pin(fut) 5337 6244 } ··· 5361 6268 "/rockbox.v1alpha1.PlaylistService/InsertPlaylist" => { 5362 6269 #[allow(non_camel_case_types)] 5363 6270 struct InsertPlaylistSvc<T: PlaylistService>(pub Arc<T>); 5364 - impl<T: PlaylistService> 5365 - tonic::server::UnaryService<super::InsertPlaylistRequest> 5366 - for InsertPlaylistSvc<T> 5367 - { 6271 + impl< 6272 + T: PlaylistService, 6273 + > tonic::server::UnaryService<super::InsertPlaylistRequest> 6274 + for InsertPlaylistSvc<T> { 5368 6275 type Response = super::InsertPlaylistResponse; 5369 - type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>; 6276 + type Future = BoxFuture< 6277 + tonic::Response<Self::Response>, 6278 + tonic::Status, 6279 + >; 5370 6280 fn call( 5371 6281 &mut self, 5372 6282 request: tonic::Request<super::InsertPlaylistRequest>, 5373 6283 ) -> Self::Future { 5374 6284 let inner = Arc::clone(&self.0); 5375 6285 let fut = async move { 5376 - <T as PlaylistService>::insert_playlist(&inner, request).await 6286 + <T as PlaylistService>::insert_playlist(&inner, request) 6287 + .await 5377 6288 }; 5378 6289 Box::pin(fut) 5379 6290 } ··· 5403 6314 "/rockbox.v1alpha1.PlaylistService/InsertAlbum" => { 5404 6315 #[allow(non_camel_case_types)] 5405 6316 struct InsertAlbumSvc<T: PlaylistService>(pub Arc<T>); 5406 - impl<T: PlaylistService> tonic::server::UnaryService<super::InsertAlbumRequest> 5407 - for InsertAlbumSvc<T> 5408 - { 6317 + impl< 6318 + T: PlaylistService, 6319 + > tonic::server::UnaryService<super::InsertAlbumRequest> 6320 + for InsertAlbumSvc<T> { 5409 6321 type Response = super::InsertAlbumResponse; 5410 - type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>; 6322 + type Future = BoxFuture< 6323 + tonic::Response<Self::Response>, 6324 + tonic::Status, 6325 + >; 5411 6326 fn call( 5412 6327 &mut self, 5413 6328 request: tonic::Request<super::InsertAlbumRequest>, ··· 5444 6359 "/rockbox.v1alpha1.PlaylistService/InsertArtistTracks" => { 5445 6360 #[allow(non_camel_case_types)] 5446 6361 struct InsertArtistTracksSvc<T: PlaylistService>(pub Arc<T>); 5447 - impl<T: PlaylistService> 5448 - tonic::server::UnaryService<super::InsertArtistTracksRequest> 5449 - for InsertArtistTracksSvc<T> 5450 - { 6362 + impl< 6363 + T: PlaylistService, 6364 + > tonic::server::UnaryService<super::InsertArtistTracksRequest> 6365 + for InsertArtistTracksSvc<T> { 5451 6366 type Response = super::InsertArtistTracksResponse; 5452 - type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>; 6367 + type Future = BoxFuture< 6368 + tonic::Response<Self::Response>, 6369 + tonic::Status, 6370 + >; 5453 6371 fn call( 5454 6372 &mut self, 5455 6373 request: tonic::Request<super::InsertArtistTracksRequest>, 5456 6374 ) -> Self::Future { 5457 6375 let inner = Arc::clone(&self.0); 5458 6376 let fut = async move { 5459 - <T as PlaylistService>::insert_artist_tracks(&inner, request).await 6377 + <T as PlaylistService>::insert_artist_tracks( 6378 + &inner, 6379 + request, 6380 + ) 6381 + .await 5460 6382 }; 5461 6383 Box::pin(fut) 5462 6384 } ··· 5486 6408 "/rockbox.v1alpha1.PlaylistService/ShufflePlaylist" => { 5487 6409 #[allow(non_camel_case_types)] 5488 6410 struct ShufflePlaylistSvc<T: PlaylistService>(pub Arc<T>); 5489 - impl<T: PlaylistService> 5490 - tonic::server::UnaryService<super::ShufflePlaylistRequest> 5491 - for ShufflePlaylistSvc<T> 5492 - { 6411 + impl< 6412 + T: PlaylistService, 6413 + > tonic::server::UnaryService<super::ShufflePlaylistRequest> 6414 + for ShufflePlaylistSvc<T> { 5493 6415 type Response = super::ShufflePlaylistResponse; 5494 - type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>; 6416 + type Future = BoxFuture< 6417 + tonic::Response<Self::Response>, 6418 + tonic::Status, 6419 + >; 5495 6420 fn call( 5496 6421 &mut self, 5497 6422 request: tonic::Request<super::ShufflePlaylistRequest>, 5498 6423 ) -> Self::Future { 5499 6424 let inner = Arc::clone(&self.0); 5500 6425 let fut = async move { 5501 - <T as PlaylistService>::shuffle_playlist(&inner, request).await 6426 + <T as PlaylistService>::shuffle_playlist(&inner, request) 6427 + .await 5502 6428 }; 5503 6429 Box::pin(fut) 5504 6430 } ··· 5525 6451 }; 5526 6452 Box::pin(fut) 5527 6453 } 5528 - _ => Box::pin(async move { 5529 - let mut response = http::Response::new(empty_body()); 5530 - let headers = response.headers_mut(); 5531 - headers.insert( 5532 - tonic::Status::GRPC_STATUS, 5533 - (tonic::Code::Unimplemented as i32).into(), 5534 - ); 5535 - headers.insert( 5536 - http::header::CONTENT_TYPE, 5537 - tonic::metadata::GRPC_CONTENT_TYPE, 5538 - ); 5539 - Ok(response) 5540 - }), 6454 + _ => { 6455 + Box::pin(async move { 6456 + let mut response = http::Response::new(empty_body()); 6457 + let headers = response.headers_mut(); 6458 + headers 6459 + .insert( 6460 + tonic::Status::GRPC_STATUS, 6461 + (tonic::Code::Unimplemented as i32).into(), 6462 + ); 6463 + headers 6464 + .insert( 6465 + http::header::CONTENT_TYPE, 6466 + tonic::metadata::GRPC_CONTENT_TYPE, 6467 + ); 6468 + Ok(response) 6469 + }) 6470 + } 5541 6471 } 5542 6472 } 5543 6473 } ··· 6047 6977 dead_code, 6048 6978 missing_docs, 6049 6979 clippy::wildcard_imports, 6050 - clippy::let_unit_value 6980 + clippy::let_unit_value, 6051 6981 )] 6052 - use tonic::codegen::http::Uri; 6053 6982 use tonic::codegen::*; 6983 + use tonic::codegen::http::Uri; 6054 6984 #[derive(Debug, Clone)] 6055 6985 pub struct SettingsServiceClient<T> { 6056 6986 inner: tonic::client::Grpc<T>, ··· 6094 7024 <T as tonic::client::GrpcService<tonic::body::BoxBody>>::ResponseBody, 6095 7025 >, 6096 7026 >, 6097 - <T as tonic::codegen::Service<http::Request<tonic::body::BoxBody>>>::Error: 6098 - Into<StdError> + std::marker::Send + std::marker::Sync, 7027 + <T as tonic::codegen::Service< 7028 + http::Request<tonic::body::BoxBody>, 7029 + >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync, 6099 7030 { 6100 7031 SettingsServiceClient::new(InterceptedService::new(inner, interceptor)) 6101 7032 } ··· 6133 7064 pub async fn get_settings_list( 6134 7065 &mut self, 6135 7066 request: impl tonic::IntoRequest<super::GetSettingsListRequest>, 6136 - ) -> std::result::Result<tonic::Response<super::GetSettingsListResponse>, tonic::Status> 6137 - { 6138 - self.inner.ready().await.map_err(|e| { 6139 - tonic::Status::unknown(format!("Service was not ready: {}", e.into())) 6140 - })?; 7067 + ) -> std::result::Result< 7068 + tonic::Response<super::GetSettingsListResponse>, 7069 + tonic::Status, 7070 + > { 7071 + self.inner 7072 + .ready() 7073 + .await 7074 + .map_err(|e| { 7075 + tonic::Status::unknown( 7076 + format!("Service was not ready: {}", e.into()), 7077 + ) 7078 + })?; 6141 7079 let codec = tonic::codec::ProstCodec::default(); 6142 7080 let path = http::uri::PathAndQuery::from_static( 6143 7081 "/rockbox.v1alpha1.SettingsService/GetSettingsList", 6144 7082 ); 6145 7083 let mut req = request.into_request(); 6146 - req.extensions_mut().insert(GrpcMethod::new( 6147 - "rockbox.v1alpha1.SettingsService", 6148 - "GetSettingsList", 6149 - )); 7084 + req.extensions_mut() 7085 + .insert( 7086 + GrpcMethod::new( 7087 + "rockbox.v1alpha1.SettingsService", 7088 + "GetSettingsList", 7089 + ), 7090 + ); 6150 7091 self.inner.unary(req, path, codec).await 6151 7092 } 6152 7093 pub async fn get_global_settings( 6153 7094 &mut self, 6154 7095 request: impl tonic::IntoRequest<super::GetGlobalSettingsRequest>, 6155 - ) -> std::result::Result<tonic::Response<super::GetGlobalSettingsResponse>, tonic::Status> 6156 - { 6157 - self.inner.ready().await.map_err(|e| { 6158 - tonic::Status::unknown(format!("Service was not ready: {}", e.into())) 6159 - })?; 7096 + ) -> std::result::Result< 7097 + tonic::Response<super::GetGlobalSettingsResponse>, 7098 + tonic::Status, 7099 + > { 7100 + self.inner 7101 + .ready() 7102 + .await 7103 + .map_err(|e| { 7104 + tonic::Status::unknown( 7105 + format!("Service was not ready: {}", e.into()), 7106 + ) 7107 + })?; 6160 7108 let codec = tonic::codec::ProstCodec::default(); 6161 7109 let path = http::uri::PathAndQuery::from_static( 6162 7110 "/rockbox.v1alpha1.SettingsService/GetGlobalSettings", 6163 7111 ); 6164 7112 let mut req = request.into_request(); 6165 - req.extensions_mut().insert(GrpcMethod::new( 6166 - "rockbox.v1alpha1.SettingsService", 6167 - "GetGlobalSettings", 6168 - )); 7113 + req.extensions_mut() 7114 + .insert( 7115 + GrpcMethod::new( 7116 + "rockbox.v1alpha1.SettingsService", 7117 + "GetGlobalSettings", 7118 + ), 7119 + ); 6169 7120 self.inner.unary(req, path, codec).await 6170 7121 } 6171 7122 pub async fn save_settings( 6172 7123 &mut self, 6173 7124 request: impl tonic::IntoRequest<super::SaveSettingsRequest>, 6174 - ) -> std::result::Result<tonic::Response<super::SaveSettingsResponse>, tonic::Status> 6175 - { 6176 - self.inner.ready().await.map_err(|e| { 6177 - tonic::Status::unknown(format!("Service was not ready: {}", e.into())) 6178 - })?; 7125 + ) -> std::result::Result< 7126 + tonic::Response<super::SaveSettingsResponse>, 7127 + tonic::Status, 7128 + > { 7129 + self.inner 7130 + .ready() 7131 + .await 7132 + .map_err(|e| { 7133 + tonic::Status::unknown( 7134 + format!("Service was not ready: {}", e.into()), 7135 + ) 7136 + })?; 6179 7137 let codec = tonic::codec::ProstCodec::default(); 6180 7138 let path = http::uri::PathAndQuery::from_static( 6181 7139 "/rockbox.v1alpha1.SettingsService/SaveSettings", 6182 7140 ); 6183 7141 let mut req = request.into_request(); 6184 - req.extensions_mut().insert(GrpcMethod::new( 6185 - "rockbox.v1alpha1.SettingsService", 6186 - "SaveSettings", 6187 - )); 7142 + req.extensions_mut() 7143 + .insert( 7144 + GrpcMethod::new("rockbox.v1alpha1.SettingsService", "SaveSettings"), 7145 + ); 6188 7146 self.inner.unary(req, path, codec).await 6189 7147 } 6190 7148 } ··· 6196 7154 dead_code, 6197 7155 missing_docs, 6198 7156 clippy::wildcard_imports, 6199 - clippy::let_unit_value 7157 + clippy::let_unit_value, 6200 7158 )] 6201 7159 use tonic::codegen::*; 6202 7160 /// Generated trait containing gRPC methods that should be implemented for use with SettingsServiceServer. ··· 6205 7163 async fn get_settings_list( 6206 7164 &self, 6207 7165 request: tonic::Request<super::GetSettingsListRequest>, 6208 - ) -> std::result::Result<tonic::Response<super::GetSettingsListResponse>, tonic::Status>; 7166 + ) -> std::result::Result< 7167 + tonic::Response<super::GetSettingsListResponse>, 7168 + tonic::Status, 7169 + >; 6209 7170 async fn get_global_settings( 6210 7171 &self, 6211 7172 request: tonic::Request<super::GetGlobalSettingsRequest>, 6212 - ) -> std::result::Result<tonic::Response<super::GetGlobalSettingsResponse>, tonic::Status>; 7173 + ) -> std::result::Result< 7174 + tonic::Response<super::GetGlobalSettingsResponse>, 7175 + tonic::Status, 7176 + >; 6213 7177 async fn save_settings( 6214 7178 &self, 6215 7179 request: tonic::Request<super::SaveSettingsRequest>, 6216 - ) -> std::result::Result<tonic::Response<super::SaveSettingsResponse>, tonic::Status>; 7180 + ) -> std::result::Result< 7181 + tonic::Response<super::SaveSettingsResponse>, 7182 + tonic::Status, 7183 + >; 6217 7184 } 6218 7185 #[derive(Debug)] 6219 7186 pub struct SettingsServiceServer<T> { ··· 6236 7203 max_encoding_message_size: None, 6237 7204 } 6238 7205 } 6239 - pub fn with_interceptor<F>(inner: T, interceptor: F) -> InterceptedService<Self, F> 7206 + pub fn with_interceptor<F>( 7207 + inner: T, 7208 + interceptor: F, 7209 + ) -> InterceptedService<Self, F> 6240 7210 where 6241 7211 F: tonic::service::Interceptor, 6242 7212 { ··· 6291 7261 "/rockbox.v1alpha1.SettingsService/GetSettingsList" => { 6292 7262 #[allow(non_camel_case_types)] 6293 7263 struct GetSettingsListSvc<T: SettingsService>(pub Arc<T>); 6294 - impl<T: SettingsService> 6295 - tonic::server::UnaryService<super::GetSettingsListRequest> 6296 - for GetSettingsListSvc<T> 6297 - { 7264 + impl< 7265 + T: SettingsService, 7266 + > tonic::server::UnaryService<super::GetSettingsListRequest> 7267 + for GetSettingsListSvc<T> { 6298 7268 type Response = super::GetSettingsListResponse; 6299 - type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>; 7269 + type Future = BoxFuture< 7270 + tonic::Response<Self::Response>, 7271 + tonic::Status, 7272 + >; 6300 7273 fn call( 6301 7274 &mut self, 6302 7275 request: tonic::Request<super::GetSettingsListRequest>, 6303 7276 ) -> Self::Future { 6304 7277 let inner = Arc::clone(&self.0); 6305 7278 let fut = async move { 6306 - <T as SettingsService>::get_settings_list(&inner, request).await 7279 + <T as SettingsService>::get_settings_list(&inner, request) 7280 + .await 6307 7281 }; 6308 7282 Box::pin(fut) 6309 7283 } ··· 6333 7307 "/rockbox.v1alpha1.SettingsService/GetGlobalSettings" => { 6334 7308 #[allow(non_camel_case_types)] 6335 7309 struct GetGlobalSettingsSvc<T: SettingsService>(pub Arc<T>); 6336 - impl<T: SettingsService> 6337 - tonic::server::UnaryService<super::GetGlobalSettingsRequest> 6338 - for GetGlobalSettingsSvc<T> 6339 - { 7310 + impl< 7311 + T: SettingsService, 7312 + > tonic::server::UnaryService<super::GetGlobalSettingsRequest> 7313 + for GetGlobalSettingsSvc<T> { 6340 7314 type Response = super::GetGlobalSettingsResponse; 6341 - type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>; 7315 + type Future = BoxFuture< 7316 + tonic::Response<Self::Response>, 7317 + tonic::Status, 7318 + >; 6342 7319 fn call( 6343 7320 &mut self, 6344 7321 request: tonic::Request<super::GetGlobalSettingsRequest>, 6345 7322 ) -> Self::Future { 6346 7323 let inner = Arc::clone(&self.0); 6347 7324 let fut = async move { 6348 - <T as SettingsService>::get_global_settings(&inner, request).await 7325 + <T as SettingsService>::get_global_settings(&inner, request) 7326 + .await 6349 7327 }; 6350 7328 Box::pin(fut) 6351 7329 } ··· 6375 7353 "/rockbox.v1alpha1.SettingsService/SaveSettings" => { 6376 7354 #[allow(non_camel_case_types)] 6377 7355 struct SaveSettingsSvc<T: SettingsService>(pub Arc<T>); 6378 - impl<T: SettingsService> tonic::server::UnaryService<super::SaveSettingsRequest> 6379 - for SaveSettingsSvc<T> 6380 - { 7356 + impl< 7357 + T: SettingsService, 7358 + > tonic::server::UnaryService<super::SaveSettingsRequest> 7359 + for SaveSettingsSvc<T> { 6381 7360 type Response = super::SaveSettingsResponse; 6382 - type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>; 7361 + type Future = BoxFuture< 7362 + tonic::Response<Self::Response>, 7363 + tonic::Status, 7364 + >; 6383 7365 fn call( 6384 7366 &mut self, 6385 7367 request: tonic::Request<super::SaveSettingsRequest>, ··· 6413 7395 }; 6414 7396 Box::pin(fut) 6415 7397 } 6416 - _ => Box::pin(async move { 6417 - let mut response = http::Response::new(empty_body()); 6418 - let headers = response.headers_mut(); 6419 - headers.insert( 6420 - tonic::Status::GRPC_STATUS, 6421 - (tonic::Code::Unimplemented as i32).into(), 6422 - ); 6423 - headers.insert( 6424 - http::header::CONTENT_TYPE, 6425 - tonic::metadata::GRPC_CONTENT_TYPE, 6426 - ); 6427 - Ok(response) 6428 - }), 7398 + _ => { 7399 + Box::pin(async move { 7400 + let mut response = http::Response::new(empty_body()); 7401 + let headers = response.headers_mut(); 7402 + headers 7403 + .insert( 7404 + tonic::Status::GRPC_STATUS, 7405 + (tonic::Code::Unimplemented as i32).into(), 7406 + ); 7407 + headers 7408 + .insert( 7409 + http::header::CONTENT_TYPE, 7410 + tonic::metadata::GRPC_CONTENT_TYPE, 7411 + ); 7412 + Ok(response) 7413 + }) 7414 + } 6429 7415 } 6430 7416 } 6431 7417 } ··· 6583 7569 dead_code, 6584 7570 missing_docs, 6585 7571 clippy::wildcard_imports, 6586 - clippy::let_unit_value 7572 + clippy::let_unit_value, 6587 7573 )] 6588 - use tonic::codegen::http::Uri; 6589 7574 use tonic::codegen::*; 7575 + use tonic::codegen::http::Uri; 6590 7576 #[derive(Debug, Clone)] 6591 7577 pub struct SoundServiceClient<T> { 6592 7578 inner: tonic::client::Grpc<T>, ··· 6630 7616 <T as tonic::client::GrpcService<tonic::body::BoxBody>>::ResponseBody, 6631 7617 >, 6632 7618 >, 6633 - <T as tonic::codegen::Service<http::Request<tonic::body::BoxBody>>>::Error: 6634 - Into<StdError> + std::marker::Send + std::marker::Sync, 7619 + <T as tonic::codegen::Service< 7620 + http::Request<tonic::body::BoxBody>, 7621 + >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync, 6635 7622 { 6636 7623 SoundServiceClient::new(InterceptedService::new(inner, interceptor)) 6637 7624 } ··· 6669 7656 pub async fn adjust_volume( 6670 7657 &mut self, 6671 7658 request: impl tonic::IntoRequest<super::AdjustVolumeRequest>, 6672 - ) -> std::result::Result<tonic::Response<super::AdjustVolumeResponse>, tonic::Status> 6673 - { 6674 - self.inner.ready().await.map_err(|e| { 6675 - tonic::Status::unknown(format!("Service was not ready: {}", e.into())) 6676 - })?; 7659 + ) -> std::result::Result< 7660 + tonic::Response<super::AdjustVolumeResponse>, 7661 + tonic::Status, 7662 + > { 7663 + self.inner 7664 + .ready() 7665 + .await 7666 + .map_err(|e| { 7667 + tonic::Status::unknown( 7668 + format!("Service was not ready: {}", e.into()), 7669 + ) 7670 + })?; 6677 7671 let codec = tonic::codec::ProstCodec::default(); 6678 - let path = 6679 - http::uri::PathAndQuery::from_static("/rockbox.v1alpha1.SoundService/AdjustVolume"); 7672 + let path = http::uri::PathAndQuery::from_static( 7673 + "/rockbox.v1alpha1.SoundService/AdjustVolume", 7674 + ); 6680 7675 let mut req = request.into_request(); 6681 - req.extensions_mut().insert(GrpcMethod::new( 6682 - "rockbox.v1alpha1.SoundService", 6683 - "AdjustVolume", 6684 - )); 7676 + req.extensions_mut() 7677 + .insert( 7678 + GrpcMethod::new("rockbox.v1alpha1.SoundService", "AdjustVolume"), 7679 + ); 6685 7680 self.inner.unary(req, path, codec).await 6686 7681 } 6687 7682 pub async fn sound_set( 6688 7683 &mut self, 6689 7684 request: impl tonic::IntoRequest<super::SoundSetRequest>, 6690 - ) -> std::result::Result<tonic::Response<super::SoundSetResponse>, tonic::Status> { 6691 - self.inner.ready().await.map_err(|e| { 6692 - tonic::Status::unknown(format!("Service was not ready: {}", e.into())) 6693 - })?; 7685 + ) -> std::result::Result< 7686 + tonic::Response<super::SoundSetResponse>, 7687 + tonic::Status, 7688 + > { 7689 + self.inner 7690 + .ready() 7691 + .await 7692 + .map_err(|e| { 7693 + tonic::Status::unknown( 7694 + format!("Service was not ready: {}", e.into()), 7695 + ) 7696 + })?; 6694 7697 let codec = tonic::codec::ProstCodec::default(); 6695 - let path = 6696 - http::uri::PathAndQuery::from_static("/rockbox.v1alpha1.SoundService/SoundSet"); 7698 + let path = http::uri::PathAndQuery::from_static( 7699 + "/rockbox.v1alpha1.SoundService/SoundSet", 7700 + ); 6697 7701 let mut req = request.into_request(); 6698 7702 req.extensions_mut() 6699 7703 .insert(GrpcMethod::new("rockbox.v1alpha1.SoundService", "SoundSet")); ··· 6702 7706 pub async fn sound_current( 6703 7707 &mut self, 6704 7708 request: impl tonic::IntoRequest<super::SoundCurrentRequest>, 6705 - ) -> std::result::Result<tonic::Response<super::SoundCurrentResponse>, tonic::Status> 6706 - { 6707 - self.inner.ready().await.map_err(|e| { 6708 - tonic::Status::unknown(format!("Service was not ready: {}", e.into())) 6709 - })?; 7709 + ) -> std::result::Result< 7710 + tonic::Response<super::SoundCurrentResponse>, 7711 + tonic::Status, 7712 + > { 7713 + self.inner 7714 + .ready() 7715 + .await 7716 + .map_err(|e| { 7717 + tonic::Status::unknown( 7718 + format!("Service was not ready: {}", e.into()), 7719 + ) 7720 + })?; 6710 7721 let codec = tonic::codec::ProstCodec::default(); 6711 - let path = 6712 - http::uri::PathAndQuery::from_static("/rockbox.v1alpha1.SoundService/SoundCurrent"); 7722 + let path = http::uri::PathAndQuery::from_static( 7723 + "/rockbox.v1alpha1.SoundService/SoundCurrent", 7724 + ); 6713 7725 let mut req = request.into_request(); 6714 - req.extensions_mut().insert(GrpcMethod::new( 6715 - "rockbox.v1alpha1.SoundService", 6716 - "SoundCurrent", 6717 - )); 7726 + req.extensions_mut() 7727 + .insert( 7728 + GrpcMethod::new("rockbox.v1alpha1.SoundService", "SoundCurrent"), 7729 + ); 6718 7730 self.inner.unary(req, path, codec).await 6719 7731 } 6720 7732 pub async fn sound_default( 6721 7733 &mut self, 6722 7734 request: impl tonic::IntoRequest<super::SoundDefaultRequest>, 6723 - ) -> std::result::Result<tonic::Response<super::SoundDefaultResponse>, tonic::Status> 6724 - { 6725 - self.inner.ready().await.map_err(|e| { 6726 - tonic::Status::unknown(format!("Service was not ready: {}", e.into())) 6727 - })?; 7735 + ) -> std::result::Result< 7736 + tonic::Response<super::SoundDefaultResponse>, 7737 + tonic::Status, 7738 + > { 7739 + self.inner 7740 + .ready() 7741 + .await 7742 + .map_err(|e| { 7743 + tonic::Status::unknown( 7744 + format!("Service was not ready: {}", e.into()), 7745 + ) 7746 + })?; 6728 7747 let codec = tonic::codec::ProstCodec::default(); 6729 - let path = 6730 - http::uri::PathAndQuery::from_static("/rockbox.v1alpha1.SoundService/SoundDefault"); 7748 + let path = http::uri::PathAndQuery::from_static( 7749 + "/rockbox.v1alpha1.SoundService/SoundDefault", 7750 + ); 6731 7751 let mut req = request.into_request(); 6732 - req.extensions_mut().insert(GrpcMethod::new( 6733 - "rockbox.v1alpha1.SoundService", 6734 - "SoundDefault", 6735 - )); 7752 + req.extensions_mut() 7753 + .insert( 7754 + GrpcMethod::new("rockbox.v1alpha1.SoundService", "SoundDefault"), 7755 + ); 6736 7756 self.inner.unary(req, path, codec).await 6737 7757 } 6738 7758 pub async fn sound_min( 6739 7759 &mut self, 6740 7760 request: impl tonic::IntoRequest<super::SoundMinRequest>, 6741 - ) -> std::result::Result<tonic::Response<super::SoundMinResponse>, tonic::Status> { 6742 - self.inner.ready().await.map_err(|e| { 6743 - tonic::Status::unknown(format!("Service was not ready: {}", e.into())) 6744 - })?; 7761 + ) -> std::result::Result< 7762 + tonic::Response<super::SoundMinResponse>, 7763 + tonic::Status, 7764 + > { 7765 + self.inner 7766 + .ready() 7767 + .await 7768 + .map_err(|e| { 7769 + tonic::Status::unknown( 7770 + format!("Service was not ready: {}", e.into()), 7771 + ) 7772 + })?; 6745 7773 let codec = tonic::codec::ProstCodec::default(); 6746 - let path = 6747 - http::uri::PathAndQuery::from_static("/rockbox.v1alpha1.SoundService/SoundMin"); 7774 + let path = http::uri::PathAndQuery::from_static( 7775 + "/rockbox.v1alpha1.SoundService/SoundMin", 7776 + ); 6748 7777 let mut req = request.into_request(); 6749 7778 req.extensions_mut() 6750 7779 .insert(GrpcMethod::new("rockbox.v1alpha1.SoundService", "SoundMin")); ··· 6753 7782 pub async fn sound_max( 6754 7783 &mut self, 6755 7784 request: impl tonic::IntoRequest<super::SoundMaxRequest>, 6756 - ) -> std::result::Result<tonic::Response<super::SoundMaxResponse>, tonic::Status> { 6757 - self.inner.ready().await.map_err(|e| { 6758 - tonic::Status::unknown(format!("Service was not ready: {}", e.into())) 6759 - })?; 7785 + ) -> std::result::Result< 7786 + tonic::Response<super::SoundMaxResponse>, 7787 + tonic::Status, 7788 + > { 7789 + self.inner 7790 + .ready() 7791 + .await 7792 + .map_err(|e| { 7793 + tonic::Status::unknown( 7794 + format!("Service was not ready: {}", e.into()), 7795 + ) 7796 + })?; 6760 7797 let codec = tonic::codec::ProstCodec::default(); 6761 - let path = 6762 - http::uri::PathAndQuery::from_static("/rockbox.v1alpha1.SoundService/SoundMax"); 7798 + let path = http::uri::PathAndQuery::from_static( 7799 + "/rockbox.v1alpha1.SoundService/SoundMax", 7800 + ); 6763 7801 let mut req = request.into_request(); 6764 7802 req.extensions_mut() 6765 7803 .insert(GrpcMethod::new("rockbox.v1alpha1.SoundService", "SoundMax")); ··· 6768 7806 pub async fn sound_unit( 6769 7807 &mut self, 6770 7808 request: impl tonic::IntoRequest<super::SoundUnitRequest>, 6771 - ) -> std::result::Result<tonic::Response<super::SoundUnitResponse>, tonic::Status> { 6772 - self.inner.ready().await.map_err(|e| { 6773 - tonic::Status::unknown(format!("Service was not ready: {}", e.into())) 6774 - })?; 7809 + ) -> std::result::Result< 7810 + tonic::Response<super::SoundUnitResponse>, 7811 + tonic::Status, 7812 + > { 7813 + self.inner 7814 + .ready() 7815 + .await 7816 + .map_err(|e| { 7817 + tonic::Status::unknown( 7818 + format!("Service was not ready: {}", e.into()), 7819 + ) 7820 + })?; 6775 7821 let codec = tonic::codec::ProstCodec::default(); 6776 - let path = 6777 - http::uri::PathAndQuery::from_static("/rockbox.v1alpha1.SoundService/SoundUnit"); 7822 + let path = http::uri::PathAndQuery::from_static( 7823 + "/rockbox.v1alpha1.SoundService/SoundUnit", 7824 + ); 6778 7825 let mut req = request.into_request(); 6779 - req.extensions_mut().insert(GrpcMethod::new( 6780 - "rockbox.v1alpha1.SoundService", 6781 - "SoundUnit", 6782 - )); 7826 + req.extensions_mut() 7827 + .insert(GrpcMethod::new("rockbox.v1alpha1.SoundService", "SoundUnit")); 6783 7828 self.inner.unary(req, path, codec).await 6784 7829 } 6785 7830 pub async fn sound_val2_phys( 6786 7831 &mut self, 6787 7832 request: impl tonic::IntoRequest<super::SoundVal2PhysRequest>, 6788 - ) -> std::result::Result<tonic::Response<super::SoundVal2PhysResponse>, tonic::Status> 6789 - { 6790 - self.inner.ready().await.map_err(|e| { 6791 - tonic::Status::unknown(format!("Service was not ready: {}", e.into())) 6792 - })?; 7833 + ) -> std::result::Result< 7834 + tonic::Response<super::SoundVal2PhysResponse>, 7835 + tonic::Status, 7836 + > { 7837 + self.inner 7838 + .ready() 7839 + .await 7840 + .map_err(|e| { 7841 + tonic::Status::unknown( 7842 + format!("Service was not ready: {}", e.into()), 7843 + ) 7844 + })?; 6793 7845 let codec = tonic::codec::ProstCodec::default(); 6794 7846 let path = http::uri::PathAndQuery::from_static( 6795 7847 "/rockbox.v1alpha1.SoundService/SoundVal2Phys", 6796 7848 ); 6797 7849 let mut req = request.into_request(); 6798 - req.extensions_mut().insert(GrpcMethod::new( 6799 - "rockbox.v1alpha1.SoundService", 6800 - "SoundVal2Phys", 6801 - )); 7850 + req.extensions_mut() 7851 + .insert( 7852 + GrpcMethod::new("rockbox.v1alpha1.SoundService", "SoundVal2Phys"), 7853 + ); 6802 7854 self.inner.unary(req, path, codec).await 6803 7855 } 6804 7856 pub async fn get_pitch( 6805 7857 &mut self, 6806 7858 request: impl tonic::IntoRequest<super::GetPitchRequest>, 6807 - ) -> std::result::Result<tonic::Response<super::GetPitchResponse>, tonic::Status> { 6808 - self.inner.ready().await.map_err(|e| { 6809 - tonic::Status::unknown(format!("Service was not ready: {}", e.into())) 6810 - })?; 7859 + ) -> std::result::Result< 7860 + tonic::Response<super::GetPitchResponse>, 7861 + tonic::Status, 7862 + > { 7863 + self.inner 7864 + .ready() 7865 + .await 7866 + .map_err(|e| { 7867 + tonic::Status::unknown( 7868 + format!("Service was not ready: {}", e.into()), 7869 + ) 7870 + })?; 6811 7871 let codec = tonic::codec::ProstCodec::default(); 6812 - let path = 6813 - http::uri::PathAndQuery::from_static("/rockbox.v1alpha1.SoundService/GetPitch"); 7872 + let path = http::uri::PathAndQuery::from_static( 7873 + "/rockbox.v1alpha1.SoundService/GetPitch", 7874 + ); 6814 7875 let mut req = request.into_request(); 6815 7876 req.extensions_mut() 6816 7877 .insert(GrpcMethod::new("rockbox.v1alpha1.SoundService", "GetPitch")); ··· 6819 7880 pub async fn set_pitch( 6820 7881 &mut self, 6821 7882 request: impl tonic::IntoRequest<super::SetPitchRequest>, 6822 - ) -> std::result::Result<tonic::Response<super::SetPitchResponse>, tonic::Status> { 6823 - self.inner.ready().await.map_err(|e| { 6824 - tonic::Status::unknown(format!("Service was not ready: {}", e.into())) 6825 - })?; 7883 + ) -> std::result::Result< 7884 + tonic::Response<super::SetPitchResponse>, 7885 + tonic::Status, 7886 + > { 7887 + self.inner 7888 + .ready() 7889 + .await 7890 + .map_err(|e| { 7891 + tonic::Status::unknown( 7892 + format!("Service was not ready: {}", e.into()), 7893 + ) 7894 + })?; 6826 7895 let codec = tonic::codec::ProstCodec::default(); 6827 - let path = 6828 - http::uri::PathAndQuery::from_static("/rockbox.v1alpha1.SoundService/SetPitch"); 7896 + let path = http::uri::PathAndQuery::from_static( 7897 + "/rockbox.v1alpha1.SoundService/SetPitch", 7898 + ); 6829 7899 let mut req = request.into_request(); 6830 7900 req.extensions_mut() 6831 7901 .insert(GrpcMethod::new("rockbox.v1alpha1.SoundService", "SetPitch")); ··· 6834 7904 pub async fn beep_play( 6835 7905 &mut self, 6836 7906 request: impl tonic::IntoRequest<super::BeepPlayRequest>, 6837 - ) -> std::result::Result<tonic::Response<super::BeepPlayResponse>, tonic::Status> { 6838 - self.inner.ready().await.map_err(|e| { 6839 - tonic::Status::unknown(format!("Service was not ready: {}", e.into())) 6840 - })?; 7907 + ) -> std::result::Result< 7908 + tonic::Response<super::BeepPlayResponse>, 7909 + tonic::Status, 7910 + > { 7911 + self.inner 7912 + .ready() 7913 + .await 7914 + .map_err(|e| { 7915 + tonic::Status::unknown( 7916 + format!("Service was not ready: {}", e.into()), 7917 + ) 7918 + })?; 6841 7919 let codec = tonic::codec::ProstCodec::default(); 6842 - let path = 6843 - http::uri::PathAndQuery::from_static("/rockbox.v1alpha1.SoundService/BeepPlay"); 7920 + let path = http::uri::PathAndQuery::from_static( 7921 + "/rockbox.v1alpha1.SoundService/BeepPlay", 7922 + ); 6844 7923 let mut req = request.into_request(); 6845 7924 req.extensions_mut() 6846 7925 .insert(GrpcMethod::new("rockbox.v1alpha1.SoundService", "BeepPlay")); ··· 6849 7928 pub async fn pcmbuf_fade( 6850 7929 &mut self, 6851 7930 request: impl tonic::IntoRequest<super::PcmbufFadeRequest>, 6852 - ) -> std::result::Result<tonic::Response<super::PcmbufFadeResponse>, tonic::Status> 6853 - { 6854 - self.inner.ready().await.map_err(|e| { 6855 - tonic::Status::unknown(format!("Service was not ready: {}", e.into())) 6856 - })?; 7931 + ) -> std::result::Result< 7932 + tonic::Response<super::PcmbufFadeResponse>, 7933 + tonic::Status, 7934 + > { 7935 + self.inner 7936 + .ready() 7937 + .await 7938 + .map_err(|e| { 7939 + tonic::Status::unknown( 7940 + format!("Service was not ready: {}", e.into()), 7941 + ) 7942 + })?; 6857 7943 let codec = tonic::codec::ProstCodec::default(); 6858 - let path = 6859 - http::uri::PathAndQuery::from_static("/rockbox.v1alpha1.SoundService/PcmbufFade"); 7944 + let path = http::uri::PathAndQuery::from_static( 7945 + "/rockbox.v1alpha1.SoundService/PcmbufFade", 7946 + ); 6860 7947 let mut req = request.into_request(); 6861 - req.extensions_mut().insert(GrpcMethod::new( 6862 - "rockbox.v1alpha1.SoundService", 6863 - "PcmbufFade", 6864 - )); 7948 + req.extensions_mut() 7949 + .insert(GrpcMethod::new("rockbox.v1alpha1.SoundService", "PcmbufFade")); 6865 7950 self.inner.unary(req, path, codec).await 6866 7951 } 6867 7952 pub async fn pcmbuf_set_low_latency( 6868 7953 &mut self, 6869 7954 request: impl tonic::IntoRequest<super::PcmbufSetLowLatencyRequest>, 6870 - ) -> std::result::Result<tonic::Response<super::PcmbufSetLowLatencyResponse>, tonic::Status> 6871 - { 6872 - self.inner.ready().await.map_err(|e| { 6873 - tonic::Status::unknown(format!("Service was not ready: {}", e.into())) 6874 - })?; 7955 + ) -> std::result::Result< 7956 + tonic::Response<super::PcmbufSetLowLatencyResponse>, 7957 + tonic::Status, 7958 + > { 7959 + self.inner 7960 + .ready() 7961 + .await 7962 + .map_err(|e| { 7963 + tonic::Status::unknown( 7964 + format!("Service was not ready: {}", e.into()), 7965 + ) 7966 + })?; 6875 7967 let codec = tonic::codec::ProstCodec::default(); 6876 7968 let path = http::uri::PathAndQuery::from_static( 6877 7969 "/rockbox.v1alpha1.SoundService/PcmbufSetLowLatency", 6878 7970 ); 6879 7971 let mut req = request.into_request(); 6880 - req.extensions_mut().insert(GrpcMethod::new( 6881 - "rockbox.v1alpha1.SoundService", 6882 - "PcmbufSetLowLatency", 6883 - )); 7972 + req.extensions_mut() 7973 + .insert( 7974 + GrpcMethod::new( 7975 + "rockbox.v1alpha1.SoundService", 7976 + "PcmbufSetLowLatency", 7977 + ), 7978 + ); 6884 7979 self.inner.unary(req, path, codec).await 6885 7980 } 6886 7981 pub async fn system_sound_play( 6887 7982 &mut self, 6888 7983 request: impl tonic::IntoRequest<super::SystemSoundPlayRequest>, 6889 - ) -> std::result::Result<tonic::Response<super::SystemSoundPlayResponse>, tonic::Status> 6890 - { 6891 - self.inner.ready().await.map_err(|e| { 6892 - tonic::Status::unknown(format!("Service was not ready: {}", e.into())) 6893 - })?; 7984 + ) -> std::result::Result< 7985 + tonic::Response<super::SystemSoundPlayResponse>, 7986 + tonic::Status, 7987 + > { 7988 + self.inner 7989 + .ready() 7990 + .await 7991 + .map_err(|e| { 7992 + tonic::Status::unknown( 7993 + format!("Service was not ready: {}", e.into()), 7994 + ) 7995 + })?; 6894 7996 let codec = tonic::codec::ProstCodec::default(); 6895 7997 let path = http::uri::PathAndQuery::from_static( 6896 7998 "/rockbox.v1alpha1.SoundService/SystemSoundPlay", 6897 7999 ); 6898 8000 let mut req = request.into_request(); 6899 - req.extensions_mut().insert(GrpcMethod::new( 6900 - "rockbox.v1alpha1.SoundService", 6901 - "SystemSoundPlay", 6902 - )); 8001 + req.extensions_mut() 8002 + .insert( 8003 + GrpcMethod::new("rockbox.v1alpha1.SoundService", "SystemSoundPlay"), 8004 + ); 6903 8005 self.inner.unary(req, path, codec).await 6904 8006 } 6905 8007 pub async fn keyclick_click( 6906 8008 &mut self, 6907 8009 request: impl tonic::IntoRequest<super::KeyclickClickRequest>, 6908 - ) -> std::result::Result<tonic::Response<super::KeyclickClickResponse>, tonic::Status> 6909 - { 6910 - self.inner.ready().await.map_err(|e| { 6911 - tonic::Status::unknown(format!("Service was not ready: {}", e.into())) 6912 - })?; 8010 + ) -> std::result::Result< 8011 + tonic::Response<super::KeyclickClickResponse>, 8012 + tonic::Status, 8013 + > { 8014 + self.inner 8015 + .ready() 8016 + .await 8017 + .map_err(|e| { 8018 + tonic::Status::unknown( 8019 + format!("Service was not ready: {}", e.into()), 8020 + ) 8021 + })?; 6913 8022 let codec = tonic::codec::ProstCodec::default(); 6914 8023 let path = http::uri::PathAndQuery::from_static( 6915 8024 "/rockbox.v1alpha1.SoundService/KeyclickClick", 6916 8025 ); 6917 8026 let mut req = request.into_request(); 6918 - req.extensions_mut().insert(GrpcMethod::new( 6919 - "rockbox.v1alpha1.SoundService", 6920 - "KeyclickClick", 6921 - )); 8027 + req.extensions_mut() 8028 + .insert( 8029 + GrpcMethod::new("rockbox.v1alpha1.SoundService", "KeyclickClick"), 8030 + ); 6922 8031 self.inner.unary(req, path, codec).await 6923 8032 } 6924 8033 } ··· 6930 8039 dead_code, 6931 8040 missing_docs, 6932 8041 clippy::wildcard_imports, 6933 - clippy::let_unit_value 8042 + clippy::let_unit_value, 6934 8043 )] 6935 8044 use tonic::codegen::*; 6936 8045 /// Generated trait containing gRPC methods that should be implemented for use with SoundServiceServer. ··· 6939 8048 async fn adjust_volume( 6940 8049 &self, 6941 8050 request: tonic::Request<super::AdjustVolumeRequest>, 6942 - ) -> std::result::Result<tonic::Response<super::AdjustVolumeResponse>, tonic::Status>; 8051 + ) -> std::result::Result< 8052 + tonic::Response<super::AdjustVolumeResponse>, 8053 + tonic::Status, 8054 + >; 6943 8055 async fn sound_set( 6944 8056 &self, 6945 8057 request: tonic::Request<super::SoundSetRequest>, 6946 - ) -> std::result::Result<tonic::Response<super::SoundSetResponse>, tonic::Status>; 8058 + ) -> std::result::Result< 8059 + tonic::Response<super::SoundSetResponse>, 8060 + tonic::Status, 8061 + >; 6947 8062 async fn sound_current( 6948 8063 &self, 6949 8064 request: tonic::Request<super::SoundCurrentRequest>, 6950 - ) -> std::result::Result<tonic::Response<super::SoundCurrentResponse>, tonic::Status>; 8065 + ) -> std::result::Result< 8066 + tonic::Response<super::SoundCurrentResponse>, 8067 + tonic::Status, 8068 + >; 6951 8069 async fn sound_default( 6952 8070 &self, 6953 8071 request: tonic::Request<super::SoundDefaultRequest>, 6954 - ) -> std::result::Result<tonic::Response<super::SoundDefaultResponse>, tonic::Status>; 8072 + ) -> std::result::Result< 8073 + tonic::Response<super::SoundDefaultResponse>, 8074 + tonic::Status, 8075 + >; 6955 8076 async fn sound_min( 6956 8077 &self, 6957 8078 request: tonic::Request<super::SoundMinRequest>, 6958 - ) -> std::result::Result<tonic::Response<super::SoundMinResponse>, tonic::Status>; 8079 + ) -> std::result::Result< 8080 + tonic::Response<super::SoundMinResponse>, 8081 + tonic::Status, 8082 + >; 6959 8083 async fn sound_max( 6960 8084 &self, 6961 8085 request: tonic::Request<super::SoundMaxRequest>, 6962 - ) -> std::result::Result<tonic::Response<super::SoundMaxResponse>, tonic::Status>; 8086 + ) -> std::result::Result< 8087 + tonic::Response<super::SoundMaxResponse>, 8088 + tonic::Status, 8089 + >; 6963 8090 async fn sound_unit( 6964 8091 &self, 6965 8092 request: tonic::Request<super::SoundUnitRequest>, 6966 - ) -> std::result::Result<tonic::Response<super::SoundUnitResponse>, tonic::Status>; 8093 + ) -> std::result::Result< 8094 + tonic::Response<super::SoundUnitResponse>, 8095 + tonic::Status, 8096 + >; 6967 8097 async fn sound_val2_phys( 6968 8098 &self, 6969 8099 request: tonic::Request<super::SoundVal2PhysRequest>, 6970 - ) -> std::result::Result<tonic::Response<super::SoundVal2PhysResponse>, tonic::Status>; 8100 + ) -> std::result::Result< 8101 + tonic::Response<super::SoundVal2PhysResponse>, 8102 + tonic::Status, 8103 + >; 6971 8104 async fn get_pitch( 6972 8105 &self, 6973 8106 request: tonic::Request<super::GetPitchRequest>, 6974 - ) -> std::result::Result<tonic::Response<super::GetPitchResponse>, tonic::Status>; 8107 + ) -> std::result::Result< 8108 + tonic::Response<super::GetPitchResponse>, 8109 + tonic::Status, 8110 + >; 6975 8111 async fn set_pitch( 6976 8112 &self, 6977 8113 request: tonic::Request<super::SetPitchRequest>, 6978 - ) -> std::result::Result<tonic::Response<super::SetPitchResponse>, tonic::Status>; 8114 + ) -> std::result::Result< 8115 + tonic::Response<super::SetPitchResponse>, 8116 + tonic::Status, 8117 + >; 6979 8118 async fn beep_play( 6980 8119 &self, 6981 8120 request: tonic::Request<super::BeepPlayRequest>, 6982 - ) -> std::result::Result<tonic::Response<super::BeepPlayResponse>, tonic::Status>; 8121 + ) -> std::result::Result< 8122 + tonic::Response<super::BeepPlayResponse>, 8123 + tonic::Status, 8124 + >; 6983 8125 async fn pcmbuf_fade( 6984 8126 &self, 6985 8127 request: tonic::Request<super::PcmbufFadeRequest>, 6986 - ) -> std::result::Result<tonic::Response<super::PcmbufFadeResponse>, tonic::Status>; 8128 + ) -> std::result::Result< 8129 + tonic::Response<super::PcmbufFadeResponse>, 8130 + tonic::Status, 8131 + >; 6987 8132 async fn pcmbuf_set_low_latency( 6988 8133 &self, 6989 8134 request: tonic::Request<super::PcmbufSetLowLatencyRequest>, 6990 - ) -> std::result::Result<tonic::Response<super::PcmbufSetLowLatencyResponse>, tonic::Status>; 8135 + ) -> std::result::Result< 8136 + tonic::Response<super::PcmbufSetLowLatencyResponse>, 8137 + tonic::Status, 8138 + >; 6991 8139 async fn system_sound_play( 6992 8140 &self, 6993 8141 request: tonic::Request<super::SystemSoundPlayRequest>, 6994 - ) -> std::result::Result<tonic::Response<super::SystemSoundPlayResponse>, tonic::Status>; 8142 + ) -> std::result::Result< 8143 + tonic::Response<super::SystemSoundPlayResponse>, 8144 + tonic::Status, 8145 + >; 6995 8146 async fn keyclick_click( 6996 8147 &self, 6997 8148 request: tonic::Request<super::KeyclickClickRequest>, 6998 - ) -> std::result::Result<tonic::Response<super::KeyclickClickResponse>, tonic::Status>; 8149 + ) -> std::result::Result< 8150 + tonic::Response<super::KeyclickClickResponse>, 8151 + tonic::Status, 8152 + >; 6999 8153 } 7000 8154 #[derive(Debug)] 7001 8155 pub struct SoundServiceServer<T> { ··· 7018 8172 max_encoding_message_size: None, 7019 8173 } 7020 8174 } 7021 - pub fn with_interceptor<F>(inner: T, interceptor: F) -> InterceptedService<Self, F> 8175 + pub fn with_interceptor<F>( 8176 + inner: T, 8177 + interceptor: F, 8178 + ) -> InterceptedService<Self, F> 7022 8179 where 7023 8180 F: tonic::service::Interceptor, 7024 8181 { ··· 7073 8230 "/rockbox.v1alpha1.SoundService/AdjustVolume" => { 7074 8231 #[allow(non_camel_case_types)] 7075 8232 struct AdjustVolumeSvc<T: SoundService>(pub Arc<T>); 7076 - impl<T: SoundService> tonic::server::UnaryService<super::AdjustVolumeRequest> 7077 - for AdjustVolumeSvc<T> 7078 - { 8233 + impl< 8234 + T: SoundService, 8235 + > tonic::server::UnaryService<super::AdjustVolumeRequest> 8236 + for AdjustVolumeSvc<T> { 7079 8237 type Response = super::AdjustVolumeResponse; 7080 - type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>; 8238 + type Future = BoxFuture< 8239 + tonic::Response<Self::Response>, 8240 + tonic::Status, 8241 + >; 7081 8242 fn call( 7082 8243 &mut self, 7083 8244 request: tonic::Request<super::AdjustVolumeRequest>, ··· 7114 8275 "/rockbox.v1alpha1.SoundService/SoundSet" => { 7115 8276 #[allow(non_camel_case_types)] 7116 8277 struct SoundSetSvc<T: SoundService>(pub Arc<T>); 7117 - impl<T: SoundService> tonic::server::UnaryService<super::SoundSetRequest> for SoundSetSvc<T> { 8278 + impl< 8279 + T: SoundService, 8280 + > tonic::server::UnaryService<super::SoundSetRequest> 8281 + for SoundSetSvc<T> { 7118 8282 type Response = super::SoundSetResponse; 7119 - type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>; 8283 + type Future = BoxFuture< 8284 + tonic::Response<Self::Response>, 8285 + tonic::Status, 8286 + >; 7120 8287 fn call( 7121 8288 &mut self, 7122 8289 request: tonic::Request<super::SoundSetRequest>, ··· 7153 8320 "/rockbox.v1alpha1.SoundService/SoundCurrent" => { 7154 8321 #[allow(non_camel_case_types)] 7155 8322 struct SoundCurrentSvc<T: SoundService>(pub Arc<T>); 7156 - impl<T: SoundService> tonic::server::UnaryService<super::SoundCurrentRequest> 7157 - for SoundCurrentSvc<T> 7158 - { 8323 + impl< 8324 + T: SoundService, 8325 + > tonic::server::UnaryService<super::SoundCurrentRequest> 8326 + for SoundCurrentSvc<T> { 7159 8327 type Response = super::SoundCurrentResponse; 7160 - type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>; 8328 + type Future = BoxFuture< 8329 + tonic::Response<Self::Response>, 8330 + tonic::Status, 8331 + >; 7161 8332 fn call( 7162 8333 &mut self, 7163 8334 request: tonic::Request<super::SoundCurrentRequest>, ··· 7194 8365 "/rockbox.v1alpha1.SoundService/SoundDefault" => { 7195 8366 #[allow(non_camel_case_types)] 7196 8367 struct SoundDefaultSvc<T: SoundService>(pub Arc<T>); 7197 - impl<T: SoundService> tonic::server::UnaryService<super::SoundDefaultRequest> 7198 - for SoundDefaultSvc<T> 7199 - { 8368 + impl< 8369 + T: SoundService, 8370 + > tonic::server::UnaryService<super::SoundDefaultRequest> 8371 + for SoundDefaultSvc<T> { 7200 8372 type Response = super::SoundDefaultResponse; 7201 - type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>; 8373 + type Future = BoxFuture< 8374 + tonic::Response<Self::Response>, 8375 + tonic::Status, 8376 + >; 7202 8377 fn call( 7203 8378 &mut self, 7204 8379 request: tonic::Request<super::SoundDefaultRequest>, ··· 7235 8410 "/rockbox.v1alpha1.SoundService/SoundMin" => { 7236 8411 #[allow(non_camel_case_types)] 7237 8412 struct SoundMinSvc<T: SoundService>(pub Arc<T>); 7238 - impl<T: SoundService> tonic::server::UnaryService<super::SoundMinRequest> for SoundMinSvc<T> { 8413 + impl< 8414 + T: SoundService, 8415 + > tonic::server::UnaryService<super::SoundMinRequest> 8416 + for SoundMinSvc<T> { 7239 8417 type Response = super::SoundMinResponse; 7240 - type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>; 8418 + type Future = BoxFuture< 8419 + tonic::Response<Self::Response>, 8420 + tonic::Status, 8421 + >; 7241 8422 fn call( 7242 8423 &mut self, 7243 8424 request: tonic::Request<super::SoundMinRequest>, ··· 7274 8455 "/rockbox.v1alpha1.SoundService/SoundMax" => { 7275 8456 #[allow(non_camel_case_types)] 7276 8457 struct SoundMaxSvc<T: SoundService>(pub Arc<T>); 7277 - impl<T: SoundService> tonic::server::UnaryService<super::SoundMaxRequest> for SoundMaxSvc<T> { 8458 + impl< 8459 + T: SoundService, 8460 + > tonic::server::UnaryService<super::SoundMaxRequest> 8461 + for SoundMaxSvc<T> { 7278 8462 type Response = super::SoundMaxResponse; 7279 - type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>; 8463 + type Future = BoxFuture< 8464 + tonic::Response<Self::Response>, 8465 + tonic::Status, 8466 + >; 7280 8467 fn call( 7281 8468 &mut self, 7282 8469 request: tonic::Request<super::SoundMaxRequest>, ··· 7313 8500 "/rockbox.v1alpha1.SoundService/SoundUnit" => { 7314 8501 #[allow(non_camel_case_types)] 7315 8502 struct SoundUnitSvc<T: SoundService>(pub Arc<T>); 7316 - impl<T: SoundService> tonic::server::UnaryService<super::SoundUnitRequest> for SoundUnitSvc<T> { 8503 + impl< 8504 + T: SoundService, 8505 + > tonic::server::UnaryService<super::SoundUnitRequest> 8506 + for SoundUnitSvc<T> { 7317 8507 type Response = super::SoundUnitResponse; 7318 - type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>; 8508 + type Future = BoxFuture< 8509 + tonic::Response<Self::Response>, 8510 + tonic::Status, 8511 + >; 7319 8512 fn call( 7320 8513 &mut self, 7321 8514 request: tonic::Request<super::SoundUnitRequest>, ··· 7352 8545 "/rockbox.v1alpha1.SoundService/SoundVal2Phys" => { 7353 8546 #[allow(non_camel_case_types)] 7354 8547 struct SoundVal2PhysSvc<T: SoundService>(pub Arc<T>); 7355 - impl<T: SoundService> tonic::server::UnaryService<super::SoundVal2PhysRequest> 7356 - for SoundVal2PhysSvc<T> 7357 - { 8548 + impl< 8549 + T: SoundService, 8550 + > tonic::server::UnaryService<super::SoundVal2PhysRequest> 8551 + for SoundVal2PhysSvc<T> { 7358 8552 type Response = super::SoundVal2PhysResponse; 7359 - type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>; 8553 + type Future = BoxFuture< 8554 + tonic::Response<Self::Response>, 8555 + tonic::Status, 8556 + >; 7360 8557 fn call( 7361 8558 &mut self, 7362 8559 request: tonic::Request<super::SoundVal2PhysRequest>, ··· 7393 8590 "/rockbox.v1alpha1.SoundService/GetPitch" => { 7394 8591 #[allow(non_camel_case_types)] 7395 8592 struct GetPitchSvc<T: SoundService>(pub Arc<T>); 7396 - impl<T: SoundService> tonic::server::UnaryService<super::GetPitchRequest> for GetPitchSvc<T> { 8593 + impl< 8594 + T: SoundService, 8595 + > tonic::server::UnaryService<super::GetPitchRequest> 8596 + for GetPitchSvc<T> { 7397 8597 type Response = super::GetPitchResponse; 7398 - type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>; 8598 + type Future = BoxFuture< 8599 + tonic::Response<Self::Response>, 8600 + tonic::Status, 8601 + >; 7399 8602 fn call( 7400 8603 &mut self, 7401 8604 request: tonic::Request<super::GetPitchRequest>, ··· 7432 8635 "/rockbox.v1alpha1.SoundService/SetPitch" => { 7433 8636 #[allow(non_camel_case_types)] 7434 8637 struct SetPitchSvc<T: SoundService>(pub Arc<T>); 7435 - impl<T: SoundService> tonic::server::UnaryService<super::SetPitchRequest> for SetPitchSvc<T> { 8638 + impl< 8639 + T: SoundService, 8640 + > tonic::server::UnaryService<super::SetPitchRequest> 8641 + for SetPitchSvc<T> { 7436 8642 type Response = super::SetPitchResponse; 7437 - type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>; 8643 + type Future = BoxFuture< 8644 + tonic::Response<Self::Response>, 8645 + tonic::Status, 8646 + >; 7438 8647 fn call( 7439 8648 &mut self, 7440 8649 request: tonic::Request<super::SetPitchRequest>, ··· 7471 8680 "/rockbox.v1alpha1.SoundService/BeepPlay" => { 7472 8681 #[allow(non_camel_case_types)] 7473 8682 struct BeepPlaySvc<T: SoundService>(pub Arc<T>); 7474 - impl<T: SoundService> tonic::server::UnaryService<super::BeepPlayRequest> for BeepPlaySvc<T> { 8683 + impl< 8684 + T: SoundService, 8685 + > tonic::server::UnaryService<super::BeepPlayRequest> 8686 + for BeepPlaySvc<T> { 7475 8687 type Response = super::BeepPlayResponse; 7476 - type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>; 8688 + type Future = BoxFuture< 8689 + tonic::Response<Self::Response>, 8690 + tonic::Status, 8691 + >; 7477 8692 fn call( 7478 8693 &mut self, 7479 8694 request: tonic::Request<super::BeepPlayRequest>, ··· 7510 8725 "/rockbox.v1alpha1.SoundService/PcmbufFade" => { 7511 8726 #[allow(non_camel_case_types)] 7512 8727 struct PcmbufFadeSvc<T: SoundService>(pub Arc<T>); 7513 - impl<T: SoundService> tonic::server::UnaryService<super::PcmbufFadeRequest> for PcmbufFadeSvc<T> { 8728 + impl< 8729 + T: SoundService, 8730 + > tonic::server::UnaryService<super::PcmbufFadeRequest> 8731 + for PcmbufFadeSvc<T> { 7514 8732 type Response = super::PcmbufFadeResponse; 7515 - type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>; 8733 + type Future = BoxFuture< 8734 + tonic::Response<Self::Response>, 8735 + tonic::Status, 8736 + >; 7516 8737 fn call( 7517 8738 &mut self, 7518 8739 request: tonic::Request<super::PcmbufFadeRequest>, ··· 7549 8770 "/rockbox.v1alpha1.SoundService/PcmbufSetLowLatency" => { 7550 8771 #[allow(non_camel_case_types)] 7551 8772 struct PcmbufSetLowLatencySvc<T: SoundService>(pub Arc<T>); 7552 - impl<T: SoundService> 7553 - tonic::server::UnaryService<super::PcmbufSetLowLatencyRequest> 7554 - for PcmbufSetLowLatencySvc<T> 7555 - { 8773 + impl< 8774 + T: SoundService, 8775 + > tonic::server::UnaryService<super::PcmbufSetLowLatencyRequest> 8776 + for PcmbufSetLowLatencySvc<T> { 7556 8777 type Response = super::PcmbufSetLowLatencyResponse; 7557 - type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>; 8778 + type Future = BoxFuture< 8779 + tonic::Response<Self::Response>, 8780 + tonic::Status, 8781 + >; 7558 8782 fn call( 7559 8783 &mut self, 7560 8784 request: tonic::Request<super::PcmbufSetLowLatencyRequest>, 7561 8785 ) -> Self::Future { 7562 8786 let inner = Arc::clone(&self.0); 7563 8787 let fut = async move { 7564 - <T as SoundService>::pcmbuf_set_low_latency(&inner, request).await 8788 + <T as SoundService>::pcmbuf_set_low_latency(&inner, request) 8789 + .await 7565 8790 }; 7566 8791 Box::pin(fut) 7567 8792 } ··· 7591 8816 "/rockbox.v1alpha1.SoundService/SystemSoundPlay" => { 7592 8817 #[allow(non_camel_case_types)] 7593 8818 struct SystemSoundPlaySvc<T: SoundService>(pub Arc<T>); 7594 - impl<T: SoundService> tonic::server::UnaryService<super::SystemSoundPlayRequest> 7595 - for SystemSoundPlaySvc<T> 7596 - { 8819 + impl< 8820 + T: SoundService, 8821 + > tonic::server::UnaryService<super::SystemSoundPlayRequest> 8822 + for SystemSoundPlaySvc<T> { 7597 8823 type Response = super::SystemSoundPlayResponse; 7598 - type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>; 8824 + type Future = BoxFuture< 8825 + tonic::Response<Self::Response>, 8826 + tonic::Status, 8827 + >; 7599 8828 fn call( 7600 8829 &mut self, 7601 8830 request: tonic::Request<super::SystemSoundPlayRequest>, 7602 8831 ) -> Self::Future { 7603 8832 let inner = Arc::clone(&self.0); 7604 8833 let fut = async move { 7605 - <T as SoundService>::system_sound_play(&inner, request).await 8834 + <T as SoundService>::system_sound_play(&inner, request) 8835 + .await 7606 8836 }; 7607 8837 Box::pin(fut) 7608 8838 } ··· 7632 8862 "/rockbox.v1alpha1.SoundService/KeyclickClick" => { 7633 8863 #[allow(non_camel_case_types)] 7634 8864 struct KeyclickClickSvc<T: SoundService>(pub Arc<T>); 7635 - impl<T: SoundService> tonic::server::UnaryService<super::KeyclickClickRequest> 7636 - for KeyclickClickSvc<T> 7637 - { 8865 + impl< 8866 + T: SoundService, 8867 + > tonic::server::UnaryService<super::KeyclickClickRequest> 8868 + for KeyclickClickSvc<T> { 7638 8869 type Response = super::KeyclickClickResponse; 7639 - type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>; 8870 + type Future = BoxFuture< 8871 + tonic::Response<Self::Response>, 8872 + tonic::Status, 8873 + >; 7640 8874 fn call( 7641 8875 &mut self, 7642 8876 request: tonic::Request<super::KeyclickClickRequest>, ··· 7670 8904 }; 7671 8905 Box::pin(fut) 7672 8906 } 7673 - _ => Box::pin(async move { 7674 - let mut response = http::Response::new(empty_body()); 7675 - let headers = response.headers_mut(); 7676 - headers.insert( 7677 - tonic::Status::GRPC_STATUS, 7678 - (tonic::Code::Unimplemented as i32).into(), 7679 - ); 7680 - headers.insert( 7681 - http::header::CONTENT_TYPE, 7682 - tonic::metadata::GRPC_CONTENT_TYPE, 7683 - ); 7684 - Ok(response) 7685 - }), 8907 + _ => { 8908 + Box::pin(async move { 8909 + let mut response = http::Response::new(empty_body()); 8910 + let headers = response.headers_mut(); 8911 + headers 8912 + .insert( 8913 + tonic::Status::GRPC_STATUS, 8914 + (tonic::Code::Unimplemented as i32).into(), 8915 + ); 8916 + headers 8917 + .insert( 8918 + http::header::CONTENT_TYPE, 8919 + tonic::metadata::GRPC_CONTENT_TYPE, 8920 + ); 8921 + Ok(response) 8922 + }) 8923 + } 7686 8924 } 7687 8925 } 7688 8926 } ··· 7743 8981 dead_code, 7744 8982 missing_docs, 7745 8983 clippy::wildcard_imports, 7746 - clippy::let_unit_value 8984 + clippy::let_unit_value, 7747 8985 )] 7748 - use tonic::codegen::http::Uri; 7749 8986 use tonic::codegen::*; 8987 + use tonic::codegen::http::Uri; 7750 8988 #[derive(Debug, Clone)] 7751 8989 pub struct SystemServiceClient<T> { 7752 8990 inner: tonic::client::Grpc<T>, ··· 7790 9028 <T as tonic::client::GrpcService<tonic::body::BoxBody>>::ResponseBody, 7791 9029 >, 7792 9030 >, 7793 - <T as tonic::codegen::Service<http::Request<tonic::body::BoxBody>>>::Error: 7794 - Into<StdError> + std::marker::Send + std::marker::Sync, 9031 + <T as tonic::codegen::Service< 9032 + http::Request<tonic::body::BoxBody>, 9033 + >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync, 7795 9034 { 7796 9035 SystemServiceClient::new(InterceptedService::new(inner, interceptor)) 7797 9036 } ··· 7829 9068 pub async fn get_rockbox_version( 7830 9069 &mut self, 7831 9070 request: impl tonic::IntoRequest<super::GetRockboxVersionRequest>, 7832 - ) -> std::result::Result<tonic::Response<super::GetRockboxVersionResponse>, tonic::Status> 7833 - { 7834 - self.inner.ready().await.map_err(|e| { 7835 - tonic::Status::unknown(format!("Service was not ready: {}", e.into())) 7836 - })?; 9071 + ) -> std::result::Result< 9072 + tonic::Response<super::GetRockboxVersionResponse>, 9073 + tonic::Status, 9074 + > { 9075 + self.inner 9076 + .ready() 9077 + .await 9078 + .map_err(|e| { 9079 + tonic::Status::unknown( 9080 + format!("Service was not ready: {}", e.into()), 9081 + ) 9082 + })?; 7837 9083 let codec = tonic::codec::ProstCodec::default(); 7838 9084 let path = http::uri::PathAndQuery::from_static( 7839 9085 "/rockbox.v1alpha1.SystemService/GetRockboxVersion", 7840 9086 ); 7841 9087 let mut req = request.into_request(); 7842 - req.extensions_mut().insert(GrpcMethod::new( 7843 - "rockbox.v1alpha1.SystemService", 7844 - "GetRockboxVersion", 7845 - )); 9088 + req.extensions_mut() 9089 + .insert( 9090 + GrpcMethod::new( 9091 + "rockbox.v1alpha1.SystemService", 9092 + "GetRockboxVersion", 9093 + ), 9094 + ); 7846 9095 self.inner.unary(req, path, codec).await 7847 9096 } 7848 9097 pub async fn get_global_status( 7849 9098 &mut self, 7850 9099 request: impl tonic::IntoRequest<super::GetGlobalStatusRequest>, 7851 - ) -> std::result::Result<tonic::Response<super::GetGlobalStatusResponse>, tonic::Status> 7852 - { 7853 - self.inner.ready().await.map_err(|e| { 7854 - tonic::Status::unknown(format!("Service was not ready: {}", e.into())) 7855 - })?; 9100 + ) -> std::result::Result< 9101 + tonic::Response<super::GetGlobalStatusResponse>, 9102 + tonic::Status, 9103 + > { 9104 + self.inner 9105 + .ready() 9106 + .await 9107 + .map_err(|e| { 9108 + tonic::Status::unknown( 9109 + format!("Service was not ready: {}", e.into()), 9110 + ) 9111 + })?; 7856 9112 let codec = tonic::codec::ProstCodec::default(); 7857 9113 let path = http::uri::PathAndQuery::from_static( 7858 9114 "/rockbox.v1alpha1.SystemService/GetGlobalStatus", 7859 9115 ); 7860 9116 let mut req = request.into_request(); 7861 - req.extensions_mut().insert(GrpcMethod::new( 7862 - "rockbox.v1alpha1.SystemService", 7863 - "GetGlobalStatus", 7864 - )); 9117 + req.extensions_mut() 9118 + .insert( 9119 + GrpcMethod::new("rockbox.v1alpha1.SystemService", "GetGlobalStatus"), 9120 + ); 7865 9121 self.inner.unary(req, path, codec).await 7866 9122 } 7867 9123 } ··· 7873 9129 dead_code, 7874 9130 missing_docs, 7875 9131 clippy::wildcard_imports, 7876 - clippy::let_unit_value 9132 + clippy::let_unit_value, 7877 9133 )] 7878 9134 use tonic::codegen::*; 7879 9135 /// Generated trait containing gRPC methods that should be implemented for use with SystemServiceServer. ··· 7882 9138 async fn get_rockbox_version( 7883 9139 &self, 7884 9140 request: tonic::Request<super::GetRockboxVersionRequest>, 7885 - ) -> std::result::Result<tonic::Response<super::GetRockboxVersionResponse>, tonic::Status>; 9141 + ) -> std::result::Result< 9142 + tonic::Response<super::GetRockboxVersionResponse>, 9143 + tonic::Status, 9144 + >; 7886 9145 async fn get_global_status( 7887 9146 &self, 7888 9147 request: tonic::Request<super::GetGlobalStatusRequest>, 7889 - ) -> std::result::Result<tonic::Response<super::GetGlobalStatusResponse>, tonic::Status>; 9148 + ) -> std::result::Result< 9149 + tonic::Response<super::GetGlobalStatusResponse>, 9150 + tonic::Status, 9151 + >; 7890 9152 } 7891 9153 #[derive(Debug)] 7892 9154 pub struct SystemServiceServer<T> { ··· 7909 9171 max_encoding_message_size: None, 7910 9172 } 7911 9173 } 7912 - pub fn with_interceptor<F>(inner: T, interceptor: F) -> InterceptedService<Self, F> 9174 + pub fn with_interceptor<F>( 9175 + inner: T, 9176 + interceptor: F, 9177 + ) -> InterceptedService<Self, F> 7913 9178 where 7914 9179 F: tonic::service::Interceptor, 7915 9180 { ··· 7964 9229 "/rockbox.v1alpha1.SystemService/GetRockboxVersion" => { 7965 9230 #[allow(non_camel_case_types)] 7966 9231 struct GetRockboxVersionSvc<T: SystemService>(pub Arc<T>); 7967 - impl<T: SystemService> 7968 - tonic::server::UnaryService<super::GetRockboxVersionRequest> 7969 - for GetRockboxVersionSvc<T> 7970 - { 9232 + impl< 9233 + T: SystemService, 9234 + > tonic::server::UnaryService<super::GetRockboxVersionRequest> 9235 + for GetRockboxVersionSvc<T> { 7971 9236 type Response = super::GetRockboxVersionResponse; 7972 - type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>; 9237 + type Future = BoxFuture< 9238 + tonic::Response<Self::Response>, 9239 + tonic::Status, 9240 + >; 7973 9241 fn call( 7974 9242 &mut self, 7975 9243 request: tonic::Request<super::GetRockboxVersionRequest>, 7976 9244 ) -> Self::Future { 7977 9245 let inner = Arc::clone(&self.0); 7978 9246 let fut = async move { 7979 - <T as SystemService>::get_rockbox_version(&inner, request).await 9247 + <T as SystemService>::get_rockbox_version(&inner, request) 9248 + .await 7980 9249 }; 7981 9250 Box::pin(fut) 7982 9251 } ··· 8006 9275 "/rockbox.v1alpha1.SystemService/GetGlobalStatus" => { 8007 9276 #[allow(non_camel_case_types)] 8008 9277 struct GetGlobalStatusSvc<T: SystemService>(pub Arc<T>); 8009 - impl<T: SystemService> 8010 - tonic::server::UnaryService<super::GetGlobalStatusRequest> 8011 - for GetGlobalStatusSvc<T> 8012 - { 9278 + impl< 9279 + T: SystemService, 9280 + > tonic::server::UnaryService<super::GetGlobalStatusRequest> 9281 + for GetGlobalStatusSvc<T> { 8013 9282 type Response = super::GetGlobalStatusResponse; 8014 - type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>; 9283 + type Future = BoxFuture< 9284 + tonic::Response<Self::Response>, 9285 + tonic::Status, 9286 + >; 8015 9287 fn call( 8016 9288 &mut self, 8017 9289 request: tonic::Request<super::GetGlobalStatusRequest>, 8018 9290 ) -> Self::Future { 8019 9291 let inner = Arc::clone(&self.0); 8020 9292 let fut = async move { 8021 - <T as SystemService>::get_global_status(&inner, request).await 9293 + <T as SystemService>::get_global_status(&inner, request) 9294 + .await 8022 9295 }; 8023 9296 Box::pin(fut) 8024 9297 } ··· 8045 9318 }; 8046 9319 Box::pin(fut) 8047 9320 } 8048 - _ => Box::pin(async move { 8049 - let mut response = http::Response::new(empty_body()); 8050 - let headers = response.headers_mut(); 8051 - headers.insert( 8052 - tonic::Status::GRPC_STATUS, 8053 - (tonic::Code::Unimplemented as i32).into(), 8054 - ); 8055 - headers.insert( 8056 - http::header::CONTENT_TYPE, 8057 - tonic::metadata::GRPC_CONTENT_TYPE, 8058 - ); 8059 - Ok(response) 8060 - }), 9321 + _ => { 9322 + Box::pin(async move { 9323 + let mut response = http::Response::new(empty_body()); 9324 + let headers = response.headers_mut(); 9325 + headers 9326 + .insert( 9327 + tonic::Status::GRPC_STATUS, 9328 + (tonic::Code::Unimplemented as i32).into(), 9329 + ); 9330 + headers 9331 + .insert( 9332 + http::header::CONTENT_TYPE, 9333 + tonic::metadata::GRPC_CONTENT_TYPE, 9334 + ); 9335 + Ok(response) 9336 + }) 9337 + } 8061 9338 } 8062 9339 } 8063 9340 }
+579 -6
sdk/gleam/README.md
··· 3 3 [![Package Version](https://img.shields.io/hexpm/v/rockbox)](https://hex.pm/packages/rockbox) 4 4 [![Hex Docs](https://img.shields.io/badge/hex-docs-ffaff3)](https://hexdocs.pm/rockbox/) 5 5 6 + Gleam SDK for [Rockbox Zig](https://github.com/tsirysndr/rockbox-zig) — a 7 + typed, pipe-friendly client for the `rockboxd` GraphQL API. 8 + 9 + - **Pipe-friendly** — every API function takes the client as its first arg. 10 + - **Builder-friendly** — smart-playlist rules and partial settings updates 11 + compose with `|>`. 12 + - **Tagged results** — every call returns `Result(value, rockbox/error.Error)`, 13 + so `case` and `use` flows stay flat. 14 + - **Type-safe rules DSL** — compose smart-playlist rules with 15 + `rockbox/smart_playlists/rules` instead of hand-written JSON. 16 + 17 + --- 18 + 19 + ## Table of contents 20 + 21 + - [Installation](#installation) 22 + - [Quick start](#quick-start) 23 + - [Configuration](#configuration) 24 + - [API reference](#api-reference) 25 + - [Playback](#playback) 26 + - [Library](#library) 27 + - [Queue (live playlist)](#queue-live-playlist) 28 + - [Saved playlists](#saved-playlists) 29 + - [Smart playlists](#smart-playlists) 30 + - [Sound](#sound) 31 + - [Settings](#settings) 32 + - [System](#system) 33 + - [Browse (filesystem)](#browse-filesystem) 34 + - [Devices](#devices) 35 + - [Bluetooth](#bluetooth) 36 + - [Error handling](#error-handling) 37 + - [Raw GraphQL queries](#raw-graphql-queries) 38 + - [Module map](#module-map) 39 + 40 + --- 41 + 42 + ## Installation 43 + 6 44 ```sh 7 - gleam add rockbox@1 45 + gleam add rockbox 46 + ``` 47 + 48 + `rockboxd` must be running and reachable. By default the SDK connects to 49 + `http://localhost:6062/graphql`. Start rockboxd with: 50 + 51 + ```sh 52 + rockbox start 8 53 ``` 54 + 55 + --- 56 + 57 + ## Quick start 58 + 9 59 ```gleam 60 + import gleam/io 61 + import gleam/list 62 + import gleam/option.{None, Some} 10 63 import rockbox 64 + import rockbox/library 65 + import rockbox/playback 11 66 12 - pub fn main() -> Nil { 13 - // TODO: An example of the project in use 67 + pub fn main() { 68 + let client = rockbox.default_client() 69 + 70 + // What's playing right now? 71 + case playback.current_track(client) { 72 + Ok(Some(track)) -> io.println("▶ " <> track.title <> " — " <> track.artist) 73 + Ok(None) -> io.println("Nothing is playing.") 74 + Error(_) -> io.println("Could not reach rockboxd.") 75 + } 76 + 77 + // Search the library and play the first hit 78 + let assert Ok(results) = library.search(client, "dark side") 79 + case list.first(results.albums) { 80 + Ok(album) -> { 81 + let _ = 82 + playback.play_album( 83 + client, 84 + album.id, 85 + playback.play_options() |> playback.with_shuffle(True), 86 + ) 87 + Nil 88 + } 89 + Error(_) -> Nil 90 + } 91 + } 92 + ``` 93 + 94 + --- 95 + 96 + ## Configuration 97 + 98 + The `Builder` pattern lets you override defaults one field at a time: 99 + 100 + ```gleam 101 + // Defaults: localhost:6062 102 + let client = rockbox.default_client() 103 + 104 + // Custom host and port 105 + let client = rockbox.at(host: "192.168.1.42", port: 6062) 106 + 107 + // Fully custom URL (e.g. behind a reverse proxy with TLS) 108 + let client = 109 + rockbox.new() 110 + |> rockbox.url("https://music.home/graphql") 111 + |> rockbox.connect 112 + ``` 113 + 114 + | Setter | Default | Description | 115 + |------------------|-----------------------|----------------------------------------| 116 + | `host(_, value)` | `"localhost"` | Hostname or IP of rockboxd | 117 + | `port(_, value)` | `6062` | GraphQL HTTP port | 118 + | `url(_, value)` | derived from host/port | Override the full HTTP URL (wins over `host` / `port`) | 119 + 120 + Use `rockbox.http_url(client)` to read back the resolved URL — handy for 121 + tests and diagnostics. 122 + 123 + --- 124 + 125 + ## API reference 126 + 127 + Every function returns `Result(value, rockbox/error.Error)`. Pattern-match 128 + or use `let assert Ok(x) = …` in scripts where a failure should crash. 129 + 130 + ### Playback 131 + 132 + ```gleam 133 + import rockbox/playback 134 + import rockbox/types 135 + 136 + // Status — typed: Stopped | Playing | Paused | UnknownStatus(Int) 137 + let assert Ok(status) = playback.status(client) 138 + 139 + // Toggle 140 + case status { 141 + types.Playing -> { let _ = playback.pause(client) } 142 + _ -> { let _ = playback.resume(client) } 143 + } 144 + 145 + // Transport 146 + let _ = playback.next(client) 147 + let _ = playback.previous(client) 148 + let _ = playback.stop(client) 149 + 150 + // Seek to absolute position (ms) 151 + let _ = playback.seek(client, 90_000) 152 + 153 + // Current / next track — Ok(Some(track)) when present, Ok(None) when stopped 154 + let assert Ok(now) = playback.current_track(client) 155 + let assert Ok(next) = playback.next_track(client) 156 + ``` 157 + 158 + #### Play helpers 159 + 160 + `PlayOptions` is a small builder for the optional `shuffle` / `position` 161 + knobs accepted by every `play_*` shortcut: 162 + 163 + ```gleam 164 + let opts = 165 + playback.play_options() 166 + |> playback.with_shuffle(True) 167 + |> playback.with_position(2) 168 + 169 + let _ = playback.play_track(client, "/Music/foo.mp3") 170 + let _ = playback.play_album(client, "album-id", opts) 171 + let _ = playback.play_artist(client, "artist-id", opts) 172 + let _ = playback.play_playlist(client, "playlist-id", opts) 173 + let _ = playback.play_directory(client, "/Music/Jazz", True, opts) 174 + let _ = playback.play_liked_tracks(client, opts) 175 + let _ = playback.play_all_tracks(client, opts) 176 + ``` 177 + 178 + ### Library 179 + 180 + ```gleam 181 + import rockbox/library 182 + 183 + // Albums 184 + let assert Ok(albums) = library.albums(client) 185 + let assert Ok(album) = library.album(client, "album-id") // includes tracks 186 + let assert Ok(liked) = library.liked_albums(client) 187 + let _ = library.like_album(client, "album-id") 188 + let _ = library.unlike_album(client, "album-id") 189 + 190 + // Artists 191 + let assert Ok(artists) = library.artists(client) 192 + let assert Ok(artist) = library.artist(client, "artist-id") 193 + 194 + // Tracks 195 + let assert Ok(tracks) = library.tracks(client) 196 + let assert Ok(track) = library.track(client, "track-id") 197 + let assert Ok(liked) = library.liked_tracks(client) 198 + let _ = library.like_track(client, "track-id") 199 + let _ = library.unlike_track(client, "track-id") 200 + 201 + // Search across artists, albums, tracks, liked 202 + let assert Ok(results) = library.search(client, "radiohead") 203 + results.artists // List(Artist) 204 + results.albums // List(Album) 205 + results.tracks // List(Track) 206 + results.liked_tracks 207 + results.liked_albums 208 + 209 + // Trigger a full library rescan 210 + let _ = library.scan(client) 211 + ``` 212 + 213 + ### Queue (live playlist) 214 + 215 + The live queue lives in `rockbox/playlist`. For persistent named 216 + collections see [Saved playlists](#saved-playlists). 217 + 218 + ```gleam 219 + import gleam/option.{None} 220 + import rockbox/playlist 221 + import rockbox/types 222 + 223 + let assert Ok(queue) = playlist.current(client) 224 + queue.amount // total tracks 225 + queue.index // 0-based position of the currently playing track 226 + queue.tracks // List(Track) 227 + 228 + // Insertion: position is types.Next | types.AfterCurrent | types.Last | types.First 229 + let _ = 230 + playlist.insert_tracks( 231 + client, 232 + ["/Music/a.mp3", "/Music/b.mp3"], 233 + types.Next, 234 + None, 235 + ) 236 + let _ = 237 + playlist.insert_directory(client, "/Music/Ambient", types.Last, None) 238 + let _ = playlist.insert_album(client, "album-id", types.Next) 239 + 240 + // Other ops 241 + let _ = playlist.remove_track(client, 2) 242 + let _ = playlist.clear(client) 243 + let _ = playlist.shuffle(client) 244 + let _ = playlist.create(client, "Evening Mix", ["/a.mp3", "/b.mp3"]) 245 + let _ = playlist.resume(client) 246 + 247 + // Start from a specific position 248 + let opts = 249 + playlist.start_options() 250 + |> playlist.at_index(3) 251 + |> playlist.at_elapsed(0) 252 + let _ = playlist.start(client, opts) 253 + ``` 254 + 255 + ### Saved playlists 256 + 257 + ```gleam 258 + import gleam/option.{None, Some} 259 + import rockbox/saved_playlists 260 + 261 + let assert Ok(lists) = saved_playlists.list(client, None) 262 + let assert Ok(scoped) = saved_playlists.list(client, Some("folder-id")) 263 + 264 + let assert Ok(pl) = saved_playlists.get(client, "playlist-id") 265 + let assert Ok(ids) = saved_playlists.track_ids(client, "playlist-id") 266 + 267 + // Create 268 + let input = 269 + saved_playlists.new("Late Night Jazz") 270 + |> saved_playlists.with_description("Quiet music for working") 271 + |> saved_playlists.with_folder("folder-id") 272 + |> saved_playlists.with_tracks(["t1", "t2", "t3"]) 273 + 274 + let assert Ok(pl) = saved_playlists.create(client, input) 275 + 276 + // Update / add / remove 277 + let patch = 278 + saved_playlists.update("Late Night Jazz (v2)") 279 + |> saved_playlists.update_description("Updated cover") 280 + 281 + let _ = saved_playlists.save(client, pl.id, patch) 282 + let _ = saved_playlists.add_tracks(client, pl.id, ["t4", "t5"]) 283 + let _ = saved_playlists.remove_track(client, pl.id, "t1") 284 + 285 + // Play / delete 286 + let _ = saved_playlists.play(client, pl.id) 287 + let _ = saved_playlists.delete(client, pl.id) 288 + 289 + // Folders 290 + let assert Ok(folders) = saved_playlists.folders(client) 291 + let assert Ok(folder) = saved_playlists.create_folder(client, "Work") 292 + let _ = saved_playlists.delete_folder(client, folder.id) 293 + ``` 294 + 295 + ### Smart playlists 296 + 297 + Compose rules with the type-safe `rockbox/smart_playlists/rules` builder 298 + instead of hand-writing JSON. 299 + 300 + ```gleam 301 + import rockbox/smart_playlists 302 + import rockbox/smart_playlists/rules 303 + 304 + let r = 305 + rules.all_of() 306 + |> rules.where("play_count", rules.Gte, rules.int(10)) 307 + |> rules.where("last_played", rules.Within, rules.string("30d")) 308 + |> rules.sort("play_count", rules.Desc) 309 + |> rules.limit(50) 310 + 311 + let input = 312 + smart_playlists.new("Most played (last 30d)", rules.to_string(r)) 313 + |> smart_playlists.with_description("Top 50 most-played tracks from the last month") 314 + 315 + let assert Ok(sp) = smart_playlists.create(client, input) 316 + 317 + let assert Ok(ids) = smart_playlists.track_ids(client, sp.id) 318 + let _ = smart_playlists.play(client, sp.id) 319 + let _ = smart_playlists.delete(client, sp.id) 320 + ``` 321 + 322 + #### Operators 323 + 324 + | Variant | Meaning | 325 + |-------------|----------------------------------------| 326 + | `Eq` | equals | 327 + | `Neq` | not equals | 328 + | `Gt` | greater than | 329 + | `Gte` | greater than or equal | 330 + | `Lt` | less than | 331 + | `Lte` | less than or equal | 332 + | `Contains` | substring match | 333 + | `Within` | duration window (e.g. `"30d"`, `"7d"`) | 334 + 335 + #### OR groups and nesting 336 + 337 + ```gleam 338 + let either = 339 + rules.any_of() 340 + |> rules.where("title", rules.Contains, rules.string("Live")) 341 + |> rules.where("title", rules.Contains, rules.string("Acoustic")) 342 + 343 + let mixed = 344 + rules.all_of() 345 + |> rules.where("play_count", rules.Gt, rules.int(0)) 346 + |> rules.where_group(either) 347 + ``` 348 + 349 + #### Listening stats 350 + 351 + ```gleam 352 + let assert Ok(stats) = smart_playlists.track_stats(client, "track-id") 353 + 354 + // Record events manually (e.g. from a scrobbler) 355 + let _ = smart_playlists.record_played(client, "track-id") 356 + let _ = smart_playlists.record_skipped(client, "track-id") 357 + ``` 358 + 359 + ### Sound 360 + 361 + Volume is adjusted in firmware-defined steps. The number of steps per dB 362 + varies by hardware target — always inspect `get_volume/1` for the range. 363 + 364 + ```gleam 365 + import rockbox/sound 366 + 367 + let assert Ok(vol) = sound.get_volume(client) 368 + vol.volume // current value 369 + vol.min // lower bound 370 + vol.max // upper bound 371 + 372 + let assert Ok(new_value) = sound.adjust_volume(client, 3) // +3 steps 373 + let assert Ok(_) = sound.volume_up(client) // +1 374 + let assert Ok(_) = sound.volume_down(client) // -1 375 + ``` 376 + 377 + ### Settings 378 + 379 + `save/2` accepts any subset of fields — only the ones you set are written. 380 + 381 + ```gleam 382 + import rockbox/settings 383 + import rockbox/types.{ 384 + CompressorSettings, EqBandSetting, ReplaygainSettings, 14 385 } 386 + 387 + let assert Ok(current) = settings.get(client) 388 + 389 + // Toggle shuffle + repeat 390 + let patch = 391 + settings.patch() 392 + |> settings.set_shuffle(True) 393 + |> settings.set_repeat_mode(1) 394 + let _ = settings.save(client, patch) 395 + 396 + // Equalizer 397 + let bands = [ 398 + EqBandSetting(cutoff: 60, q: 7, gain: 3), 399 + EqBandSetting(cutoff: 200, q: 7, gain: 0), 400 + EqBandSetting(cutoff: 4000, q: 7, gain: -2), 401 + ] 402 + let patch = 403 + settings.patch() 404 + |> settings.set_eq_enabled(True) 405 + |> settings.set_eq_precut(-3) 406 + |> settings.set_eq_bands(bands) 407 + let _ = settings.save(client, patch) 408 + 409 + // Compressor 410 + let patch = 411 + settings.patch() 412 + |> settings.set_compressor(CompressorSettings( 413 + threshold: -24, 414 + makeup_gain: 3, 415 + ratio: 2, 416 + knee: 0, 417 + release_time: 100, 418 + attack_time: 5, 419 + )) 420 + let _ = settings.save(client, patch) 421 + 422 + // Replaygain 423 + let patch = 424 + settings.patch() 425 + |> settings.set_replaygain(ReplaygainSettings( 426 + noclip: True, type_: 1, preamp: 0, 427 + )) 428 + let _ = settings.save(client, patch) 15 429 ``` 16 430 17 - Further documentation can be found at <https://hexdocs.pm/rockbox>. 431 + ### System 432 + 433 + ```gleam 434 + import rockbox/system 435 + 436 + let assert Ok(version) = system.version(client) 437 + let assert Ok(status) = system.status(client) 438 + 439 + status.runtime // seconds since boot 440 + status.topruntime // peak runtime 441 + status.resume_index // last queued position 442 + ``` 443 + 444 + ### Browse (filesystem) 445 + 446 + ```gleam 447 + import gleam/option.{None, Some} 448 + import rockbox/browse 449 + import rockbox/types 450 + 451 + let assert Ok(entries) = browse.entries(client, None) // music_dir root 452 + let assert Ok(entries) = browse.entries(client, Some("/Music/Pink Floyd")) 453 + 454 + list.each(entries, fn(e) { 455 + let icon = case types.is_directory(e) { 456 + True -> "[dir] " 457 + False -> " " 458 + } 459 + io.println(icon <> e.name) 460 + }) 461 + 462 + let assert Ok(dirs) = browse.directories(client, Some("/Music")) 463 + let assert Ok(files) = browse.files(client, Some("/Music/Pink Floyd/The Wall")) 464 + ``` 465 + 466 + ### Devices 467 + 468 + ```gleam 469 + import rockbox/devices 470 + 471 + let assert Ok(devices) = devices.list(client) 472 + let assert Ok(device) = devices.get(client, "device-id") 473 + 474 + // Connect — switches the active PCM output sink to this device 475 + let _ = devices.connect(client, "chromecast-id") 476 + let _ = devices.disconnect(client, "chromecast-id") 477 + ``` 478 + 479 + ### Bluetooth 480 + 481 + Linux only — backed by BlueZ. Calls return a `GraphQLError` on non-Linux 482 + hosts. 483 + 484 + ```gleam 485 + import gleam/option.{None, Some} 486 + import rockbox/bluetooth 487 + 488 + let assert Ok(devices) = bluetooth.devices(client) 489 + let assert Ok(found) = bluetooth.scan(client, Some(10)) // 10 second scan 490 + let _ = bluetooth.connect(client, "AA:BB:CC:DD:EE:FF") 491 + let _ = bluetooth.disconnect(client, "AA:BB:CC:DD:EE:FF") 492 + ``` 493 + 494 + --- 495 + 496 + ## Error handling 497 + 498 + ```gleam 499 + import rockbox/error 500 + import rockbox/playback 501 + 502 + case playback.current_track(client) { 503 + Ok(track) -> echo track 504 + Error(error.NetworkError(reason)) -> io.println("offline: " <> reason) 505 + Error(error.HttpError(status, _)) -> io.println("http " <> int.to_string(status)) 506 + Error(error.GraphQLError(messages)) -> 507 + list.each(messages, fn(m) { io.println("server: " <> m) }) 508 + Error(error.DecodeError(reason)) -> io.println("decode: " <> reason) 509 + } 510 + ``` 511 + 512 + | Variant | When raised | 513 + |-----------------|----------------------------------------------------------| 514 + | `NetworkError` | DNS, refused connection, TLS, etc. | 515 + | `HttpError` | Server returned a non-2xx HTTP response. | 516 + | `GraphQLError` | Server returned a populated `errors` array. | 517 + | `DecodeError` | Response body could not be decoded into the expected shape. | 518 + 519 + --- 520 + 521 + ## Raw GraphQL queries 522 + 523 + For operations not yet covered by a dedicated function, drop down to 524 + `rockbox.query/4` (or `rockbox.execute/3` for fire-and-forget mutations) 525 + and supply your own decoder. 526 + 527 + ```gleam 528 + import gleam/dynamic/decode 529 + import gleam/json 530 + 531 + let version_decoder = { 532 + use v <- decode.field("rockboxVersion", decode.string) 533 + decode.success(v) 534 + } 535 + 536 + let assert Ok(version) = 537 + rockbox.query( 538 + client, 539 + "query Version { rockboxVersion }", 540 + json.object([]), 541 + version_decoder, 542 + ) 543 + 544 + // Mutation — use execute when you don't care about the response body 545 + let _ = 546 + rockbox.execute( 547 + client, 548 + "mutation Seek($t: Int!) { fastForwardRewind(newTime: $t) }", 549 + json.object([#("t", json.int(120_000))]), 550 + ) 551 + ``` 552 + 553 + The GraphiQL explorer is available at `http://localhost:6062/graphiql` 554 + while rockboxd is running. 555 + 556 + --- 557 + 558 + ## Module map 559 + 560 + | Domain | Module | 561 + |-----------------------|-----------------------------------------| 562 + | Client constructor | `rockbox` | 563 + | Transport controls | `rockbox/playback` | 564 + | Library / search | `rockbox/library` | 565 + | Live queue | `rockbox/playlist` | 566 + | Saved playlists | `rockbox/saved_playlists` | 567 + | Smart playlists | `rockbox/smart_playlists` | 568 + | Smart-playlist rules | `rockbox/smart_playlists/rules` | 569 + | Volume | `rockbox/sound` | 570 + | Settings | `rockbox/settings` | 571 + | System info | `rockbox/system` | 572 + | Filesystem browser | `rockbox/browse` | 573 + | Output devices | `rockbox/devices` | 574 + | Bluetooth | `rockbox/bluetooth` | 575 + | Domain types | `rockbox/types` | 576 + | Errors | `rockbox/error` | 577 + 578 + --- 18 579 19 580 ## Development 20 581 21 582 ```sh 22 - gleam run # Run the project 23 - gleam test # Run the tests 583 + gleam test # run the test suite 584 + gleam docs build 24 585 ``` 586 + 587 + Runnable examples live in `examples/`. Start `rockboxd`, then: 588 + 589 + ```sh 590 + cd examples 591 + gleam run -m example_01_basic_playback 592 + gleam run -m example_06_smart_playlist 593 + ``` 594 + 595 + See [`examples/README.md`](./examples/README.md) for the full list. 596 + 597 + Further documentation is on [HexDocs](https://hexdocs.pm/rockbox). 25 598 26 599 --- 27 600
+4
sdk/gleam/examples/.gitignore
··· 1 + *.beam 2 + *.ez 3 + /build 4 + erl_crash.dump
+41
sdk/gleam/examples/README.md
··· 1 + # Examples 2 + 3 + Each example is a runnable Gleam module. Start `rockboxd` first, then from 4 + this directory: 5 + 6 + ```sh 7 + gleam deps download 8 + gleam run -m example_01_basic_playback 9 + ``` 10 + 11 + The shared client points at `localhost:6062` — edit `src/helper.gleam` if 12 + your daemon runs elsewhere. Examples that take parameters (search term, 13 + browse path, sleep-timer minutes, …) declare a constant near the top of 14 + the file; tweak it and re-run. 15 + 16 + | File | What it shows | 17 + |-----------------------------------|--------------------------------------------------------| 18 + | `example_01_basic_playback.gleam` | Toggle play/pause based on current status | 19 + | `example_02_now_playing.gleam` | Polling-based current-track watcher | 20 + | `example_03_library_search.gleam` | Full-text search across artists/albums/tracks | 21 + | `example_04_queue_management.gleam` | Inspect and modify the live queue | 22 + | `example_05_saved_playlists.gleam` | Persistent named playlists | 23 + | `example_06_smart_playlist.gleam` | Rule-based smart playlist via the `rules` builder DSL | 24 + | `example_07_volume_control.gleam` | Volume up/down | 25 + | `example_08_eq_config.gleam` | Equalizer configuration via the settings patch builder | 26 + | `example_09_browse_filesystem.gleam` | Walk `music_dir` | 27 + | `example_10_devices.gleam` | List Chromecast / AirPlay devices | 28 + | `example_11_bluetooth.gleam` | Bluetooth scan / connect (Linux) | 29 + | `example_12_sleep_timer.gleam` | Polling-based sleep timer | 30 + | `example_13_raw_query.gleam` | Escape hatch for one-off GraphQL queries | 31 + 32 + ## Differences from the Elixir SDK 33 + 34 + The Gleam SDK is request/response-only and doesn't ship the higher-level 35 + abstractions the Elixir SDK has, so a few examples are adapted: 36 + 37 + - **02 / now playing** — the Elixir version subscribes to a WebSocket. The 38 + Gleam version polls `currentTrack` once per second. 39 + - **12 / sleep timer** — the Elixir version uses a `Rockbox.Plugin` 40 + GenServer. The Gleam version is a simple `process.sleep` loop that bails 41 + out early if playback was stopped manually.
+13
sdk/gleam/examples/gleam.toml
··· 1 + name = "rockbox_examples" 2 + version = "0.0.0" 3 + description = "Runnable examples for the Rockbox Gleam SDK" 4 + licences = ["Apache-2.0"] 5 + gleam = ">= 1.11.0" 6 + 7 + [dependencies] 8 + gleam_stdlib = ">= 0.46.0 and < 2.0.0" 9 + gleam_erlang = ">= 0.34.0 and < 2.0.0" 10 + gleam_json = ">= 2.0.0 and < 4.0.0" 11 + rockbox = { path = ".." } 12 + 13 + [dev_dependencies]
+17
sdk/gleam/examples/manifest.toml
··· 1 + # This file was generated by Gleam 2 + # You typically do not need to edit this file 3 + 4 + packages = [ 5 + { name = "gleam_erlang", version = "1.3.0", build_tools = ["gleam"], requirements = ["gleam_stdlib"], otp_app = "gleam_erlang", source = "hex", outer_checksum = "1124AD3AA21143E5AF0FC5CF3D9529F6DB8CA03E43A55711B60B6B7B3874375C" }, 6 + { name = "gleam_http", version = "4.3.0", build_tools = ["gleam"], requirements = ["gleam_stdlib"], otp_app = "gleam_http", source = "hex", outer_checksum = "82EA6A717C842456188C190AFB372665EA56CE13D8559BF3B1DD9E40F619EE0C" }, 7 + { name = "gleam_httpc", version = "5.0.0", build_tools = ["gleam"], requirements = ["gleam_erlang", "gleam_http", "gleam_stdlib"], otp_app = "gleam_httpc", source = "hex", outer_checksum = "C545172618D07811494E97AAA4A0FB34DA6F6D0061FDC8041C2F8E3BE2B2E48F" }, 8 + { name = "gleam_json", version = "3.1.0", build_tools = ["gleam"], requirements = ["gleam_stdlib"], otp_app = "gleam_json", source = "hex", outer_checksum = "44FDAA8847BE8FC48CA7A1C089706BD54BADCC4C45B237A992EDDF9F2CDB2836" }, 9 + { name = "gleam_stdlib", version = "1.0.0", build_tools = ["gleam"], requirements = [], otp_app = "gleam_stdlib", source = "hex", outer_checksum = "960090C2FB391784BB34267B099DC9315CC1B1F6013E7415BC763CEF1905D7D3" }, 10 + { name = "rockbox", version = "1.0.0", build_tools = ["gleam"], requirements = ["gleam_http", "gleam_httpc", "gleam_json", "gleam_stdlib"], source = "local", path = ".." }, 11 + ] 12 + 13 + [requirements] 14 + gleam_erlang = { version = ">= 0.34.0 and < 2.0.0" } 15 + gleam_json = { version = ">= 2.0.0 and < 4.0.0" } 16 + gleam_stdlib = { version = ">= 0.46.0 and < 2.0.0" } 17 + rockbox = { path = ".." }
+62
sdk/gleam/examples/src/example_01_basic_playback.gleam
··· 1 + //// 01 — Basic playback 2 + //// 3 + //// Inspect the current track and toggle play/pause based on status. 4 + //// Idempotent: run twice and it flips between Playing and Paused. 5 + //// 6 + //// gleam run -m example_01_basic_playback 7 + 8 + import gleam/int 9 + import gleam/io 10 + import gleam/option.{None, Some} 11 + import helper 12 + import rockbox/playback 13 + import rockbox/types 14 + 15 + pub fn main() { 16 + let client = helper.client() 17 + 18 + let assert Ok(status) = playback.status(client) 19 + io.println("Status: " <> status_label(status)) 20 + 21 + case playback.current_track(client) { 22 + Ok(Some(track)) -> { 23 + let pct = case track.length { 24 + 0 -> 0 25 + len -> track.elapsed * 100 / len 26 + } 27 + io.println("Now: " <> track.title <> " — " <> track.artist) 28 + io.println( 29 + " " 30 + <> helper.fmt_ms(track.elapsed) 31 + <> " / " 32 + <> helper.fmt_ms(track.length) 33 + <> " (" 34 + <> int.to_string(pct) 35 + <> "%)", 36 + ) 37 + } 38 + Ok(None) -> io.println("Nothing is playing.") 39 + Error(_) -> io.println("Could not read current track.") 40 + } 41 + 42 + case status { 43 + types.Playing -> { 44 + let _ = playback.pause(client) 45 + io.println("→ paused") 46 + } 47 + types.Paused -> { 48 + let _ = playback.resume(client) 49 + io.println("→ resumed") 50 + } 51 + _ -> Nil 52 + } 53 + } 54 + 55 + fn status_label(status: types.PlaybackStatus) -> String { 56 + case status { 57 + types.Stopped -> "stopped" 58 + types.Playing -> "playing" 59 + types.Paused -> "paused" 60 + types.UnknownStatus(n) -> "unknown(" <> int.to_string(n) <> ")" 61 + } 62 + }
+66
sdk/gleam/examples/src/example_02_now_playing.gleam
··· 1 + //// 02 — Now Playing (polling) 2 + //// 3 + //// The Gleam SDK is request/response only — there's no WebSocket subscription 4 + //// helper yet. This example polls `currentTrack` and prints when the playing 5 + //// track changes. Press Ctrl+C to exit. 6 + //// 7 + //// gleam run -m example_02_now_playing 8 + 9 + import gleam/erlang/process 10 + import gleam/io 11 + import gleam/option.{type Option, None, Some} 12 + import helper 13 + import rockbox.{type Client} 14 + import rockbox/playback 15 + import rockbox/types.{type Track} 16 + 17 + const poll_interval_ms = 1000 18 + 19 + pub fn main() { 20 + let client = helper.client() 21 + io.println("Watching for track changes (Ctrl+C to exit).") 22 + loop(client, None) 23 + } 24 + 25 + fn loop(client: Client, last_seen: Option(String)) { 26 + let now = case playback.current_track(client) { 27 + Ok(track) -> track 28 + Error(_) -> None 29 + } 30 + 31 + let last_seen = case now, last_seen { 32 + Some(track), previous -> { 33 + let key = track_key(track) 34 + case Some(key) == previous { 35 + True -> previous 36 + False -> { 37 + io.println( 38 + "▶ " 39 + <> track.title 40 + <> " — " 41 + <> track.artist 42 + <> " (" 43 + <> helper.fmt_ms(track.length) 44 + <> ")", 45 + ) 46 + Some(key) 47 + } 48 + } 49 + } 50 + None, Some(_) -> { 51 + io.println("· no track") 52 + None 53 + } 54 + None, None -> None 55 + } 56 + 57 + process.sleep(poll_interval_ms) 58 + loop(client, last_seen) 59 + } 60 + 61 + fn track_key(track: Track) -> String { 62 + case track.id { 63 + Some(id) -> id 64 + None -> track.path 65 + } 66 + }
+46
sdk/gleam/examples/src/example_03_library_search.gleam
··· 1 + //// 03 — Library search 2 + //// 3 + //// Edit `search_term` below to query something different. 4 + //// 5 + //// gleam run -m example_03_library_search 6 + 7 + import gleam/int 8 + import gleam/io 9 + import gleam/list 10 + import helper 11 + import rockbox/library 12 + 13 + const search_term = "love" 14 + 15 + pub fn main() { 16 + let client = helper.client() 17 + 18 + let assert Ok(results) = library.search(client, search_term) 19 + 20 + io.println("Search: \"" <> search_term <> "\"") 21 + 22 + io.println( 23 + " Artists (" <> int.to_string(list.length(results.artists)) <> "):", 24 + ) 25 + results.artists 26 + |> list.take(5) 27 + |> list.each(fn(a) { io.println(" • " <> a.name) }) 28 + 29 + io.println( 30 + " Albums (" <> int.to_string(list.length(results.albums)) <> "):", 31 + ) 32 + results.albums 33 + |> list.take(5) 34 + |> list.each(fn(a) { 35 + io.println( 36 + " • " <> a.title <> " — " <> a.artist <> " (" <> int.to_string(a.year) <> ")", 37 + ) 38 + }) 39 + 40 + io.println( 41 + " Tracks (" <> int.to_string(list.length(results.tracks)) <> "):", 42 + ) 43 + results.tracks 44 + |> list.take(5) 45 + |> list.each(fn(t) { io.println(" • " <> t.title <> " — " <> t.artist) }) 46 + }
+52
sdk/gleam/examples/src/example_04_queue_management.gleam
··· 1 + //// 04 — Queue management 2 + //// 3 + //// Inspect the live playback queue. Mutating helpers (`insert_tracks`, 4 + //// `remove_track`, `clear`, `shuffle`) are commented out at the bottom. 5 + //// 6 + //// gleam run -m example_04_queue_management 7 + 8 + import gleam/int 9 + import gleam/io 10 + import gleam/list 11 + import helper 12 + import rockbox/playlist 13 + 14 + pub fn main() { 15 + let client = helper.client() 16 + 17 + let assert Ok(queue) = playlist.current(client) 18 + io.println( 19 + "Queue: " 20 + <> int.to_string(queue.amount) 21 + <> " tracks, currently at index " 22 + <> int.to_string(queue.index), 23 + ) 24 + 25 + queue.tracks 26 + |> list.take(10) 27 + |> list.index_map(fn(t, i) { #(t, i) }) 28 + |> list.each(fn(pair) { 29 + let #(t, i) = pair 30 + let marker = case i == queue.index { 31 + True -> "▶" 32 + False -> " " 33 + } 34 + io.println( 35 + marker 36 + <> " " 37 + <> int.to_string(i + 1) 38 + <> ". " 39 + <> t.title 40 + <> " — " 41 + <> t.artist, 42 + ) 43 + }) 44 + 45 + // Pipe-friendly chained ops: 46 + // 47 + // let _ = playlist.clear(client) 48 + // let _ = playlist.insert_tracks( 49 + // client, ["/Music/a.mp3", "/Music/b.mp3"], types.Last, option.None, 50 + // ) 51 + // let _ = playlist.shuffle(client) 52 + }
+41
sdk/gleam/examples/src/example_05_saved_playlists.gleam
··· 1 + //// 05 — Saved playlists 2 + //// 3 + //// gleam run -m example_05_saved_playlists 4 + 5 + import gleam/int 6 + import gleam/io 7 + import gleam/list 8 + import gleam/option.{None} 9 + import helper 10 + import rockbox/saved_playlists 11 + 12 + pub fn main() { 13 + let client = helper.client() 14 + 15 + let assert Ok(lists) = saved_playlists.list(client, None) 16 + io.println( 17 + "You have " <> int.to_string(list.length(lists)) <> " saved playlist(s):", 18 + ) 19 + 20 + list.each(lists, fn(pl) { 21 + io.println( 22 + " • " 23 + <> pl.name 24 + <> " — " 25 + <> int.to_string(pl.track_count) 26 + <> " tracks (id: " 27 + <> pl.id 28 + <> ")", 29 + ) 30 + }) 31 + 32 + // Create + add tracks + delete (uncomment to demo): 33 + // 34 + // let input = 35 + // saved_playlists.new("Demo") 36 + // |> saved_playlists.with_description("test") 37 + // let assert Ok(pl) = saved_playlists.create(client, input) 38 + // let _ = 39 + // saved_playlists.add_tracks(client, pl.id, ["track-id-1", "track-id-2"]) 40 + // let _ = saved_playlists.delete(client, pl.id) 41 + }
+52
sdk/gleam/examples/src/example_06_smart_playlist.gleam
··· 1 + //// 06 — Smart playlist with the Rules builder 2 + //// 3 + //// gleam run -m example_06_smart_playlist 4 + 5 + import gleam/int 6 + import gleam/io 7 + import gleam/list 8 + import gleam/option.{Some} 9 + import helper 10 + import rockbox/smart_playlists 11 + import rockbox/smart_playlists/rules 12 + 13 + pub fn main() { 14 + let client = helper.client() 15 + 16 + let r = 17 + rules.all_of() 18 + |> rules.where("play_count", rules.Gte, rules.int(1)) 19 + |> rules.sort("play_count", rules.Desc) 20 + |> rules.limit(25) 21 + 22 + let input = 23 + smart_playlists.new("Most played (demo)", rules.to_string(r)) 24 + |> smart_playlists.with_description("Top 25 most-played tracks") 25 + 26 + let assert Ok(sp) = smart_playlists.create(client, input) 27 + io.println("Created smart playlist: " <> sp.id) 28 + 29 + let assert Ok(ids) = smart_playlists.track_ids(client, sp.id) 30 + io.println( 31 + "Currently resolves to " <> int.to_string(list.length(ids)) <> " tracks", 32 + ) 33 + 34 + case list.first(ids) { 35 + Ok(top_id) -> 36 + case smart_playlists.track_stats(client, top_id) { 37 + Ok(Some(stats)) -> 38 + io.println( 39 + "Top track stats: played " 40 + <> int.to_string(stats.play_count) 41 + <> "× (skipped " 42 + <> int.to_string(stats.skip_count) 43 + <> "×)", 44 + ) 45 + _ -> Nil 46 + } 47 + Error(_) -> Nil 48 + } 49 + 50 + let _ = smart_playlists.delete(client, sp.id) 51 + io.println("Cleaned up demo smart playlist.") 52 + }
+29
sdk/gleam/examples/src/example_07_volume_control.gleam
··· 1 + //// 07 — Volume control 2 + //// 3 + //// gleam run -m example_07_volume_control 4 + 5 + import gleam/int 6 + import gleam/io 7 + import helper 8 + import rockbox/sound 9 + 10 + pub fn main() { 11 + let client = helper.client() 12 + 13 + let assert Ok(vol) = sound.get_volume(client) 14 + io.println( 15 + "Current: " 16 + <> int.to_string(vol.volume) 17 + <> " (range " 18 + <> int.to_string(vol.min) 19 + <> ".." 20 + <> int.to_string(vol.max) 21 + <> ")", 22 + ) 23 + 24 + let assert Ok(after_up) = sound.volume_up(client) 25 + io.println("After +1: " <> int.to_string(after_up)) 26 + 27 + let assert Ok(_) = sound.volume_down(client) 28 + io.println("Reverted.") 29 + }
+49
sdk/gleam/examples/src/example_08_eq_config.gleam
··· 1 + //// 08 — EQ configuration 2 + //// 3 + //// Enable the equalizer with a 5-band bass-boost / presence-cut profile. 4 + //// 5 + //// gleam run -m example_08_eq_config 6 + 7 + import gleam/bool 8 + import gleam/int 9 + import gleam/io 10 + import gleam/list 11 + import helper 12 + import rockbox/settings 13 + import rockbox/types.{EqBandSetting} 14 + 15 + pub fn main() { 16 + let client = helper.client() 17 + 18 + let bands = [ 19 + EqBandSetting(cutoff: 60, q: 7, gain: 3), 20 + EqBandSetting(cutoff: 200, q: 7, gain: 0), 21 + EqBandSetting(cutoff: 800, q: 7, gain: 0), 22 + EqBandSetting(cutoff: 4000, q: 7, gain: -2), 23 + EqBandSetting(cutoff: 12_000, q: 7, gain: 1), 24 + ] 25 + 26 + let patch = 27 + settings.patch() 28 + |> settings.set_eq_enabled(True) 29 + |> settings.set_eq_precut(-3) 30 + |> settings.set_eq_bands(bands) 31 + 32 + let assert Ok(_) = settings.save(client, patch) 33 + 34 + let assert Ok(s) = settings.get(client) 35 + io.println("EQ enabled: " <> bool.to_string(s.eq_enabled)) 36 + io.println("EQ precut: " <> int.to_string(s.eq_precut)) 37 + 38 + list.each(s.eq_band_settings, fn(b) { 39 + io.println( 40 + " " 41 + <> helper.pad_int(b.cutoff, 6) 42 + <> " Hz q=" 43 + <> int.to_string(b.q) 44 + <> " " 45 + <> int.to_string(b.gain) 46 + <> " dB", 47 + ) 48 + }) 49 + }
+29
sdk/gleam/examples/src/example_09_browse_filesystem.gleam
··· 1 + //// 09 — Browse the filesystem 2 + //// 3 + //// Set `browse_path` to `Some("/Music/Pink Floyd")` to walk a sub-directory, 4 + //// or leave it as `None` to list the configured `music_dir` root. 5 + //// 6 + //// gleam run -m example_09_browse_filesystem 7 + 8 + import gleam/io 9 + import gleam/list 10 + import gleam/option.{type Option, None} 11 + import helper 12 + import rockbox/browse 13 + import rockbox/types 14 + 15 + const browse_path: Option(String) = None 16 + 17 + pub fn main() { 18 + let client = helper.client() 19 + 20 + let assert Ok(entries) = browse.entries(client, browse_path) 21 + 22 + list.each(entries, fn(e) { 23 + let icon = case types.is_directory(e) { 24 + True -> "[dir] " 25 + False -> " " 26 + } 27 + io.println(icon <> e.name) 28 + }) 29 + }
+46
sdk/gleam/examples/src/example_10_devices.gleam
··· 1 + //// 10 — List remote output devices (Chromecast / AirPlay / …) 2 + //// 3 + //// gleam run -m example_10_devices 4 + 5 + import gleam/int 6 + import gleam/io 7 + import gleam/list 8 + import helper 9 + import rockbox/devices 10 + import rockbox/types.{type Device} 11 + 12 + pub fn main() { 13 + let client = helper.client() 14 + let assert Ok(found) = devices.list(client) 15 + 16 + io.println( 17 + "Discovered " <> int.to_string(list.length(found)) <> " device(s):", 18 + ) 19 + 20 + list.each(found, fn(d) { 21 + let status = case d.is_connected { 22 + True -> "● connected" 23 + False -> "○ available" 24 + } 25 + io.println( 26 + " [" 27 + <> device_kind(d) 28 + <> "] " 29 + <> d.name 30 + <> " (" 31 + <> d.ip 32 + <> ":" 33 + <> int.to_string(d.port) 34 + <> ") — " 35 + <> status, 36 + ) 37 + }) 38 + } 39 + 40 + fn device_kind(d: Device) -> String { 41 + case d.is_cast_device, d.is_source_device { 42 + True, _ -> "Cast" 43 + False, True -> "Source" 44 + False, False -> "Other" 45 + } 46 + }
+67
sdk/gleam/examples/src/example_11_bluetooth.gleam
··· 1 + //// 11 — Bluetooth (Linux only) 2 + //// 3 + //// Lists paired devices. Uncomment one of the blocks at the bottom to scan 4 + //// or connect/disconnect a specific address. 5 + //// 6 + //// gleam run -m example_11_bluetooth 7 + 8 + import gleam/int 9 + import gleam/io 10 + import gleam/list 11 + import gleam/option.{None, Some} 12 + import gleam/string 13 + import helper 14 + import rockbox/bluetooth 15 + import rockbox/types.{type BluetoothDevice} 16 + 17 + pub fn main() { 18 + let client = helper.client() 19 + 20 + let assert Ok(devices) = bluetooth.devices(client) 21 + io.println( 22 + "Paired devices (" <> int.to_string(list.length(devices)) <> "):", 23 + ) 24 + list.each(devices, fn(d) { io.println(format_device(d)) }) 25 + 26 + // Scan for 10 seconds: 27 + // 28 + // let assert Ok(found) = bluetooth.scan(client, Some(10)) 29 + // list.each(found, fn(d) { io.println(format_device(d)) }) 30 + 31 + // Connect / disconnect a specific address: 32 + // 33 + // let _ = bluetooth.connect(client, "AA:BB:CC:DD:EE:FF") 34 + // let _ = bluetooth.disconnect(client, "AA:BB:CC:DD:EE:FF") 35 + } 36 + 37 + fn format_device(d: BluetoothDevice) -> String { 38 + let flags = 39 + [ 40 + flag(d.connected, "connected"), 41 + flag(d.paired, "paired"), 42 + flag(d.trusted, "trusted"), 43 + ] 44 + |> list.filter_map(fn(x) { x }) 45 + |> string.join(", ") 46 + 47 + let rssi = case d.rssi { 48 + Some(v) -> " " <> int.to_string(v) <> " dBm" 49 + None -> "" 50 + } 51 + 52 + " " 53 + <> d.address 54 + <> " " 55 + <> string.pad_end(d.name, 28, " ") 56 + <> rssi 57 + <> " [" 58 + <> flags 59 + <> "]" 60 + } 61 + 62 + fn flag(condition: Bool, label: String) -> Result(String, Nil) { 63 + case condition { 64 + True -> Ok(label) 65 + False -> Error(Nil) 66 + } 67 + }
+55
sdk/gleam/examples/src/example_12_sleep_timer.gleam
··· 1 + //// 12 — Sleep timer 2 + //// 3 + //// Polling-based version of the Elixir plugin example: stops playback after 4 + //// `minutes` minutes, but bails out early if playback was stopped manually. 5 + //// 6 + //// The Gleam SDK has no plugin/event-bus yet, so this is a straight loop — 7 + //// short-circuiting via early return when status flips to Stopped. 8 + //// 9 + //// gleam run -m example_12_sleep_timer 10 + 11 + import gleam/erlang/process 12 + import gleam/int 13 + import gleam/io 14 + import helper 15 + import rockbox.{type Client} 16 + import rockbox/playback 17 + import rockbox/types 18 + 19 + const minutes: Int = 30 20 + 21 + const tick_ms: Int = 1000 22 + 23 + pub fn main() { 24 + let client = helper.client() 25 + let total_ticks = minutes * 60 26 + 27 + io.println( 28 + "💤 Sleep timer armed — stopping playback in " 29 + <> int.to_string(minutes) 30 + <> " minute(s).", 31 + ) 32 + 33 + loop(client, total_ticks) 34 + } 35 + 36 + fn loop(client: Client, ticks_remaining: Int) { 37 + case ticks_remaining { 38 + n if n <= 0 -> { 39 + io.println("💤 Time's up — stopping playback.") 40 + let _ = playback.stop(client) 41 + Nil 42 + } 43 + _ -> 44 + case playback.status(client) { 45 + Ok(types.Stopped) -> { 46 + io.println("💤 Playback stopped manually — sleep timer cancelled.") 47 + Nil 48 + } 49 + _ -> { 50 + process.sleep(tick_ms) 51 + loop(client, ticks_remaining - 1) 52 + } 53 + } 54 + } 55 + }
+69
sdk/gleam/examples/src/example_13_raw_query.gleam
··· 1 + //// 13 — Raw GraphQL escape hatch 2 + //// 3 + //// For operations the SDK doesn't expose directly, drop down to 4 + //// `rockbox.query/4` and supply your own decoder. 5 + //// 6 + //// gleam run -m example_13_raw_query 7 + 8 + import gleam/dynamic/decode 9 + import gleam/int 10 + import gleam/io 11 + import gleam/json 12 + import gleam/option.{Some} 13 + import helper 14 + import rockbox 15 + 16 + pub fn main() { 17 + let client = helper.client() 18 + 19 + let version_decoder = { 20 + use v <- decode.field("rockboxVersion", decode.string) 21 + decode.success(v) 22 + } 23 + 24 + let assert Ok(version) = 25 + rockbox.query( 26 + client, 27 + "query Version { rockboxVersion }", 28 + json.object([]), 29 + version_decoder, 30 + ) 31 + io.println("rockboxd " <> version) 32 + 33 + let album_decoder = { 34 + use album <- decode.field( 35 + "album", 36 + decode.optional({ 37 + use id <- decode.field("id", decode.string) 38 + use title <- decode.optional_field("title", "", decode.string) 39 + use artist <- decode.optional_field("artist", "", decode.string) 40 + use year <- decode.optional_field("year", 0, decode.int) 41 + decode.success(#(id, title, artist, year)) 42 + }), 43 + ) 44 + decode.success(album) 45 + } 46 + 47 + case 48 + rockbox.query( 49 + client, 50 + "query Album($id: String!) { album(id: $id) { id title artist year } }", 51 + json.object([#("id", json.string("demo-id-or-use-a-real-one"))]), 52 + album_decoder, 53 + ) 54 + { 55 + Ok(Some(#(id, title, artist, year))) -> 56 + io.println( 57 + "album: id=" 58 + <> id 59 + <> " title=" 60 + <> title 61 + <> " artist=" 62 + <> artist 63 + <> " year=" 64 + <> int.to_string(year), 65 + ) 66 + Ok(_) -> io.println("album: (not found)") 67 + Error(_) -> io.println("album: query failed") 68 + } 69 + }
+28
sdk/gleam/examples/src/helper.gleam
··· 1 + //// Shared helpers for the example modules. 2 + //// 3 + //// Edit `client()` to point at a different host/port if your `rockboxd` is 4 + //// not running on `localhost:6062`. 5 + 6 + import gleam/int 7 + import gleam/string 8 + import rockbox.{type Client} 9 + 10 + pub fn client() -> Client { 11 + rockbox.new() 12 + |> rockbox.host("localhost") 13 + |> rockbox.port(6062) 14 + |> rockbox.connect 15 + } 16 + 17 + /// Format a duration in milliseconds as `M:SS`. 18 + pub fn fmt_ms(ms: Int) -> String { 19 + let total_secs = ms / 1000 20 + let mins = total_secs / 60 21 + let secs = total_secs % 60 22 + int.to_string(mins) <> ":" <> string.pad_start(int.to_string(secs), 2, "0") 23 + } 24 + 25 + /// Pad an integer to a left-aligned width-N string for tabular output. 26 + pub fn pad_int(value: Int, width: Int) -> String { 27 + string.pad_start(int.to_string(value), width, " ") 28 + }
+257
sdk/gleam/src/rockbox/smart_playlists/rules.gleam
··· 1 + //// Composable builder for smart-playlist rule sets. Pipe-friendly. 2 + //// 3 + //// ```gleam 4 + //// import rockbox/smart_playlists 5 + //// import rockbox/smart_playlists/rules 6 + //// 7 + //// let r = 8 + //// rules.all_of() 9 + //// |> rules.where("play_count", rules.Gte, rules.int(10)) 10 + //// |> rules.where("last_played", rules.Within, rules.string("30d")) 11 + //// |> rules.sort("play_count", rules.Desc) 12 + //// |> rules.limit(50) 13 + //// 14 + //// let input = smart_playlists.new("Most played", rules.to_string(r)) 15 + //// let assert Ok(_) = smart_playlists.create(client, input) 16 + //// ``` 17 + //// 18 + //// `any_of()` swaps the top-level operator from `AND` to `OR`. Mix the two by 19 + //// nesting builders with `where_group`: 20 + //// 21 + //// ```gleam 22 + //// let r = 23 + //// rules.all_of() 24 + //// |> rules.where("genre", rules.Eq, rules.string("Rock")) 25 + //// |> rules.where_group( 26 + //// rules.any_of() 27 + //// |> rules.where("year", rules.Gte, rules.int(2000)) 28 + //// |> rules.where("year", rules.Lte, rules.int(2010)), 29 + //// ) 30 + //// ``` 31 + 32 + import gleam/json.{type Json} 33 + import gleam/list 34 + import gleam/option.{type Option, None, Some} 35 + 36 + // --------------------------------------------------------------------------- 37 + // Types 38 + // --------------------------------------------------------------------------- 39 + 40 + /// A composable rule set. Build with `all_of` / `any_of` and chain 41 + /// `where` / `sort` / `limit`. Hand to `to_string` to get the JSON payload 42 + /// the GraphQL `createSmartPlaylist` mutation expects. 43 + pub opaque type Rules { 44 + Rules( 45 + operator: GroupOp, 46 + rules: List(Node), 47 + sort: Option(Sort), 48 + limit: Option(Int), 49 + ) 50 + } 51 + 52 + /// How sibling rules combine. 53 + pub type GroupOp { 54 + And 55 + Or 56 + } 57 + 58 + /// Comparison operators understood by the server. 59 + /// 60 + /// | Variant | Meaning | 61 + /// |-------------|----------------------------------------| 62 + /// | `Eq` | equals | 63 + /// | `Neq` | not equals | 64 + /// | `Gt` | greater than | 65 + /// | `Gte` | greater than or equal | 66 + /// | `Lt` | less than | 67 + /// | `Lte` | less than or equal | 68 + /// | `Contains` | substring match | 69 + /// | `Within` | duration window (e.g. `"30d"`, `"7d"`) | 70 + pub type Op { 71 + Eq 72 + Neq 73 + Gt 74 + Gte 75 + Lt 76 + Lte 77 + Contains 78 + Within 79 + } 80 + 81 + /// Sort direction. 82 + pub type SortDir { 83 + Asc 84 + Desc 85 + } 86 + 87 + /// Wrapped value handed to `where`. Build with `int` / `string` / `bool` / 88 + /// `float` / `null`, or `raw` if you have a `Json` already. 89 + pub opaque type Value { 90 + Value(Json) 91 + } 92 + 93 + type Sort { 94 + Sort(field: String, dir: SortDir) 95 + } 96 + 97 + type Node { 98 + Leaf(field: String, op: Op, value: Json) 99 + Group(Rules) 100 + } 101 + 102 + // --------------------------------------------------------------------------- 103 + // Value constructors 104 + // --------------------------------------------------------------------------- 105 + 106 + /// Wrap an integer (e.g. play counts, years, durations in ms). 107 + pub fn int(value: Int) -> Value { 108 + Value(json.int(value)) 109 + } 110 + 111 + /// Wrap a string (e.g. titles, artists, genres, duration windows). 112 + pub fn string(value: String) -> Value { 113 + Value(json.string(value)) 114 + } 115 + 116 + /// Wrap a boolean. 117 + pub fn bool(value: Bool) -> Value { 118 + Value(json.bool(value)) 119 + } 120 + 121 + /// Wrap a float. 122 + pub fn float(value: Float) -> Value { 123 + Value(json.float(value)) 124 + } 125 + 126 + /// JSON `null`. 127 + pub fn null() -> Value { 128 + Value(json.null()) 129 + } 130 + 131 + /// Escape hatch for arbitrary JSON values (arrays, nested objects, etc.). 132 + pub fn raw(value: Json) -> Value { 133 + Value(value) 134 + } 135 + 136 + // --------------------------------------------------------------------------- 137 + // Builders 138 + // --------------------------------------------------------------------------- 139 + 140 + /// Start a builder where every rule must match (logical AND). 141 + pub fn all_of() -> Rules { 142 + Rules(operator: And, rules: [], sort: None, limit: None) 143 + } 144 + 145 + /// Start a builder where any single rule must match (logical OR). 146 + pub fn any_of() -> Rules { 147 + Rules(operator: Or, rules: [], sort: None, limit: None) 148 + } 149 + 150 + /// Append a rule to the current group. 151 + pub fn where( 152 + builder: Rules, 153 + field: String, 154 + op: Op, 155 + value: Value, 156 + ) -> Rules { 157 + let Value(json_value) = value 158 + let leaf = Leaf(field: field, op: op, value: json_value) 159 + Rules(..builder, rules: list.append(builder.rules, [leaf])) 160 + } 161 + 162 + /// Nest another builder underneath this one. Useful for mixing AND / OR. 163 + pub fn where_group(parent: Rules, child: Rules) -> Rules { 164 + Rules(..parent, rules: list.append(parent.rules, [Group(child)])) 165 + } 166 + 167 + /// Set the result ordering. 168 + pub fn sort(builder: Rules, field: String, direction: SortDir) -> Rules { 169 + Rules(..builder, sort: Some(Sort(field: field, dir: direction))) 170 + } 171 + 172 + /// Cap the result count. 173 + pub fn limit(builder: Rules, count: Int) -> Rules { 174 + Rules(..builder, limit: Some(count)) 175 + } 176 + 177 + // --------------------------------------------------------------------------- 178 + // Rendering 179 + // --------------------------------------------------------------------------- 180 + 181 + /// Encode the builder as a `Json` value — useful if you're already working 182 + /// with JSON values. 183 + pub fn to_json(builder: Rules) -> Json { 184 + let base = [ 185 + #("operator", json.string(group_op_to_string(builder.operator))), 186 + #("rules", json.array(builder.rules, node_to_json)), 187 + ] 188 + 189 + let with_sort = case builder.sort { 190 + Some(Sort(field, dir)) -> 191 + list.append(base, [ 192 + #( 193 + "sort", 194 + json.object([ 195 + #("field", json.string(field)), 196 + #("dir", json.string(sort_dir_to_string(dir))), 197 + ]), 198 + ), 199 + ]) 200 + None -> base 201 + } 202 + 203 + let with_limit = case builder.limit { 204 + Some(n) -> list.append(with_sort, [#("limit", json.int(n))]) 205 + None -> with_sort 206 + } 207 + 208 + json.object(with_limit) 209 + } 210 + 211 + /// Encode the builder as a JSON string ready for the smart-playlist mutation. 212 + pub fn to_string(builder: Rules) -> String { 213 + json.to_string(to_json(builder)) 214 + } 215 + 216 + // --------------------------------------------------------------------------- 217 + // Internal encoding 218 + // --------------------------------------------------------------------------- 219 + 220 + fn node_to_json(node: Node) -> Json { 221 + case node { 222 + Leaf(field, op, value) -> 223 + json.object([ 224 + #("field", json.string(field)), 225 + #("op", json.string(op_to_string(op))), 226 + #("value", value), 227 + ]) 228 + Group(child) -> to_json(child) 229 + } 230 + } 231 + 232 + fn group_op_to_string(op: GroupOp) -> String { 233 + case op { 234 + And -> "AND" 235 + Or -> "OR" 236 + } 237 + } 238 + 239 + fn op_to_string(op: Op) -> String { 240 + case op { 241 + Eq -> "eq" 242 + Neq -> "neq" 243 + Gt -> "gt" 244 + Gte -> "gte" 245 + Lt -> "lt" 246 + Lte -> "lte" 247 + Contains -> "contains" 248 + Within -> "within" 249 + } 250 + } 251 + 252 + fn sort_dir_to_string(dir: SortDir) -> String { 253 + case dir { 254 + Asc -> "asc" 255 + Desc -> "desc" 256 + } 257 + }
+41
sdk/gleam/test/rockbox_test.gleam
··· 1 1 import gleam/option 2 2 import gleeunit 3 3 import rockbox 4 + import rockbox/smart_playlists/rules 4 5 import rockbox/types 5 6 6 7 pub fn main() -> Nil { ··· 75 76 assert types.is_directory(dir) 76 77 assert !types.is_directory(file) 77 78 } 79 + 80 + pub fn rules_basic_test() { 81 + let r = 82 + rules.all_of() 83 + |> rules.where("play_count", rules.Gte, rules.int(10)) 84 + |> rules.sort("play_count", rules.Desc) 85 + |> rules.limit(50) 86 + 87 + assert rules.to_string(r) 88 + == "{\"operator\":\"AND\",\"rules\":[{\"field\":\"play_count\",\"op\":\"gte\",\"value\":10}],\"sort\":{\"field\":\"play_count\",\"dir\":\"desc\"},\"limit\":50}" 89 + } 90 + 91 + pub fn rules_any_of_test() { 92 + let r = 93 + rules.any_of() 94 + |> rules.where("genre", rules.Eq, rules.string("Rock")) 95 + |> rules.where("genre", rules.Eq, rules.string("Jazz")) 96 + 97 + assert rules.to_string(r) 98 + == "{\"operator\":\"OR\",\"rules\":[{\"field\":\"genre\",\"op\":\"eq\",\"value\":\"Rock\"},{\"field\":\"genre\",\"op\":\"eq\",\"value\":\"Jazz\"}]}" 99 + } 100 + 101 + pub fn rules_nested_group_test() { 102 + let r = 103 + rules.all_of() 104 + |> rules.where("genre", rules.Eq, rules.string("Rock")) 105 + |> rules.where_group( 106 + rules.any_of() 107 + |> rules.where("year", rules.Gte, rules.int(2000)) 108 + |> rules.where("year", rules.Lte, rules.int(2010)), 109 + ) 110 + 111 + assert rules.to_string(r) 112 + == "{\"operator\":\"AND\",\"rules\":[{\"field\":\"genre\",\"op\":\"eq\",\"value\":\"Rock\"},{\"operator\":\"OR\",\"rules\":[{\"field\":\"year\",\"op\":\"gte\",\"value\":2000},{\"field\":\"year\",\"op\":\"lte\",\"value\":2010}]}]}" 113 + } 114 + 115 + pub fn rules_omits_unset_fields_test() { 116 + let r = rules.all_of() 117 + assert rules.to_string(r) == "{\"operator\":\"AND\",\"rules\":[]}" 118 + }