termusiclib/opt/rustwide/target/x86_64-unknown-linux-gnu/debug/build/termusic-lib-9eb0746602d858a8/out/
player.rs

1// This file is @generated by prost-build.
2#[derive(Clone, Copy, PartialEq, ::prost::Message)]
3pub struct Empty {}
4/// A play status.
5#[derive(Clone, Copy, PartialEq, ::prost::Message)]
6pub struct PlayState {
7    /// The actual status, mapped to \[`playback::playlist::Status`\]
8    #[prost(uint32, tag = "1")]
9    pub status: u32,
10}
11#[derive(Clone, Copy, PartialEq, ::prost::Message)]
12pub struct PlayerTime {
13    #[prost(message, optional, tag = "1")]
14    pub position: ::core::option::Option<Duration>,
15    #[prost(message, optional, tag = "2")]
16    pub total_duration: ::core::option::Option<Duration>,
17}
18#[derive(Clone, PartialEq, ::prost::Message)]
19pub struct GetProgressResponse {
20    #[prost(message, optional, tag = "1")]
21    pub progress: ::core::option::Option<PlayerTime>,
22    #[prost(uint64, tag = "3")]
23    pub current_track_index: u64,
24    #[prost(uint32, tag = "4")]
25    pub status: u32,
26    /// actually a u16, but protobuf does not support types lower than 32 bits
27    #[prost(uint32, tag = "5")]
28    pub volume: u32,
29    #[prost(int32, tag = "6")]
30    pub speed: i32,
31    #[prost(bool, tag = "7")]
32    pub gapless: bool,
33    #[prost(bool, tag = "8")]
34    pub current_track_updated: bool,
35    #[prost(string, tag = "9")]
36    pub radio_title: ::prost::alloc::string::String,
37}
38#[derive(Clone, Copy, PartialEq, ::prost::Message)]
39pub struct VolumeReply {
40    /// actually a u16, but protobuf does not support types lower than 32 bits
41    #[prost(uint32, tag = "1")]
42    pub volume: u32,
43}
44#[derive(Clone, Copy, PartialEq, ::prost::Message)]
45pub struct SpeedReply {
46    #[prost(int32, tag = "1")]
47    pub speed: i32,
48}
49/// A Gapless state.
50#[derive(Clone, Copy, PartialEq, ::prost::Message)]
51pub struct GaplessState {
52    #[prost(bool, tag = "1")]
53    pub gapless: bool,
54}
55/// using a custom Duration that matches rust's definition, as rust's may not fit
56/// into google's well-known Duration
57#[derive(Clone, Copy, PartialEq, ::prost::Message)]
58pub struct Duration {
59    #[prost(uint64, tag = "1")]
60    pub secs: u64,
61    #[prost(uint32, tag = "2")]
62    pub nanos: u32,
63}
64/// all updates that can happen from the server side, without the client to have to ask explicitly
65/// naming convention for the stream update specific messages is to add the "Update" prefix, even if it already exists
66#[derive(Clone, PartialEq, ::prost::Message)]
67pub struct StreamUpdates {
68    #[prost(oneof = "stream_updates::Type", tags = "1, 2, 3, 4, 5, 6")]
69    pub r#type: ::core::option::Option<stream_updates::Type>,
70}
71/// Nested message and enum types in `StreamUpdates`.
72pub mod stream_updates {
73    #[derive(Clone, PartialEq, ::prost::Oneof)]
74    pub enum Type {
75        #[prost(message, tag = "1")]
76        MissedEvents(super::UpdateMissedEvents),
77        #[prost(message, tag = "2")]
78        VolumeChanged(super::UpdateVolumeChanged),
79        #[prost(message, tag = "3")]
80        SpeedChanged(super::UpdateSpeedChanged),
81        #[prost(message, tag = "4")]
82        PlayStateChanged(super::UpdatePlayStateChanged),
83        #[prost(message, tag = "5")]
84        TrackChanged(super::UpdateTrackChanged),
85        #[prost(message, tag = "6")]
86        GaplessChanged(super::UpdateGaplessChanged),
87    }
88}
89/// Indicate that some events could not be send
90/// Like a "Lagged" Error from tokio-stream
91#[derive(Clone, Copy, PartialEq, ::prost::Message)]
92pub struct UpdateMissedEvents {
93    #[prost(uint64, tag = "1")]
94    pub amount: u64,
95}
96/// The Volume changed, send new information
97#[derive(Clone, Copy, PartialEq, ::prost::Message)]
98pub struct UpdateVolumeChanged {
99    /// reuse the existing message
100    #[prost(message, optional, tag = "1")]
101    pub msg: ::core::option::Option<VolumeReply>,
102}
103/// The Speed changed, send new information
104#[derive(Clone, Copy, PartialEq, ::prost::Message)]
105pub struct UpdateSpeedChanged {
106    /// reuse the existing message
107    #[prost(message, optional, tag = "1")]
108    pub msg: ::core::option::Option<SpeedReply>,
109}
110/// TODO: is play-state (playing / paused / ??) the only things this should do?
111#[derive(Clone, Copy, PartialEq, ::prost::Message)]
112pub struct UpdatePlayStateChanged {
113    /// reuse the existing message
114    #[prost(message, optional, tag = "1")]
115    pub msg: ::core::option::Option<PlayState>,
116}
117/// The Gapless state changed, send new information.
118#[derive(Clone, Copy, PartialEq, ::prost::Message)]
119pub struct UpdateGaplessChanged {
120    /// reuse the existing message
121    #[prost(message, optional, tag = "1")]
122    pub msg: ::core::option::Option<GaplessState>,
123}
124/// The track changed in some way, send new information
125/// This includes everything from changing to a new track, new radio title, etc
126/// This is *not* used for regular track progress updates
127/// NOTE: this may or may not be sent for the initial track after startup as the client may connect after the track started
128#[derive(Clone, PartialEq, ::prost::Message)]
129pub struct UpdateTrackChanged {
130    /// The index into the playlist of which track changed.
131    #[prost(uint64, tag = "1")]
132    pub current_track_index: u64,
133    /// Indicates if this update is a change to a new track (not just metadata change)
134    #[prost(bool, tag = "2")]
135    pub current_track_updated: bool,
136    #[prost(message, optional, tag = "4")]
137    pub progress: ::core::option::Option<PlayerTime>,
138    /// all values below should be moved into their own "Track" message at some point
139    /// instead of having the TUI fetch everything from the file itself
140    /// radio title, track title
141    /// the following is (linux protobuf) 3.15, ubuntu 2204 still has (linux protobuf) 3.12
142    /// optional string title = 3;
143    /// the following "oneof" is wire equivalent to the above "optional"
144    #[prost(oneof = "update_track_changed::OptionalTitle", tags = "3")]
145    pub optional_title: ::core::option::Option<update_track_changed::OptionalTitle>,
146}
147/// Nested message and enum types in `UpdateTrackChanged`.
148pub mod update_track_changed {
149    /// all values below should be moved into their own "Track" message at some point
150    /// instead of having the TUI fetch everything from the file itself
151    /// radio title, track title
152    /// the following is (linux protobuf) 3.15, ubuntu 2204 still has (linux protobuf) 3.12
153    /// optional string title = 3;
154    /// the following "oneof" is wire equivalent to the above "optional"
155    #[derive(Clone, PartialEq, ::prost::Oneof)]
156    pub enum OptionalTitle {
157        #[prost(string, tag = "3")]
158        Title(::prost::alloc::string::String),
159    }
160}
161/// The current Loop mode for the playlist
162#[derive(Clone, Copy, PartialEq, ::prost::Message)]
163pub struct PlaylistLoopMode {
164    /// The actual mode, mapped to \[`config::v2::server::LoopMode`\]
165    #[prost(uint32, tag = "1")]
166    pub mode: u32,
167}
168/// Generated client implementations.
169pub mod music_player_client {
170    #![allow(
171        unused_variables,
172        dead_code,
173        missing_docs,
174        clippy::wildcard_imports,
175        clippy::let_unit_value,
176    )]
177    use tonic::codegen::*;
178    use tonic::codegen::http::Uri;
179    #[derive(Debug, Clone)]
180    pub struct MusicPlayerClient<T> {
181        inner: tonic::client::Grpc<T>,
182    }
183    impl MusicPlayerClient<tonic::transport::Channel> {
184        /// Attempt to create a new client by connecting to a given endpoint.
185        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
186        where
187            D: TryInto<tonic::transport::Endpoint>,
188            D::Error: Into<StdError>,
189        {
190            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
191            Ok(Self::new(conn))
192        }
193    }
194    impl<T> MusicPlayerClient<T>
195    where
196        T: tonic::client::GrpcService<tonic::body::BoxBody>,
197        T::Error: Into<StdError>,
198        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
199        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
200    {
201        pub fn new(inner: T) -> Self {
202            let inner = tonic::client::Grpc::new(inner);
203            Self { inner }
204        }
205        pub fn with_origin(inner: T, origin: Uri) -> Self {
206            let inner = tonic::client::Grpc::with_origin(inner, origin);
207            Self { inner }
208        }
209        pub fn with_interceptor<F>(
210            inner: T,
211            interceptor: F,
212        ) -> MusicPlayerClient<InterceptedService<T, F>>
213        where
214            F: tonic::service::Interceptor,
215            T::ResponseBody: Default,
216            T: tonic::codegen::Service<
217                http::Request<tonic::body::BoxBody>,
218                Response = http::Response<
219                    <T as tonic::client::GrpcService<tonic::body::BoxBody>>::ResponseBody,
220                >,
221            >,
222            <T as tonic::codegen::Service<
223                http::Request<tonic::body::BoxBody>,
224            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
225        {
226            MusicPlayerClient::new(InterceptedService::new(inner, interceptor))
227        }
228        /// Compress requests with the given encoding.
229        ///
230        /// This requires the server to support it otherwise it might respond with an
231        /// error.
232        #[must_use]
233        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
234            self.inner = self.inner.send_compressed(encoding);
235            self
236        }
237        /// Enable decompressing responses.
238        #[must_use]
239        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
240            self.inner = self.inner.accept_compressed(encoding);
241            self
242        }
243        /// Limits the maximum size of a decoded message.
244        ///
245        /// Default: `4MB`
246        #[must_use]
247        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
248            self.inner = self.inner.max_decoding_message_size(limit);
249            self
250        }
251        /// Limits the maximum size of an encoded message.
252        ///
253        /// Default: `usize::MAX`
254        #[must_use]
255        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
256            self.inner = self.inner.max_encoding_message_size(limit);
257            self
258        }
259        /// Player Commands
260        /// Toggle Pause/Play, returns the new state
261        pub async fn toggle_pause(
262            &mut self,
263            request: impl tonic::IntoRequest<super::Empty>,
264        ) -> std::result::Result<tonic::Response<super::PlayState>, tonic::Status> {
265            self.inner
266                .ready()
267                .await
268                .map_err(|e| {
269                    tonic::Status::unknown(
270                        format!("Service was not ready: {}", e.into()),
271                    )
272                })?;
273            let codec = tonic::codec::ProstCodec::default();
274            let path = http::uri::PathAndQuery::from_static(
275                "/player.MusicPlayer/TogglePause",
276            );
277            let mut req = request.into_request();
278            req.extensions_mut()
279                .insert(GrpcMethod::new("player.MusicPlayer", "TogglePause"));
280            self.inner.unary(req, path, codec).await
281        }
282        pub async fn skip_next(
283            &mut self,
284            request: impl tonic::IntoRequest<super::Empty>,
285        ) -> std::result::Result<tonic::Response<super::Empty>, tonic::Status> {
286            self.inner
287                .ready()
288                .await
289                .map_err(|e| {
290                    tonic::Status::unknown(
291                        format!("Service was not ready: {}", e.into()),
292                    )
293                })?;
294            let codec = tonic::codec::ProstCodec::default();
295            let path = http::uri::PathAndQuery::from_static(
296                "/player.MusicPlayer/SkipNext",
297            );
298            let mut req = request.into_request();
299            req.extensions_mut()
300                .insert(GrpcMethod::new("player.MusicPlayer", "SkipNext"));
301            self.inner.unary(req, path, codec).await
302        }
303        pub async fn skip_previous(
304            &mut self,
305            request: impl tonic::IntoRequest<super::Empty>,
306        ) -> std::result::Result<tonic::Response<super::Empty>, tonic::Status> {
307            self.inner
308                .ready()
309                .await
310                .map_err(|e| {
311                    tonic::Status::unknown(
312                        format!("Service was not ready: {}", e.into()),
313                    )
314                })?;
315            let codec = tonic::codec::ProstCodec::default();
316            let path = http::uri::PathAndQuery::from_static(
317                "/player.MusicPlayer/SkipPrevious",
318            );
319            let mut req = request.into_request();
320            req.extensions_mut()
321                .insert(GrpcMethod::new("player.MusicPlayer", "SkipPrevious"));
322            self.inner.unary(req, path, codec).await
323        }
324        pub async fn get_progress(
325            &mut self,
326            request: impl tonic::IntoRequest<super::Empty>,
327        ) -> std::result::Result<
328            tonic::Response<super::GetProgressResponse>,
329            tonic::Status,
330        > {
331            self.inner
332                .ready()
333                .await
334                .map_err(|e| {
335                    tonic::Status::unknown(
336                        format!("Service was not ready: {}", e.into()),
337                    )
338                })?;
339            let codec = tonic::codec::ProstCodec::default();
340            let path = http::uri::PathAndQuery::from_static(
341                "/player.MusicPlayer/GetProgress",
342            );
343            let mut req = request.into_request();
344            req.extensions_mut()
345                .insert(GrpcMethod::new("player.MusicPlayer", "GetProgress"));
346            self.inner.unary(req, path, codec).await
347        }
348        pub async fn volume_up(
349            &mut self,
350            request: impl tonic::IntoRequest<super::Empty>,
351        ) -> std::result::Result<tonic::Response<super::VolumeReply>, tonic::Status> {
352            self.inner
353                .ready()
354                .await
355                .map_err(|e| {
356                    tonic::Status::unknown(
357                        format!("Service was not ready: {}", e.into()),
358                    )
359                })?;
360            let codec = tonic::codec::ProstCodec::default();
361            let path = http::uri::PathAndQuery::from_static(
362                "/player.MusicPlayer/VolumeUp",
363            );
364            let mut req = request.into_request();
365            req.extensions_mut()
366                .insert(GrpcMethod::new("player.MusicPlayer", "VolumeUp"));
367            self.inner.unary(req, path, codec).await
368        }
369        pub async fn volume_down(
370            &mut self,
371            request: impl tonic::IntoRequest<super::Empty>,
372        ) -> std::result::Result<tonic::Response<super::VolumeReply>, tonic::Status> {
373            self.inner
374                .ready()
375                .await
376                .map_err(|e| {
377                    tonic::Status::unknown(
378                        format!("Service was not ready: {}", e.into()),
379                    )
380                })?;
381            let codec = tonic::codec::ProstCodec::default();
382            let path = http::uri::PathAndQuery::from_static(
383                "/player.MusicPlayer/VolumeDown",
384            );
385            let mut req = request.into_request();
386            req.extensions_mut()
387                .insert(GrpcMethod::new("player.MusicPlayer", "VolumeDown"));
388            self.inner.unary(req, path, codec).await
389        }
390        pub async fn speed_up(
391            &mut self,
392            request: impl tonic::IntoRequest<super::Empty>,
393        ) -> std::result::Result<tonic::Response<super::SpeedReply>, tonic::Status> {
394            self.inner
395                .ready()
396                .await
397                .map_err(|e| {
398                    tonic::Status::unknown(
399                        format!("Service was not ready: {}", e.into()),
400                    )
401                })?;
402            let codec = tonic::codec::ProstCodec::default();
403            let path = http::uri::PathAndQuery::from_static(
404                "/player.MusicPlayer/SpeedUp",
405            );
406            let mut req = request.into_request();
407            req.extensions_mut()
408                .insert(GrpcMethod::new("player.MusicPlayer", "SpeedUp"));
409            self.inner.unary(req, path, codec).await
410        }
411        pub async fn speed_down(
412            &mut self,
413            request: impl tonic::IntoRequest<super::Empty>,
414        ) -> std::result::Result<tonic::Response<super::SpeedReply>, tonic::Status> {
415            self.inner
416                .ready()
417                .await
418                .map_err(|e| {
419                    tonic::Status::unknown(
420                        format!("Service was not ready: {}", e.into()),
421                    )
422                })?;
423            let codec = tonic::codec::ProstCodec::default();
424            let path = http::uri::PathAndQuery::from_static(
425                "/player.MusicPlayer/SpeedDown",
426            );
427            let mut req = request.into_request();
428            req.extensions_mut()
429                .insert(GrpcMethod::new("player.MusicPlayer", "SpeedDown"));
430            self.inner.unary(req, path, codec).await
431        }
432        /// Toggle the gapless mdoe, returns the new state.
433        pub async fn toggle_gapless(
434            &mut self,
435            request: impl tonic::IntoRequest<super::Empty>,
436        ) -> std::result::Result<tonic::Response<super::GaplessState>, tonic::Status> {
437            self.inner
438                .ready()
439                .await
440                .map_err(|e| {
441                    tonic::Status::unknown(
442                        format!("Service was not ready: {}", e.into()),
443                    )
444                })?;
445            let codec = tonic::codec::ProstCodec::default();
446            let path = http::uri::PathAndQuery::from_static(
447                "/player.MusicPlayer/ToggleGapless",
448            );
449            let mut req = request.into_request();
450            req.extensions_mut()
451                .insert(GrpcMethod::new("player.MusicPlayer", "ToggleGapless"));
452            self.inner.unary(req, path, codec).await
453        }
454        pub async fn seek_forward(
455            &mut self,
456            request: impl tonic::IntoRequest<super::Empty>,
457        ) -> std::result::Result<tonic::Response<super::PlayerTime>, tonic::Status> {
458            self.inner
459                .ready()
460                .await
461                .map_err(|e| {
462                    tonic::Status::unknown(
463                        format!("Service was not ready: {}", e.into()),
464                    )
465                })?;
466            let codec = tonic::codec::ProstCodec::default();
467            let path = http::uri::PathAndQuery::from_static(
468                "/player.MusicPlayer/SeekForward",
469            );
470            let mut req = request.into_request();
471            req.extensions_mut()
472                .insert(GrpcMethod::new("player.MusicPlayer", "SeekForward"));
473            self.inner.unary(req, path, codec).await
474        }
475        pub async fn seek_backward(
476            &mut self,
477            request: impl tonic::IntoRequest<super::Empty>,
478        ) -> std::result::Result<tonic::Response<super::PlayerTime>, tonic::Status> {
479            self.inner
480                .ready()
481                .await
482                .map_err(|e| {
483                    tonic::Status::unknown(
484                        format!("Service was not ready: {}", e.into()),
485                    )
486                })?;
487            let codec = tonic::codec::ProstCodec::default();
488            let path = http::uri::PathAndQuery::from_static(
489                "/player.MusicPlayer/SeekBackward",
490            );
491            let mut req = request.into_request();
492            req.extensions_mut()
493                .insert(GrpcMethod::new("player.MusicPlayer", "SeekBackward"));
494            self.inner.unary(req, path, codec).await
495        }
496        /// Playlist Commands
497        pub async fn play_selected(
498            &mut self,
499            request: impl tonic::IntoRequest<super::Empty>,
500        ) -> std::result::Result<tonic::Response<super::Empty>, tonic::Status> {
501            self.inner
502                .ready()
503                .await
504                .map_err(|e| {
505                    tonic::Status::unknown(
506                        format!("Service was not ready: {}", e.into()),
507                    )
508                })?;
509            let codec = tonic::codec::ProstCodec::default();
510            let path = http::uri::PathAndQuery::from_static(
511                "/player.MusicPlayer/PlaySelected",
512            );
513            let mut req = request.into_request();
514            req.extensions_mut()
515                .insert(GrpcMethod::new("player.MusicPlayer", "PlaySelected"));
516            self.inner.unary(req, path, codec).await
517        }
518        /// Cycle the playlist loop mode, returns the new mode.
519        pub async fn cycle_loop(
520            &mut self,
521            request: impl tonic::IntoRequest<super::Empty>,
522        ) -> std::result::Result<
523            tonic::Response<super::PlaylistLoopMode>,
524            tonic::Status,
525        > {
526            self.inner
527                .ready()
528                .await
529                .map_err(|e| {
530                    tonic::Status::unknown(
531                        format!("Service was not ready: {}", e.into()),
532                    )
533                })?;
534            let codec = tonic::codec::ProstCodec::default();
535            let path = http::uri::PathAndQuery::from_static(
536                "/player.MusicPlayer/CycleLoop",
537            );
538            let mut req = request.into_request();
539            req.extensions_mut()
540                .insert(GrpcMethod::new("player.MusicPlayer", "CycleLoop"));
541            self.inner.unary(req, path, codec).await
542        }
543        pub async fn reload_playlist(
544            &mut self,
545            request: impl tonic::IntoRequest<super::Empty>,
546        ) -> std::result::Result<tonic::Response<super::Empty>, tonic::Status> {
547            self.inner
548                .ready()
549                .await
550                .map_err(|e| {
551                    tonic::Status::unknown(
552                        format!("Service was not ready: {}", e.into()),
553                    )
554                })?;
555            let codec = tonic::codec::ProstCodec::default();
556            let path = http::uri::PathAndQuery::from_static(
557                "/player.MusicPlayer/ReloadPlaylist",
558            );
559            let mut req = request.into_request();
560            req.extensions_mut()
561                .insert(GrpcMethod::new("player.MusicPlayer", "ReloadPlaylist"));
562            self.inner.unary(req, path, codec).await
563        }
564        /// Misc Commands
565        pub async fn reload_config(
566            &mut self,
567            request: impl tonic::IntoRequest<super::Empty>,
568        ) -> std::result::Result<tonic::Response<super::Empty>, tonic::Status> {
569            self.inner
570                .ready()
571                .await
572                .map_err(|e| {
573                    tonic::Status::unknown(
574                        format!("Service was not ready: {}", e.into()),
575                    )
576                })?;
577            let codec = tonic::codec::ProstCodec::default();
578            let path = http::uri::PathAndQuery::from_static(
579                "/player.MusicPlayer/ReloadConfig",
580            );
581            let mut req = request.into_request();
582            req.extensions_mut()
583                .insert(GrpcMethod::new("player.MusicPlayer", "ReloadConfig"));
584            self.inner.unary(req, path, codec).await
585        }
586        pub async fn subscribe_server_updates(
587            &mut self,
588            request: impl tonic::IntoRequest<super::Empty>,
589        ) -> std::result::Result<
590            tonic::Response<tonic::codec::Streaming<super::StreamUpdates>>,
591            tonic::Status,
592        > {
593            self.inner
594                .ready()
595                .await
596                .map_err(|e| {
597                    tonic::Status::unknown(
598                        format!("Service was not ready: {}", e.into()),
599                    )
600                })?;
601            let codec = tonic::codec::ProstCodec::default();
602            let path = http::uri::PathAndQuery::from_static(
603                "/player.MusicPlayer/SubscribeServerUpdates",
604            );
605            let mut req = request.into_request();
606            req.extensions_mut()
607                .insert(GrpcMethod::new("player.MusicPlayer", "SubscribeServerUpdates"));
608            self.inner.server_streaming(req, path, codec).await
609        }
610    }
611}
612/// Generated server implementations.
613pub mod music_player_server {
614    #![allow(
615        unused_variables,
616        dead_code,
617        missing_docs,
618        clippy::wildcard_imports,
619        clippy::let_unit_value,
620    )]
621    use tonic::codegen::*;
622    /// Generated trait containing gRPC methods that should be implemented for use with MusicPlayerServer.
623    #[async_trait]
624    pub trait MusicPlayer: std::marker::Send + std::marker::Sync + 'static {
625        /// Player Commands
626        /// Toggle Pause/Play, returns the new state
627        async fn toggle_pause(
628            &self,
629            request: tonic::Request<super::Empty>,
630        ) -> std::result::Result<tonic::Response<super::PlayState>, tonic::Status>;
631        async fn skip_next(
632            &self,
633            request: tonic::Request<super::Empty>,
634        ) -> std::result::Result<tonic::Response<super::Empty>, tonic::Status>;
635        async fn skip_previous(
636            &self,
637            request: tonic::Request<super::Empty>,
638        ) -> std::result::Result<tonic::Response<super::Empty>, tonic::Status>;
639        async fn get_progress(
640            &self,
641            request: tonic::Request<super::Empty>,
642        ) -> std::result::Result<
643            tonic::Response<super::GetProgressResponse>,
644            tonic::Status,
645        >;
646        async fn volume_up(
647            &self,
648            request: tonic::Request<super::Empty>,
649        ) -> std::result::Result<tonic::Response<super::VolumeReply>, tonic::Status>;
650        async fn volume_down(
651            &self,
652            request: tonic::Request<super::Empty>,
653        ) -> std::result::Result<tonic::Response<super::VolumeReply>, tonic::Status>;
654        async fn speed_up(
655            &self,
656            request: tonic::Request<super::Empty>,
657        ) -> std::result::Result<tonic::Response<super::SpeedReply>, tonic::Status>;
658        async fn speed_down(
659            &self,
660            request: tonic::Request<super::Empty>,
661        ) -> std::result::Result<tonic::Response<super::SpeedReply>, tonic::Status>;
662        /// Toggle the gapless mdoe, returns the new state.
663        async fn toggle_gapless(
664            &self,
665            request: tonic::Request<super::Empty>,
666        ) -> std::result::Result<tonic::Response<super::GaplessState>, tonic::Status>;
667        async fn seek_forward(
668            &self,
669            request: tonic::Request<super::Empty>,
670        ) -> std::result::Result<tonic::Response<super::PlayerTime>, tonic::Status>;
671        async fn seek_backward(
672            &self,
673            request: tonic::Request<super::Empty>,
674        ) -> std::result::Result<tonic::Response<super::PlayerTime>, tonic::Status>;
675        /// Playlist Commands
676        async fn play_selected(
677            &self,
678            request: tonic::Request<super::Empty>,
679        ) -> std::result::Result<tonic::Response<super::Empty>, tonic::Status>;
680        /// Cycle the playlist loop mode, returns the new mode.
681        async fn cycle_loop(
682            &self,
683            request: tonic::Request<super::Empty>,
684        ) -> std::result::Result<
685            tonic::Response<super::PlaylistLoopMode>,
686            tonic::Status,
687        >;
688        async fn reload_playlist(
689            &self,
690            request: tonic::Request<super::Empty>,
691        ) -> std::result::Result<tonic::Response<super::Empty>, tonic::Status>;
692        /// Misc Commands
693        async fn reload_config(
694            &self,
695            request: tonic::Request<super::Empty>,
696        ) -> std::result::Result<tonic::Response<super::Empty>, tonic::Status>;
697        /// Server streaming response type for the SubscribeServerUpdates method.
698        type SubscribeServerUpdatesStream: tonic::codegen::tokio_stream::Stream<
699                Item = std::result::Result<super::StreamUpdates, tonic::Status>,
700            >
701            + std::marker::Send
702            + 'static;
703        async fn subscribe_server_updates(
704            &self,
705            request: tonic::Request<super::Empty>,
706        ) -> std::result::Result<
707            tonic::Response<Self::SubscribeServerUpdatesStream>,
708            tonic::Status,
709        >;
710    }
711    #[derive(Debug)]
712    pub struct MusicPlayerServer<T> {
713        inner: Arc<T>,
714        accept_compression_encodings: EnabledCompressionEncodings,
715        send_compression_encodings: EnabledCompressionEncodings,
716        max_decoding_message_size: Option<usize>,
717        max_encoding_message_size: Option<usize>,
718    }
719    impl<T> MusicPlayerServer<T> {
720        pub fn new(inner: T) -> Self {
721            Self::from_arc(Arc::new(inner))
722        }
723        pub fn from_arc(inner: Arc<T>) -> Self {
724            Self {
725                inner,
726                accept_compression_encodings: Default::default(),
727                send_compression_encodings: Default::default(),
728                max_decoding_message_size: None,
729                max_encoding_message_size: None,
730            }
731        }
732        pub fn with_interceptor<F>(
733            inner: T,
734            interceptor: F,
735        ) -> InterceptedService<Self, F>
736        where
737            F: tonic::service::Interceptor,
738        {
739            InterceptedService::new(Self::new(inner), interceptor)
740        }
741        /// Enable decompressing requests with the given encoding.
742        #[must_use]
743        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
744            self.accept_compression_encodings.enable(encoding);
745            self
746        }
747        /// Compress responses with the given encoding, if the client supports it.
748        #[must_use]
749        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
750            self.send_compression_encodings.enable(encoding);
751            self
752        }
753        /// Limits the maximum size of a decoded message.
754        ///
755        /// Default: `4MB`
756        #[must_use]
757        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
758            self.max_decoding_message_size = Some(limit);
759            self
760        }
761        /// Limits the maximum size of an encoded message.
762        ///
763        /// Default: `usize::MAX`
764        #[must_use]
765        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
766            self.max_encoding_message_size = Some(limit);
767            self
768        }
769    }
770    impl<T, B> tonic::codegen::Service<http::Request<B>> for MusicPlayerServer<T>
771    where
772        T: MusicPlayer,
773        B: Body + std::marker::Send + 'static,
774        B::Error: Into<StdError> + std::marker::Send + 'static,
775    {
776        type Response = http::Response<tonic::body::BoxBody>;
777        type Error = std::convert::Infallible;
778        type Future = BoxFuture<Self::Response, Self::Error>;
779        fn poll_ready(
780            &mut self,
781            _cx: &mut Context<'_>,
782        ) -> Poll<std::result::Result<(), Self::Error>> {
783            Poll::Ready(Ok(()))
784        }
785        fn call(&mut self, req: http::Request<B>) -> Self::Future {
786            match req.uri().path() {
787                "/player.MusicPlayer/TogglePause" => {
788                    #[allow(non_camel_case_types)]
789                    struct TogglePauseSvc<T: MusicPlayer>(pub Arc<T>);
790                    impl<T: MusicPlayer> tonic::server::UnaryService<super::Empty>
791                    for TogglePauseSvc<T> {
792                        type Response = super::PlayState;
793                        type Future = BoxFuture<
794                            tonic::Response<Self::Response>,
795                            tonic::Status,
796                        >;
797                        fn call(
798                            &mut self,
799                            request: tonic::Request<super::Empty>,
800                        ) -> Self::Future {
801                            let inner = Arc::clone(&self.0);
802                            let fut = async move {
803                                <T as MusicPlayer>::toggle_pause(&inner, request).await
804                            };
805                            Box::pin(fut)
806                        }
807                    }
808                    let accept_compression_encodings = self.accept_compression_encodings;
809                    let send_compression_encodings = self.send_compression_encodings;
810                    let max_decoding_message_size = self.max_decoding_message_size;
811                    let max_encoding_message_size = self.max_encoding_message_size;
812                    let inner = self.inner.clone();
813                    let fut = async move {
814                        let method = TogglePauseSvc(inner);
815                        let codec = tonic::codec::ProstCodec::default();
816                        let mut grpc = tonic::server::Grpc::new(codec)
817                            .apply_compression_config(
818                                accept_compression_encodings,
819                                send_compression_encodings,
820                            )
821                            .apply_max_message_size_config(
822                                max_decoding_message_size,
823                                max_encoding_message_size,
824                            );
825                        let res = grpc.unary(method, req).await;
826                        Ok(res)
827                    };
828                    Box::pin(fut)
829                }
830                "/player.MusicPlayer/SkipNext" => {
831                    #[allow(non_camel_case_types)]
832                    struct SkipNextSvc<T: MusicPlayer>(pub Arc<T>);
833                    impl<T: MusicPlayer> tonic::server::UnaryService<super::Empty>
834                    for SkipNextSvc<T> {
835                        type Response = super::Empty;
836                        type Future = BoxFuture<
837                            tonic::Response<Self::Response>,
838                            tonic::Status,
839                        >;
840                        fn call(
841                            &mut self,
842                            request: tonic::Request<super::Empty>,
843                        ) -> Self::Future {
844                            let inner = Arc::clone(&self.0);
845                            let fut = async move {
846                                <T as MusicPlayer>::skip_next(&inner, request).await
847                            };
848                            Box::pin(fut)
849                        }
850                    }
851                    let accept_compression_encodings = self.accept_compression_encodings;
852                    let send_compression_encodings = self.send_compression_encodings;
853                    let max_decoding_message_size = self.max_decoding_message_size;
854                    let max_encoding_message_size = self.max_encoding_message_size;
855                    let inner = self.inner.clone();
856                    let fut = async move {
857                        let method = SkipNextSvc(inner);
858                        let codec = tonic::codec::ProstCodec::default();
859                        let mut grpc = tonic::server::Grpc::new(codec)
860                            .apply_compression_config(
861                                accept_compression_encodings,
862                                send_compression_encodings,
863                            )
864                            .apply_max_message_size_config(
865                                max_decoding_message_size,
866                                max_encoding_message_size,
867                            );
868                        let res = grpc.unary(method, req).await;
869                        Ok(res)
870                    };
871                    Box::pin(fut)
872                }
873                "/player.MusicPlayer/SkipPrevious" => {
874                    #[allow(non_camel_case_types)]
875                    struct SkipPreviousSvc<T: MusicPlayer>(pub Arc<T>);
876                    impl<T: MusicPlayer> tonic::server::UnaryService<super::Empty>
877                    for SkipPreviousSvc<T> {
878                        type Response = super::Empty;
879                        type Future = BoxFuture<
880                            tonic::Response<Self::Response>,
881                            tonic::Status,
882                        >;
883                        fn call(
884                            &mut self,
885                            request: tonic::Request<super::Empty>,
886                        ) -> Self::Future {
887                            let inner = Arc::clone(&self.0);
888                            let fut = async move {
889                                <T as MusicPlayer>::skip_previous(&inner, request).await
890                            };
891                            Box::pin(fut)
892                        }
893                    }
894                    let accept_compression_encodings = self.accept_compression_encodings;
895                    let send_compression_encodings = self.send_compression_encodings;
896                    let max_decoding_message_size = self.max_decoding_message_size;
897                    let max_encoding_message_size = self.max_encoding_message_size;
898                    let inner = self.inner.clone();
899                    let fut = async move {
900                        let method = SkipPreviousSvc(inner);
901                        let codec = tonic::codec::ProstCodec::default();
902                        let mut grpc = tonic::server::Grpc::new(codec)
903                            .apply_compression_config(
904                                accept_compression_encodings,
905                                send_compression_encodings,
906                            )
907                            .apply_max_message_size_config(
908                                max_decoding_message_size,
909                                max_encoding_message_size,
910                            );
911                        let res = grpc.unary(method, req).await;
912                        Ok(res)
913                    };
914                    Box::pin(fut)
915                }
916                "/player.MusicPlayer/GetProgress" => {
917                    #[allow(non_camel_case_types)]
918                    struct GetProgressSvc<T: MusicPlayer>(pub Arc<T>);
919                    impl<T: MusicPlayer> tonic::server::UnaryService<super::Empty>
920                    for GetProgressSvc<T> {
921                        type Response = super::GetProgressResponse;
922                        type Future = BoxFuture<
923                            tonic::Response<Self::Response>,
924                            tonic::Status,
925                        >;
926                        fn call(
927                            &mut self,
928                            request: tonic::Request<super::Empty>,
929                        ) -> Self::Future {
930                            let inner = Arc::clone(&self.0);
931                            let fut = async move {
932                                <T as MusicPlayer>::get_progress(&inner, request).await
933                            };
934                            Box::pin(fut)
935                        }
936                    }
937                    let accept_compression_encodings = self.accept_compression_encodings;
938                    let send_compression_encodings = self.send_compression_encodings;
939                    let max_decoding_message_size = self.max_decoding_message_size;
940                    let max_encoding_message_size = self.max_encoding_message_size;
941                    let inner = self.inner.clone();
942                    let fut = async move {
943                        let method = GetProgressSvc(inner);
944                        let codec = tonic::codec::ProstCodec::default();
945                        let mut grpc = tonic::server::Grpc::new(codec)
946                            .apply_compression_config(
947                                accept_compression_encodings,
948                                send_compression_encodings,
949                            )
950                            .apply_max_message_size_config(
951                                max_decoding_message_size,
952                                max_encoding_message_size,
953                            );
954                        let res = grpc.unary(method, req).await;
955                        Ok(res)
956                    };
957                    Box::pin(fut)
958                }
959                "/player.MusicPlayer/VolumeUp" => {
960                    #[allow(non_camel_case_types)]
961                    struct VolumeUpSvc<T: MusicPlayer>(pub Arc<T>);
962                    impl<T: MusicPlayer> tonic::server::UnaryService<super::Empty>
963                    for VolumeUpSvc<T> {
964                        type Response = super::VolumeReply;
965                        type Future = BoxFuture<
966                            tonic::Response<Self::Response>,
967                            tonic::Status,
968                        >;
969                        fn call(
970                            &mut self,
971                            request: tonic::Request<super::Empty>,
972                        ) -> Self::Future {
973                            let inner = Arc::clone(&self.0);
974                            let fut = async move {
975                                <T as MusicPlayer>::volume_up(&inner, request).await
976                            };
977                            Box::pin(fut)
978                        }
979                    }
980                    let accept_compression_encodings = self.accept_compression_encodings;
981                    let send_compression_encodings = self.send_compression_encodings;
982                    let max_decoding_message_size = self.max_decoding_message_size;
983                    let max_encoding_message_size = self.max_encoding_message_size;
984                    let inner = self.inner.clone();
985                    let fut = async move {
986                        let method = VolumeUpSvc(inner);
987                        let codec = tonic::codec::ProstCodec::default();
988                        let mut grpc = tonic::server::Grpc::new(codec)
989                            .apply_compression_config(
990                                accept_compression_encodings,
991                                send_compression_encodings,
992                            )
993                            .apply_max_message_size_config(
994                                max_decoding_message_size,
995                                max_encoding_message_size,
996                            );
997                        let res = grpc.unary(method, req).await;
998                        Ok(res)
999                    };
1000                    Box::pin(fut)
1001                }
1002                "/player.MusicPlayer/VolumeDown" => {
1003                    #[allow(non_camel_case_types)]
1004                    struct VolumeDownSvc<T: MusicPlayer>(pub Arc<T>);
1005                    impl<T: MusicPlayer> tonic::server::UnaryService<super::Empty>
1006                    for VolumeDownSvc<T> {
1007                        type Response = super::VolumeReply;
1008                        type Future = BoxFuture<
1009                            tonic::Response<Self::Response>,
1010                            tonic::Status,
1011                        >;
1012                        fn call(
1013                            &mut self,
1014                            request: tonic::Request<super::Empty>,
1015                        ) -> Self::Future {
1016                            let inner = Arc::clone(&self.0);
1017                            let fut = async move {
1018                                <T as MusicPlayer>::volume_down(&inner, request).await
1019                            };
1020                            Box::pin(fut)
1021                        }
1022                    }
1023                    let accept_compression_encodings = self.accept_compression_encodings;
1024                    let send_compression_encodings = self.send_compression_encodings;
1025                    let max_decoding_message_size = self.max_decoding_message_size;
1026                    let max_encoding_message_size = self.max_encoding_message_size;
1027                    let inner = self.inner.clone();
1028                    let fut = async move {
1029                        let method = VolumeDownSvc(inner);
1030                        let codec = tonic::codec::ProstCodec::default();
1031                        let mut grpc = tonic::server::Grpc::new(codec)
1032                            .apply_compression_config(
1033                                accept_compression_encodings,
1034                                send_compression_encodings,
1035                            )
1036                            .apply_max_message_size_config(
1037                                max_decoding_message_size,
1038                                max_encoding_message_size,
1039                            );
1040                        let res = grpc.unary(method, req).await;
1041                        Ok(res)
1042                    };
1043                    Box::pin(fut)
1044                }
1045                "/player.MusicPlayer/SpeedUp" => {
1046                    #[allow(non_camel_case_types)]
1047                    struct SpeedUpSvc<T: MusicPlayer>(pub Arc<T>);
1048                    impl<T: MusicPlayer> tonic::server::UnaryService<super::Empty>
1049                    for SpeedUpSvc<T> {
1050                        type Response = super::SpeedReply;
1051                        type Future = BoxFuture<
1052                            tonic::Response<Self::Response>,
1053                            tonic::Status,
1054                        >;
1055                        fn call(
1056                            &mut self,
1057                            request: tonic::Request<super::Empty>,
1058                        ) -> Self::Future {
1059                            let inner = Arc::clone(&self.0);
1060                            let fut = async move {
1061                                <T as MusicPlayer>::speed_up(&inner, request).await
1062                            };
1063                            Box::pin(fut)
1064                        }
1065                    }
1066                    let accept_compression_encodings = self.accept_compression_encodings;
1067                    let send_compression_encodings = self.send_compression_encodings;
1068                    let max_decoding_message_size = self.max_decoding_message_size;
1069                    let max_encoding_message_size = self.max_encoding_message_size;
1070                    let inner = self.inner.clone();
1071                    let fut = async move {
1072                        let method = SpeedUpSvc(inner);
1073                        let codec = tonic::codec::ProstCodec::default();
1074                        let mut grpc = tonic::server::Grpc::new(codec)
1075                            .apply_compression_config(
1076                                accept_compression_encodings,
1077                                send_compression_encodings,
1078                            )
1079                            .apply_max_message_size_config(
1080                                max_decoding_message_size,
1081                                max_encoding_message_size,
1082                            );
1083                        let res = grpc.unary(method, req).await;
1084                        Ok(res)
1085                    };
1086                    Box::pin(fut)
1087                }
1088                "/player.MusicPlayer/SpeedDown" => {
1089                    #[allow(non_camel_case_types)]
1090                    struct SpeedDownSvc<T: MusicPlayer>(pub Arc<T>);
1091                    impl<T: MusicPlayer> tonic::server::UnaryService<super::Empty>
1092                    for SpeedDownSvc<T> {
1093                        type Response = super::SpeedReply;
1094                        type Future = BoxFuture<
1095                            tonic::Response<Self::Response>,
1096                            tonic::Status,
1097                        >;
1098                        fn call(
1099                            &mut self,
1100                            request: tonic::Request<super::Empty>,
1101                        ) -> Self::Future {
1102                            let inner = Arc::clone(&self.0);
1103                            let fut = async move {
1104                                <T as MusicPlayer>::speed_down(&inner, request).await
1105                            };
1106                            Box::pin(fut)
1107                        }
1108                    }
1109                    let accept_compression_encodings = self.accept_compression_encodings;
1110                    let send_compression_encodings = self.send_compression_encodings;
1111                    let max_decoding_message_size = self.max_decoding_message_size;
1112                    let max_encoding_message_size = self.max_encoding_message_size;
1113                    let inner = self.inner.clone();
1114                    let fut = async move {
1115                        let method = SpeedDownSvc(inner);
1116                        let codec = tonic::codec::ProstCodec::default();
1117                        let mut grpc = tonic::server::Grpc::new(codec)
1118                            .apply_compression_config(
1119                                accept_compression_encodings,
1120                                send_compression_encodings,
1121                            )
1122                            .apply_max_message_size_config(
1123                                max_decoding_message_size,
1124                                max_encoding_message_size,
1125                            );
1126                        let res = grpc.unary(method, req).await;
1127                        Ok(res)
1128                    };
1129                    Box::pin(fut)
1130                }
1131                "/player.MusicPlayer/ToggleGapless" => {
1132                    #[allow(non_camel_case_types)]
1133                    struct ToggleGaplessSvc<T: MusicPlayer>(pub Arc<T>);
1134                    impl<T: MusicPlayer> tonic::server::UnaryService<super::Empty>
1135                    for ToggleGaplessSvc<T> {
1136                        type Response = super::GaplessState;
1137                        type Future = BoxFuture<
1138                            tonic::Response<Self::Response>,
1139                            tonic::Status,
1140                        >;
1141                        fn call(
1142                            &mut self,
1143                            request: tonic::Request<super::Empty>,
1144                        ) -> Self::Future {
1145                            let inner = Arc::clone(&self.0);
1146                            let fut = async move {
1147                                <T as MusicPlayer>::toggle_gapless(&inner, request).await
1148                            };
1149                            Box::pin(fut)
1150                        }
1151                    }
1152                    let accept_compression_encodings = self.accept_compression_encodings;
1153                    let send_compression_encodings = self.send_compression_encodings;
1154                    let max_decoding_message_size = self.max_decoding_message_size;
1155                    let max_encoding_message_size = self.max_encoding_message_size;
1156                    let inner = self.inner.clone();
1157                    let fut = async move {
1158                        let method = ToggleGaplessSvc(inner);
1159                        let codec = tonic::codec::ProstCodec::default();
1160                        let mut grpc = tonic::server::Grpc::new(codec)
1161                            .apply_compression_config(
1162                                accept_compression_encodings,
1163                                send_compression_encodings,
1164                            )
1165                            .apply_max_message_size_config(
1166                                max_decoding_message_size,
1167                                max_encoding_message_size,
1168                            );
1169                        let res = grpc.unary(method, req).await;
1170                        Ok(res)
1171                    };
1172                    Box::pin(fut)
1173                }
1174                "/player.MusicPlayer/SeekForward" => {
1175                    #[allow(non_camel_case_types)]
1176                    struct SeekForwardSvc<T: MusicPlayer>(pub Arc<T>);
1177                    impl<T: MusicPlayer> tonic::server::UnaryService<super::Empty>
1178                    for SeekForwardSvc<T> {
1179                        type Response = super::PlayerTime;
1180                        type Future = BoxFuture<
1181                            tonic::Response<Self::Response>,
1182                            tonic::Status,
1183                        >;
1184                        fn call(
1185                            &mut self,
1186                            request: tonic::Request<super::Empty>,
1187                        ) -> Self::Future {
1188                            let inner = Arc::clone(&self.0);
1189                            let fut = async move {
1190                                <T as MusicPlayer>::seek_forward(&inner, request).await
1191                            };
1192                            Box::pin(fut)
1193                        }
1194                    }
1195                    let accept_compression_encodings = self.accept_compression_encodings;
1196                    let send_compression_encodings = self.send_compression_encodings;
1197                    let max_decoding_message_size = self.max_decoding_message_size;
1198                    let max_encoding_message_size = self.max_encoding_message_size;
1199                    let inner = self.inner.clone();
1200                    let fut = async move {
1201                        let method = SeekForwardSvc(inner);
1202                        let codec = tonic::codec::ProstCodec::default();
1203                        let mut grpc = tonic::server::Grpc::new(codec)
1204                            .apply_compression_config(
1205                                accept_compression_encodings,
1206                                send_compression_encodings,
1207                            )
1208                            .apply_max_message_size_config(
1209                                max_decoding_message_size,
1210                                max_encoding_message_size,
1211                            );
1212                        let res = grpc.unary(method, req).await;
1213                        Ok(res)
1214                    };
1215                    Box::pin(fut)
1216                }
1217                "/player.MusicPlayer/SeekBackward" => {
1218                    #[allow(non_camel_case_types)]
1219                    struct SeekBackwardSvc<T: MusicPlayer>(pub Arc<T>);
1220                    impl<T: MusicPlayer> tonic::server::UnaryService<super::Empty>
1221                    for SeekBackwardSvc<T> {
1222                        type Response = super::PlayerTime;
1223                        type Future = BoxFuture<
1224                            tonic::Response<Self::Response>,
1225                            tonic::Status,
1226                        >;
1227                        fn call(
1228                            &mut self,
1229                            request: tonic::Request<super::Empty>,
1230                        ) -> Self::Future {
1231                            let inner = Arc::clone(&self.0);
1232                            let fut = async move {
1233                                <T as MusicPlayer>::seek_backward(&inner, request).await
1234                            };
1235                            Box::pin(fut)
1236                        }
1237                    }
1238                    let accept_compression_encodings = self.accept_compression_encodings;
1239                    let send_compression_encodings = self.send_compression_encodings;
1240                    let max_decoding_message_size = self.max_decoding_message_size;
1241                    let max_encoding_message_size = self.max_encoding_message_size;
1242                    let inner = self.inner.clone();
1243                    let fut = async move {
1244                        let method = SeekBackwardSvc(inner);
1245                        let codec = tonic::codec::ProstCodec::default();
1246                        let mut grpc = tonic::server::Grpc::new(codec)
1247                            .apply_compression_config(
1248                                accept_compression_encodings,
1249                                send_compression_encodings,
1250                            )
1251                            .apply_max_message_size_config(
1252                                max_decoding_message_size,
1253                                max_encoding_message_size,
1254                            );
1255                        let res = grpc.unary(method, req).await;
1256                        Ok(res)
1257                    };
1258                    Box::pin(fut)
1259                }
1260                "/player.MusicPlayer/PlaySelected" => {
1261                    #[allow(non_camel_case_types)]
1262                    struct PlaySelectedSvc<T: MusicPlayer>(pub Arc<T>);
1263                    impl<T: MusicPlayer> tonic::server::UnaryService<super::Empty>
1264                    for PlaySelectedSvc<T> {
1265                        type Response = super::Empty;
1266                        type Future = BoxFuture<
1267                            tonic::Response<Self::Response>,
1268                            tonic::Status,
1269                        >;
1270                        fn call(
1271                            &mut self,
1272                            request: tonic::Request<super::Empty>,
1273                        ) -> Self::Future {
1274                            let inner = Arc::clone(&self.0);
1275                            let fut = async move {
1276                                <T as MusicPlayer>::play_selected(&inner, request).await
1277                            };
1278                            Box::pin(fut)
1279                        }
1280                    }
1281                    let accept_compression_encodings = self.accept_compression_encodings;
1282                    let send_compression_encodings = self.send_compression_encodings;
1283                    let max_decoding_message_size = self.max_decoding_message_size;
1284                    let max_encoding_message_size = self.max_encoding_message_size;
1285                    let inner = self.inner.clone();
1286                    let fut = async move {
1287                        let method = PlaySelectedSvc(inner);
1288                        let codec = tonic::codec::ProstCodec::default();
1289                        let mut grpc = tonic::server::Grpc::new(codec)
1290                            .apply_compression_config(
1291                                accept_compression_encodings,
1292                                send_compression_encodings,
1293                            )
1294                            .apply_max_message_size_config(
1295                                max_decoding_message_size,
1296                                max_encoding_message_size,
1297                            );
1298                        let res = grpc.unary(method, req).await;
1299                        Ok(res)
1300                    };
1301                    Box::pin(fut)
1302                }
1303                "/player.MusicPlayer/CycleLoop" => {
1304                    #[allow(non_camel_case_types)]
1305                    struct CycleLoopSvc<T: MusicPlayer>(pub Arc<T>);
1306                    impl<T: MusicPlayer> tonic::server::UnaryService<super::Empty>
1307                    for CycleLoopSvc<T> {
1308                        type Response = super::PlaylistLoopMode;
1309                        type Future = BoxFuture<
1310                            tonic::Response<Self::Response>,
1311                            tonic::Status,
1312                        >;
1313                        fn call(
1314                            &mut self,
1315                            request: tonic::Request<super::Empty>,
1316                        ) -> Self::Future {
1317                            let inner = Arc::clone(&self.0);
1318                            let fut = async move {
1319                                <T as MusicPlayer>::cycle_loop(&inner, request).await
1320                            };
1321                            Box::pin(fut)
1322                        }
1323                    }
1324                    let accept_compression_encodings = self.accept_compression_encodings;
1325                    let send_compression_encodings = self.send_compression_encodings;
1326                    let max_decoding_message_size = self.max_decoding_message_size;
1327                    let max_encoding_message_size = self.max_encoding_message_size;
1328                    let inner = self.inner.clone();
1329                    let fut = async move {
1330                        let method = CycleLoopSvc(inner);
1331                        let codec = tonic::codec::ProstCodec::default();
1332                        let mut grpc = tonic::server::Grpc::new(codec)
1333                            .apply_compression_config(
1334                                accept_compression_encodings,
1335                                send_compression_encodings,
1336                            )
1337                            .apply_max_message_size_config(
1338                                max_decoding_message_size,
1339                                max_encoding_message_size,
1340                            );
1341                        let res = grpc.unary(method, req).await;
1342                        Ok(res)
1343                    };
1344                    Box::pin(fut)
1345                }
1346                "/player.MusicPlayer/ReloadPlaylist" => {
1347                    #[allow(non_camel_case_types)]
1348                    struct ReloadPlaylistSvc<T: MusicPlayer>(pub Arc<T>);
1349                    impl<T: MusicPlayer> tonic::server::UnaryService<super::Empty>
1350                    for ReloadPlaylistSvc<T> {
1351                        type Response = super::Empty;
1352                        type Future = BoxFuture<
1353                            tonic::Response<Self::Response>,
1354                            tonic::Status,
1355                        >;
1356                        fn call(
1357                            &mut self,
1358                            request: tonic::Request<super::Empty>,
1359                        ) -> Self::Future {
1360                            let inner = Arc::clone(&self.0);
1361                            let fut = async move {
1362                                <T as MusicPlayer>::reload_playlist(&inner, request).await
1363                            };
1364                            Box::pin(fut)
1365                        }
1366                    }
1367                    let accept_compression_encodings = self.accept_compression_encodings;
1368                    let send_compression_encodings = self.send_compression_encodings;
1369                    let max_decoding_message_size = self.max_decoding_message_size;
1370                    let max_encoding_message_size = self.max_encoding_message_size;
1371                    let inner = self.inner.clone();
1372                    let fut = async move {
1373                        let method = ReloadPlaylistSvc(inner);
1374                        let codec = tonic::codec::ProstCodec::default();
1375                        let mut grpc = tonic::server::Grpc::new(codec)
1376                            .apply_compression_config(
1377                                accept_compression_encodings,
1378                                send_compression_encodings,
1379                            )
1380                            .apply_max_message_size_config(
1381                                max_decoding_message_size,
1382                                max_encoding_message_size,
1383                            );
1384                        let res = grpc.unary(method, req).await;
1385                        Ok(res)
1386                    };
1387                    Box::pin(fut)
1388                }
1389                "/player.MusicPlayer/ReloadConfig" => {
1390                    #[allow(non_camel_case_types)]
1391                    struct ReloadConfigSvc<T: MusicPlayer>(pub Arc<T>);
1392                    impl<T: MusicPlayer> tonic::server::UnaryService<super::Empty>
1393                    for ReloadConfigSvc<T> {
1394                        type Response = super::Empty;
1395                        type Future = BoxFuture<
1396                            tonic::Response<Self::Response>,
1397                            tonic::Status,
1398                        >;
1399                        fn call(
1400                            &mut self,
1401                            request: tonic::Request<super::Empty>,
1402                        ) -> Self::Future {
1403                            let inner = Arc::clone(&self.0);
1404                            let fut = async move {
1405                                <T as MusicPlayer>::reload_config(&inner, request).await
1406                            };
1407                            Box::pin(fut)
1408                        }
1409                    }
1410                    let accept_compression_encodings = self.accept_compression_encodings;
1411                    let send_compression_encodings = self.send_compression_encodings;
1412                    let max_decoding_message_size = self.max_decoding_message_size;
1413                    let max_encoding_message_size = self.max_encoding_message_size;
1414                    let inner = self.inner.clone();
1415                    let fut = async move {
1416                        let method = ReloadConfigSvc(inner);
1417                        let codec = tonic::codec::ProstCodec::default();
1418                        let mut grpc = tonic::server::Grpc::new(codec)
1419                            .apply_compression_config(
1420                                accept_compression_encodings,
1421                                send_compression_encodings,
1422                            )
1423                            .apply_max_message_size_config(
1424                                max_decoding_message_size,
1425                                max_encoding_message_size,
1426                            );
1427                        let res = grpc.unary(method, req).await;
1428                        Ok(res)
1429                    };
1430                    Box::pin(fut)
1431                }
1432                "/player.MusicPlayer/SubscribeServerUpdates" => {
1433                    #[allow(non_camel_case_types)]
1434                    struct SubscribeServerUpdatesSvc<T: MusicPlayer>(pub Arc<T>);
1435                    impl<
1436                        T: MusicPlayer,
1437                    > tonic::server::ServerStreamingService<super::Empty>
1438                    for SubscribeServerUpdatesSvc<T> {
1439                        type Response = super::StreamUpdates;
1440                        type ResponseStream = T::SubscribeServerUpdatesStream;
1441                        type Future = BoxFuture<
1442                            tonic::Response<Self::ResponseStream>,
1443                            tonic::Status,
1444                        >;
1445                        fn call(
1446                            &mut self,
1447                            request: tonic::Request<super::Empty>,
1448                        ) -> Self::Future {
1449                            let inner = Arc::clone(&self.0);
1450                            let fut = async move {
1451                                <T as MusicPlayer>::subscribe_server_updates(
1452                                        &inner,
1453                                        request,
1454                                    )
1455                                    .await
1456                            };
1457                            Box::pin(fut)
1458                        }
1459                    }
1460                    let accept_compression_encodings = self.accept_compression_encodings;
1461                    let send_compression_encodings = self.send_compression_encodings;
1462                    let max_decoding_message_size = self.max_decoding_message_size;
1463                    let max_encoding_message_size = self.max_encoding_message_size;
1464                    let inner = self.inner.clone();
1465                    let fut = async move {
1466                        let method = SubscribeServerUpdatesSvc(inner);
1467                        let codec = tonic::codec::ProstCodec::default();
1468                        let mut grpc = tonic::server::Grpc::new(codec)
1469                            .apply_compression_config(
1470                                accept_compression_encodings,
1471                                send_compression_encodings,
1472                            )
1473                            .apply_max_message_size_config(
1474                                max_decoding_message_size,
1475                                max_encoding_message_size,
1476                            );
1477                        let res = grpc.server_streaming(method, req).await;
1478                        Ok(res)
1479                    };
1480                    Box::pin(fut)
1481                }
1482                _ => {
1483                    Box::pin(async move {
1484                        let mut response = http::Response::new(empty_body());
1485                        let headers = response.headers_mut();
1486                        headers
1487                            .insert(
1488                                tonic::Status::GRPC_STATUS,
1489                                (tonic::Code::Unimplemented as i32).into(),
1490                            );
1491                        headers
1492                            .insert(
1493                                http::header::CONTENT_TYPE,
1494                                tonic::metadata::GRPC_CONTENT_TYPE,
1495                            );
1496                        Ok(response)
1497                    })
1498                }
1499            }
1500        }
1501    }
1502    impl<T> Clone for MusicPlayerServer<T> {
1503        fn clone(&self) -> Self {
1504            let inner = self.inner.clone();
1505            Self {
1506                inner,
1507                accept_compression_encodings: self.accept_compression_encodings,
1508                send_compression_encodings: self.send_compression_encodings,
1509                max_decoding_message_size: self.max_decoding_message_size,
1510                max_encoding_message_size: self.max_encoding_message_size,
1511            }
1512        }
1513    }
1514    /// Generated gRPC service name
1515    pub const SERVICE_NAME: &str = "player.MusicPlayer";
1516    impl<T> tonic::server::NamedService for MusicPlayerServer<T> {
1517        const NAME: &'static str = SERVICE_NAME;
1518    }
1519}