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

1// This file is @generated by prost-build.
2#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
3pub struct Empty {}
4/// A play status.
5#[derive(Clone, Copy, PartialEq, Eq, Hash, ::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, Eq, Hash, ::prost::Message)]
12pub struct PlayerTime {
13    #[prost(message, optional, tag = "1")]
14    pub position: ::core::option::Option<Duration>,
15    /// TODO: likely also should be possible to be optional
16    #[prost(message, optional, tag = "2")]
17    pub total_duration: ::core::option::Option<Duration>,
18}
19#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
20pub struct GetProgressResponse {
21    #[prost(message, optional, tag = "1")]
22    pub progress: ::core::option::Option<PlayerTime>,
23    #[prost(uint64, tag = "3")]
24    pub current_track_index: u64,
25    #[prost(uint32, tag = "4")]
26    pub status: u32,
27    /// actually a u16, but protobuf does not support types lower than 32 bits
28    #[prost(uint32, tag = "5")]
29    pub volume: u32,
30    #[prost(int32, tag = "6")]
31    pub speed: i32,
32    #[prost(bool, tag = "7")]
33    pub gapless: bool,
34    #[prost(string, tag = "9")]
35    pub radio_title: ::prost::alloc::string::String,
36}
37#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
38pub struct VolumeReply {
39    /// actually a u16, but protobuf does not support types lower than 32 bits
40    #[prost(uint32, tag = "1")]
41    pub volume: u32,
42}
43#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
44pub struct SpeedReply {
45    #[prost(int32, tag = "1")]
46    pub speed: i32,
47}
48/// A Gapless state.
49#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
50pub struct GaplessState {
51    #[prost(bool, tag = "1")]
52    pub gapless: bool,
53}
54/// using a custom Duration that matches rust's definition, as rust's may not fit
55/// into google's well-known Duration
56#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
57pub struct Duration {
58    #[prost(uint64, tag = "1")]
59    pub secs: u64,
60    #[prost(uint32, tag = "2")]
61    pub nanos: u32,
62}
63/// all updates that can happen from the server side, without the client to have to ask explicitly
64/// naming convention for the stream update specific messages is to add the "Update" prefix, even if a similar non-prefix message already exists
65#[derive(Clone, PartialEq, ::prost::Message)]
66pub struct StreamUpdates {
67    #[prost(oneof = "stream_updates::Type", tags = "1, 2, 3, 4, 5, 6, 7, 8")]
68    pub r#type: ::core::option::Option<stream_updates::Type>,
69}
70/// Nested message and enum types in `StreamUpdates`.
71pub mod stream_updates {
72    #[derive(Clone, PartialEq, ::prost::Oneof)]
73    pub enum Type {
74        #[prost(message, tag = "1")]
75        MissedEvents(super::UpdateMissedEvents),
76        #[prost(message, tag = "2")]
77        VolumeChanged(super::UpdateVolumeChanged),
78        #[prost(message, tag = "3")]
79        SpeedChanged(super::UpdateSpeedChanged),
80        #[prost(message, tag = "4")]
81        PlayStateChanged(super::UpdatePlayStateChanged),
82        #[prost(message, tag = "5")]
83        TrackChanged(super::UpdateTrackChanged),
84        #[prost(message, tag = "6")]
85        GaplessChanged(super::UpdateGaplessChanged),
86        #[prost(message, tag = "7")]
87        PlaylistChanged(super::UpdatePlaylist),
88        #[prost(message, tag = "8")]
89        ProgressChanged(super::UpdateProgress),
90    }
91}
92/// Indicate that some events could not be send
93/// Like a "Lagged" Error from tokio-stream
94#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
95pub struct UpdateMissedEvents {
96    #[prost(uint64, tag = "1")]
97    pub amount: u64,
98}
99/// The Volume changed, send new information
100#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
101pub struct UpdateVolumeChanged {
102    /// reuse the existing message
103    #[prost(message, optional, tag = "1")]
104    pub msg: ::core::option::Option<VolumeReply>,
105}
106/// The Speed changed, send new information
107#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
108pub struct UpdateSpeedChanged {
109    /// reuse the existing message
110    #[prost(message, optional, tag = "1")]
111    pub msg: ::core::option::Option<SpeedReply>,
112}
113/// TODO: is play-state (playing / paused / ??) the only things this should do?
114#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
115pub struct UpdatePlayStateChanged {
116    /// reuse the existing message
117    #[prost(message, optional, tag = "1")]
118    pub msg: ::core::option::Option<PlayState>,
119}
120/// The Gapless state changed, send new information.
121#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
122pub struct UpdateGaplessChanged {
123    /// reuse the existing message
124    #[prost(message, optional, tag = "1")]
125    pub msg: ::core::option::Option<GaplessState>,
126}
127/// The track changed in some way, send new information
128/// This includes everything from changing to a new track, new radio title, etc
129/// This is *not* used for regular track progress updates
130/// NOTE: this may or may not be sent for the initial track after startup as the client may connect after the track started
131#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
132pub struct UpdateTrackChanged {
133    /// The index into the playlist of which track changed.
134    #[prost(uint64, tag = "1")]
135    pub current_track_index: u64,
136    /// Indicates if this update is a change to a new track (not just metadata change)
137    #[prost(bool, tag = "2")]
138    pub current_track_updated: bool,
139    #[prost(message, optional, tag = "4")]
140    pub progress: ::core::option::Option<PlayerTime>,
141    /// all values below should be moved into their own "Track" message at some point
142    /// instead of having the TUI fetch everything from the file itself
143    /// radio title, track title
144    /// the following is (linux protobuf) 3.15, ubuntu 2204 still has (linux protobuf) 3.12
145    /// optional string title = 3;
146    /// the following "oneof" is wire equivalent to the above "optional"
147    #[prost(oneof = "update_track_changed::OptionalTitle", tags = "3")]
148    pub optional_title: ::core::option::Option<update_track_changed::OptionalTitle>,
149}
150/// Nested message and enum types in `UpdateTrackChanged`.
151pub mod update_track_changed {
152    /// all values below should be moved into their own "Track" message at some point
153    /// instead of having the TUI fetch everything from the file itself
154    /// radio title, track title
155    /// the following is (linux protobuf) 3.15, ubuntu 2204 still has (linux protobuf) 3.12
156    /// optional string title = 3;
157    /// the following "oneof" is wire equivalent to the above "optional"
158    #[derive(Clone, PartialEq, Eq, Hash, ::prost::Oneof)]
159    pub enum OptionalTitle {
160        #[prost(string, tag = "3")]
161        Title(::prost::alloc::string::String),
162    }
163}
164/// There is a progress update to the currently playing track, may not be fired if paused or stopped
165#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
166pub struct UpdateProgress {
167    #[prost(message, optional, tag = "1")]
168    pub progress: ::core::option::Option<PlayerTime>,
169}
170/// Play a specific track in the playlist
171#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
172pub struct PlaylistPlaySpecific {
173    #[prost(uint64, tag = "1")]
174    pub track_index: u64,
175    #[prost(message, optional, tag = "2")]
176    pub id: ::core::option::Option<TrackId>,
177}
178/// All tracks in the current playlist, they *should* be ordered from lowest to highest index.
179#[derive(Clone, PartialEq, ::prost::Message)]
180pub struct PlaylistTracks {
181    #[prost(uint64, tag = "1")]
182    pub current_track_index: u64,
183    #[prost(message, repeated, tag = "2")]
184    pub tracks: ::prost::alloc::vec::Vec<PlaylistAddTrack>,
185}
186#[derive(Clone, PartialEq, ::prost::Message)]
187pub struct UpdatePlaylist {
188    #[prost(oneof = "update_playlist::Type", tags = "1, 2, 3, 4, 5, 6")]
189    pub r#type: ::core::option::Option<update_playlist::Type>,
190}
191/// Nested message and enum types in `UpdatePlaylist`.
192pub mod update_playlist {
193    #[derive(Clone, PartialEq, ::prost::Oneof)]
194    pub enum Type {
195        #[prost(message, tag = "1")]
196        AddTrack(super::PlaylistAddTrack),
197        #[prost(message, tag = "2")]
198        RemoveTrack(super::PlaylistRemoveTrack),
199        #[prost(message, tag = "3")]
200        Cleared(super::PlaylistCleared),
201        #[prost(message, tag = "4")]
202        LoopMode(super::PlaylistLoopMode),
203        #[prost(message, tag = "5")]
204        SwapTracks(super::PlaylistSwapTracks),
205        #[prost(message, tag = "6")]
206        Shuffled(super::PlaylistShuffled),
207    }
208}
209/// A Track got added to the playlist, this message contains where it was added and all the metadata required for display.
210#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
211pub struct PlaylistAddTrack {
212    /// The index the track was added to the playlist.
213    /// If this is not at the end, all tracks at that index and after need to be shifted to make place for this new one.
214    #[prost(uint64, tag = "1")]
215    pub at_index: u64,
216    /// TODO: allow this to be optional for unknown durations
217    #[prost(message, optional, tag = "3")]
218    pub duration: ::core::option::Option<Duration>,
219    /// The Id of the track that was added
220    #[prost(message, optional, tag = "4")]
221    pub id: ::core::option::Option<TrackId>,
222    /// all values below should be moved into their own "Track" message at some point
223    /// instead of having the TUI fetch everything from the file itself
224    /// radio title, track title
225    /// the following is (linux protobuf) 3.15, ubuntu 2204 still has (linux protobuf) 3.12
226    /// optional string title = 3;
227    /// the following "oneof" is wire equivalent to the above "optional"
228    #[prost(oneof = "playlist_add_track::OptionalTitle", tags = "2")]
229    pub optional_title: ::core::option::Option<playlist_add_track::OptionalTitle>,
230}
231/// Nested message and enum types in `PlaylistAddTrack`.
232pub mod playlist_add_track {
233    /// all values below should be moved into their own "Track" message at some point
234    /// instead of having the TUI fetch everything from the file itself
235    /// radio title, track title
236    /// the following is (linux protobuf) 3.15, ubuntu 2204 still has (linux protobuf) 3.12
237    /// optional string title = 3;
238    /// the following "oneof" is wire equivalent to the above "optional"
239    #[derive(Clone, PartialEq, Eq, Hash, ::prost::Oneof)]
240    pub enum OptionalTitle {
241        #[prost(string, tag = "2")]
242        Title(::prost::alloc::string::String),
243    }
244}
245/// A Track got removed from the playlist.
246#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
247pub struct PlaylistRemoveTrack {
248    /// The index of the track that was removed.
249    #[prost(uint64, tag = "1")]
250    pub at_index: u64,
251    /// The Id of the track that was removed
252    #[prost(message, optional, tag = "2")]
253    pub id: ::core::option::Option<TrackId>,
254}
255/// The Playlist got completely cleared
256///
257/// empty as there are no values, but not using "Empty" to have a unique message id
258#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
259pub struct PlaylistCleared {}
260/// The current Loop mode for the playlist
261#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
262pub struct PlaylistLoopMode {
263    /// The actual mode, mapped to \[`config::v2::server::LoopMode`\]
264    #[prost(uint32, tag = "1")]
265    pub mode: u32,
266}
267/// Some track needs to be swapped.
268#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
269pub struct PlaylistSwapTracks {
270    /// The first index to swap
271    #[prost(uint64, tag = "1")]
272    pub index_a: u64,
273    /// The second index to swap
274    #[prost(uint64, tag = "2")]
275    pub index_b: u64,
276}
277/// Add multiple tracks to a Playlist
278#[derive(Clone, PartialEq, ::prost::Message)]
279pub struct PlaylistTracksToAdd {
280    /// The index the track(s) are added at.
281    /// If this is not at the end, all tracks at that index and after need to be shifted to make place for this new one.
282    #[prost(uint64, tag = "1")]
283    pub at_index: u64,
284    /// All the Tracks to add at the index
285    #[prost(message, repeated, tag = "2")]
286    pub tracks: ::prost::alloc::vec::Vec<TrackId>,
287}
288/// Remove multiple track or clear the playlist
289#[derive(Clone, PartialEq, ::prost::Message)]
290pub struct PlaylistTracksToRemove {
291    #[prost(oneof = "playlist_tracks_to_remove::Type", tags = "1, 2")]
292    pub r#type: ::core::option::Option<playlist_tracks_to_remove::Type>,
293}
294/// Nested message and enum types in `PlaylistTracksToRemove`.
295pub mod playlist_tracks_to_remove {
296    #[derive(Clone, PartialEq, ::prost::Oneof)]
297    pub enum Type {
298        #[prost(message, tag = "1")]
299        Indexed(super::PlaylistTracksToRemoveIndexed),
300        #[prost(message, tag = "2")]
301        Clear(super::PlaylistTracksToRemoveClear),
302    }
303}
304/// Remove multiple tracks from a playlist
305#[derive(Clone, PartialEq, ::prost::Message)]
306pub struct PlaylistTracksToRemoveIndexed {
307    /// The index the track(s) that are removed
308    /// This is the starting index, and x amount of elements are removed after
309    #[prost(uint64, tag = "1")]
310    pub at_index: u64,
311    /// All the Tracks to remove at the index
312    #[prost(message, repeated, tag = "2")]
313    pub tracks: ::prost::alloc::vec::Vec<TrackId>,
314}
315/// / Clear the entire playlist
316///
317/// empty as there are no values, but not using "Empty" to have a unique message id
318#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
319pub struct PlaylistTracksToRemoveClear {}
320/// / Indicate that the playlist has been shuffled and should be re-fetched
321#[derive(Clone, PartialEq, ::prost::Message)]
322pub struct PlaylistShuffled {
323    #[prost(message, optional, tag = "1")]
324    pub shuffled: ::core::option::Option<PlaylistTracks>,
325}
326/// A Identifier for a track.
327#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
328pub struct TrackId {
329    #[prost(oneof = "track_id::Source", tags = "1, 2, 3")]
330    pub source: ::core::option::Option<track_id::Source>,
331}
332/// Nested message and enum types in `TrackId`.
333pub mod track_id {
334    #[derive(Clone, PartialEq, Eq, Hash, ::prost::Oneof)]
335    pub enum Source {
336        /// Path on the system
337        /// bytes *could* be used, but it way more complex and platform dependant
338        #[prost(string, tag = "1")]
339        Path(::prost::alloc::string::String),
340        /// Url (ex. radio)
341        #[prost(string, tag = "2")]
342        Url(::prost::alloc::string::String),
343        /// A podcast episode
344        #[prost(string, tag = "3")]
345        PodcastUrl(::prost::alloc::string::String),
346    }
347}
348/// Generated client implementations.
349pub mod music_player_client {
350    #![allow(
351        unused_variables,
352        dead_code,
353        missing_docs,
354        clippy::wildcard_imports,
355        clippy::let_unit_value,
356    )]
357    use tonic::codegen::*;
358    use tonic::codegen::http::Uri;
359    #[derive(Debug, Clone)]
360    pub struct MusicPlayerClient<T> {
361        inner: tonic::client::Grpc<T>,
362    }
363    impl MusicPlayerClient<tonic::transport::Channel> {
364        /// Attempt to create a new client by connecting to a given endpoint.
365        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
366        where
367            D: TryInto<tonic::transport::Endpoint>,
368            D::Error: Into<StdError>,
369        {
370            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
371            Ok(Self::new(conn))
372        }
373    }
374    impl<T> MusicPlayerClient<T>
375    where
376        T: tonic::client::GrpcService<tonic::body::Body>,
377        T::Error: Into<StdError>,
378        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
379        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
380    {
381        pub fn new(inner: T) -> Self {
382            let inner = tonic::client::Grpc::new(inner);
383            Self { inner }
384        }
385        pub fn with_origin(inner: T, origin: Uri) -> Self {
386            let inner = tonic::client::Grpc::with_origin(inner, origin);
387            Self { inner }
388        }
389        pub fn with_interceptor<F>(
390            inner: T,
391            interceptor: F,
392        ) -> MusicPlayerClient<InterceptedService<T, F>>
393        where
394            F: tonic::service::Interceptor,
395            T::ResponseBody: Default,
396            T: tonic::codegen::Service<
397                http::Request<tonic::body::Body>,
398                Response = http::Response<
399                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
400                >,
401            >,
402            <T as tonic::codegen::Service<
403                http::Request<tonic::body::Body>,
404            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
405        {
406            MusicPlayerClient::new(InterceptedService::new(inner, interceptor))
407        }
408        /// Compress requests with the given encoding.
409        ///
410        /// This requires the server to support it otherwise it might respond with an
411        /// error.
412        #[must_use]
413        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
414            self.inner = self.inner.send_compressed(encoding);
415            self
416        }
417        /// Enable decompressing responses.
418        #[must_use]
419        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
420            self.inner = self.inner.accept_compressed(encoding);
421            self
422        }
423        /// Limits the maximum size of a decoded message.
424        ///
425        /// Default: `4MB`
426        #[must_use]
427        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
428            self.inner = self.inner.max_decoding_message_size(limit);
429            self
430        }
431        /// Limits the maximum size of an encoded message.
432        ///
433        /// Default: `usize::MAX`
434        #[must_use]
435        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
436            self.inner = self.inner.max_encoding_message_size(limit);
437            self
438        }
439        /// Player Commands
440        /// Toggle Pause/Play, returns the new state
441        pub async fn toggle_pause(
442            &mut self,
443            request: impl tonic::IntoRequest<super::Empty>,
444        ) -> std::result::Result<tonic::Response<super::PlayState>, tonic::Status> {
445            self.inner
446                .ready()
447                .await
448                .map_err(|e| {
449                    tonic::Status::unknown(
450                        format!("Service was not ready: {}", e.into()),
451                    )
452                })?;
453            let codec = tonic_prost::ProstCodec::default();
454            let path = http::uri::PathAndQuery::from_static(
455                "/player.MusicPlayer/TogglePause",
456            );
457            let mut req = request.into_request();
458            req.extensions_mut()
459                .insert(GrpcMethod::new("player.MusicPlayer", "TogglePause"));
460            self.inner.unary(req, path, codec).await
461        }
462        pub async fn skip_next(
463            &mut self,
464            request: impl tonic::IntoRequest<super::Empty>,
465        ) -> std::result::Result<tonic::Response<super::Empty>, tonic::Status> {
466            self.inner
467                .ready()
468                .await
469                .map_err(|e| {
470                    tonic::Status::unknown(
471                        format!("Service was not ready: {}", e.into()),
472                    )
473                })?;
474            let codec = tonic_prost::ProstCodec::default();
475            let path = http::uri::PathAndQuery::from_static(
476                "/player.MusicPlayer/SkipNext",
477            );
478            let mut req = request.into_request();
479            req.extensions_mut()
480                .insert(GrpcMethod::new("player.MusicPlayer", "SkipNext"));
481            self.inner.unary(req, path, codec).await
482        }
483        pub async fn skip_previous(
484            &mut self,
485            request: impl tonic::IntoRequest<super::Empty>,
486        ) -> std::result::Result<tonic::Response<super::Empty>, tonic::Status> {
487            self.inner
488                .ready()
489                .await
490                .map_err(|e| {
491                    tonic::Status::unknown(
492                        format!("Service was not ready: {}", e.into()),
493                    )
494                })?;
495            let codec = tonic_prost::ProstCodec::default();
496            let path = http::uri::PathAndQuery::from_static(
497                "/player.MusicPlayer/SkipPrevious",
498            );
499            let mut req = request.into_request();
500            req.extensions_mut()
501                .insert(GrpcMethod::new("player.MusicPlayer", "SkipPrevious"));
502            self.inner.unary(req, path, codec).await
503        }
504        pub async fn get_progress(
505            &mut self,
506            request: impl tonic::IntoRequest<super::Empty>,
507        ) -> std::result::Result<
508            tonic::Response<super::GetProgressResponse>,
509            tonic::Status,
510        > {
511            self.inner
512                .ready()
513                .await
514                .map_err(|e| {
515                    tonic::Status::unknown(
516                        format!("Service was not ready: {}", e.into()),
517                    )
518                })?;
519            let codec = tonic_prost::ProstCodec::default();
520            let path = http::uri::PathAndQuery::from_static(
521                "/player.MusicPlayer/GetProgress",
522            );
523            let mut req = request.into_request();
524            req.extensions_mut()
525                .insert(GrpcMethod::new("player.MusicPlayer", "GetProgress"));
526            self.inner.unary(req, path, codec).await
527        }
528        pub async fn volume_up(
529            &mut self,
530            request: impl tonic::IntoRequest<super::Empty>,
531        ) -> std::result::Result<tonic::Response<super::VolumeReply>, tonic::Status> {
532            self.inner
533                .ready()
534                .await
535                .map_err(|e| {
536                    tonic::Status::unknown(
537                        format!("Service was not ready: {}", e.into()),
538                    )
539                })?;
540            let codec = tonic_prost::ProstCodec::default();
541            let path = http::uri::PathAndQuery::from_static(
542                "/player.MusicPlayer/VolumeUp",
543            );
544            let mut req = request.into_request();
545            req.extensions_mut()
546                .insert(GrpcMethod::new("player.MusicPlayer", "VolumeUp"));
547            self.inner.unary(req, path, codec).await
548        }
549        pub async fn volume_down(
550            &mut self,
551            request: impl tonic::IntoRequest<super::Empty>,
552        ) -> std::result::Result<tonic::Response<super::VolumeReply>, tonic::Status> {
553            self.inner
554                .ready()
555                .await
556                .map_err(|e| {
557                    tonic::Status::unknown(
558                        format!("Service was not ready: {}", e.into()),
559                    )
560                })?;
561            let codec = tonic_prost::ProstCodec::default();
562            let path = http::uri::PathAndQuery::from_static(
563                "/player.MusicPlayer/VolumeDown",
564            );
565            let mut req = request.into_request();
566            req.extensions_mut()
567                .insert(GrpcMethod::new("player.MusicPlayer", "VolumeDown"));
568            self.inner.unary(req, path, codec).await
569        }
570        pub async fn speed_up(
571            &mut self,
572            request: impl tonic::IntoRequest<super::Empty>,
573        ) -> std::result::Result<tonic::Response<super::SpeedReply>, tonic::Status> {
574            self.inner
575                .ready()
576                .await
577                .map_err(|e| {
578                    tonic::Status::unknown(
579                        format!("Service was not ready: {}", e.into()),
580                    )
581                })?;
582            let codec = tonic_prost::ProstCodec::default();
583            let path = http::uri::PathAndQuery::from_static(
584                "/player.MusicPlayer/SpeedUp",
585            );
586            let mut req = request.into_request();
587            req.extensions_mut()
588                .insert(GrpcMethod::new("player.MusicPlayer", "SpeedUp"));
589            self.inner.unary(req, path, codec).await
590        }
591        pub async fn speed_down(
592            &mut self,
593            request: impl tonic::IntoRequest<super::Empty>,
594        ) -> std::result::Result<tonic::Response<super::SpeedReply>, tonic::Status> {
595            self.inner
596                .ready()
597                .await
598                .map_err(|e| {
599                    tonic::Status::unknown(
600                        format!("Service was not ready: {}", e.into()),
601                    )
602                })?;
603            let codec = tonic_prost::ProstCodec::default();
604            let path = http::uri::PathAndQuery::from_static(
605                "/player.MusicPlayer/SpeedDown",
606            );
607            let mut req = request.into_request();
608            req.extensions_mut()
609                .insert(GrpcMethod::new("player.MusicPlayer", "SpeedDown"));
610            self.inner.unary(req, path, codec).await
611        }
612        /// Toggle the gapless mdoe, returns the new state.
613        pub async fn toggle_gapless(
614            &mut self,
615            request: impl tonic::IntoRequest<super::Empty>,
616        ) -> std::result::Result<tonic::Response<super::GaplessState>, tonic::Status> {
617            self.inner
618                .ready()
619                .await
620                .map_err(|e| {
621                    tonic::Status::unknown(
622                        format!("Service was not ready: {}", e.into()),
623                    )
624                })?;
625            let codec = tonic_prost::ProstCodec::default();
626            let path = http::uri::PathAndQuery::from_static(
627                "/player.MusicPlayer/ToggleGapless",
628            );
629            let mut req = request.into_request();
630            req.extensions_mut()
631                .insert(GrpcMethod::new("player.MusicPlayer", "ToggleGapless"));
632            self.inner.unary(req, path, codec).await
633        }
634        pub async fn seek_forward(
635            &mut self,
636            request: impl tonic::IntoRequest<super::Empty>,
637        ) -> std::result::Result<tonic::Response<super::PlayerTime>, tonic::Status> {
638            self.inner
639                .ready()
640                .await
641                .map_err(|e| {
642                    tonic::Status::unknown(
643                        format!("Service was not ready: {}", e.into()),
644                    )
645                })?;
646            let codec = tonic_prost::ProstCodec::default();
647            let path = http::uri::PathAndQuery::from_static(
648                "/player.MusicPlayer/SeekForward",
649            );
650            let mut req = request.into_request();
651            req.extensions_mut()
652                .insert(GrpcMethod::new("player.MusicPlayer", "SeekForward"));
653            self.inner.unary(req, path, codec).await
654        }
655        pub async fn seek_backward(
656            &mut self,
657            request: impl tonic::IntoRequest<super::Empty>,
658        ) -> std::result::Result<tonic::Response<super::PlayerTime>, tonic::Status> {
659            self.inner
660                .ready()
661                .await
662                .map_err(|e| {
663                    tonic::Status::unknown(
664                        format!("Service was not ready: {}", e.into()),
665                    )
666                })?;
667            let codec = tonic_prost::ProstCodec::default();
668            let path = http::uri::PathAndQuery::from_static(
669                "/player.MusicPlayer/SeekBackward",
670            );
671            let mut req = request.into_request();
672            req.extensions_mut()
673                .insert(GrpcMethod::new("player.MusicPlayer", "SeekBackward"));
674            self.inner.unary(req, path, codec).await
675        }
676        /// Playlist Commands
677        /// Skip to a specific track in the playlist
678        /// at the momemnt, the one set via "current_track_index"
679        pub async fn play_specific(
680            &mut self,
681            request: impl tonic::IntoRequest<super::PlaylistPlaySpecific>,
682        ) -> std::result::Result<tonic::Response<super::Empty>, tonic::Status> {
683            self.inner
684                .ready()
685                .await
686                .map_err(|e| {
687                    tonic::Status::unknown(
688                        format!("Service was not ready: {}", e.into()),
689                    )
690                })?;
691            let codec = tonic_prost::ProstCodec::default();
692            let path = http::uri::PathAndQuery::from_static(
693                "/player.MusicPlayer/PlaySpecific",
694            );
695            let mut req = request.into_request();
696            req.extensions_mut()
697                .insert(GrpcMethod::new("player.MusicPlayer", "PlaySpecific"));
698            self.inner.unary(req, path, codec).await
699        }
700        /// Cycle the playlist loop mode, returns the new mode.
701        pub async fn cycle_loop(
702            &mut self,
703            request: impl tonic::IntoRequest<super::Empty>,
704        ) -> std::result::Result<
705            tonic::Response<super::PlaylistLoopMode>,
706            tonic::Status,
707        > {
708            self.inner
709                .ready()
710                .await
711                .map_err(|e| {
712                    tonic::Status::unknown(
713                        format!("Service was not ready: {}", e.into()),
714                    )
715                })?;
716            let codec = tonic_prost::ProstCodec::default();
717            let path = http::uri::PathAndQuery::from_static(
718                "/player.MusicPlayer/CycleLoop",
719            );
720            let mut req = request.into_request();
721            req.extensions_mut()
722                .insert(GrpcMethod::new("player.MusicPlayer", "CycleLoop"));
723            self.inner.unary(req, path, codec).await
724        }
725        /// Add one or multiple tracks to the playlist
726        pub async fn add_to_playlist(
727            &mut self,
728            request: impl tonic::IntoRequest<super::PlaylistTracksToAdd>,
729        ) -> std::result::Result<tonic::Response<super::Empty>, tonic::Status> {
730            self.inner
731                .ready()
732                .await
733                .map_err(|e| {
734                    tonic::Status::unknown(
735                        format!("Service was not ready: {}", e.into()),
736                    )
737                })?;
738            let codec = tonic_prost::ProstCodec::default();
739            let path = http::uri::PathAndQuery::from_static(
740                "/player.MusicPlayer/AddToPlaylist",
741            );
742            let mut req = request.into_request();
743            req.extensions_mut()
744                .insert(GrpcMethod::new("player.MusicPlayer", "AddToPlaylist"));
745            self.inner.unary(req, path, codec).await
746        }
747        /// Remove one or multiple tracks from the playlist
748        pub async fn remove_from_playlist(
749            &mut self,
750            request: impl tonic::IntoRequest<super::PlaylistTracksToRemove>,
751        ) -> std::result::Result<tonic::Response<super::Empty>, tonic::Status> {
752            self.inner
753                .ready()
754                .await
755                .map_err(|e| {
756                    tonic::Status::unknown(
757                        format!("Service was not ready: {}", e.into()),
758                    )
759                })?;
760            let codec = tonic_prost::ProstCodec::default();
761            let path = http::uri::PathAndQuery::from_static(
762                "/player.MusicPlayer/RemoveFromPlaylist",
763            );
764            let mut req = request.into_request();
765            req.extensions_mut()
766                .insert(GrpcMethod::new("player.MusicPlayer", "RemoveFromPlaylist"));
767            self.inner.unary(req, path, codec).await
768        }
769        /// Swap some tracks.
770        pub async fn swap_tracks(
771            &mut self,
772            request: impl tonic::IntoRequest<super::PlaylistSwapTracks>,
773        ) -> std::result::Result<tonic::Response<super::Empty>, tonic::Status> {
774            self.inner
775                .ready()
776                .await
777                .map_err(|e| {
778                    tonic::Status::unknown(
779                        format!("Service was not ready: {}", e.into()),
780                    )
781                })?;
782            let codec = tonic_prost::ProstCodec::default();
783            let path = http::uri::PathAndQuery::from_static(
784                "/player.MusicPlayer/SwapTracks",
785            );
786            let mut req = request.into_request();
787            req.extensions_mut()
788                .insert(GrpcMethod::new("player.MusicPlayer", "SwapTracks"));
789            self.inner.unary(req, path, codec).await
790        }
791        /// Get all tracks of the playlist.
792        pub async fn get_playlist(
793            &mut self,
794            request: impl tonic::IntoRequest<super::Empty>,
795        ) -> std::result::Result<tonic::Response<super::PlaylistTracks>, tonic::Status> {
796            self.inner
797                .ready()
798                .await
799                .map_err(|e| {
800                    tonic::Status::unknown(
801                        format!("Service was not ready: {}", e.into()),
802                    )
803                })?;
804            let codec = tonic_prost::ProstCodec::default();
805            let path = http::uri::PathAndQuery::from_static(
806                "/player.MusicPlayer/GetPlaylist",
807            );
808            let mut req = request.into_request();
809            req.extensions_mut()
810                .insert(GrpcMethod::new("player.MusicPlayer", "GetPlaylist"));
811            self.inner.unary(req, path, codec).await
812        }
813        /// Shuffle the playlist, returns the new playlist tracks.
814        pub async fn shuffle_playlist(
815            &mut self,
816            request: impl tonic::IntoRequest<super::Empty>,
817        ) -> std::result::Result<tonic::Response<super::Empty>, tonic::Status> {
818            self.inner
819                .ready()
820                .await
821                .map_err(|e| {
822                    tonic::Status::unknown(
823                        format!("Service was not ready: {}", e.into()),
824                    )
825                })?;
826            let codec = tonic_prost::ProstCodec::default();
827            let path = http::uri::PathAndQuery::from_static(
828                "/player.MusicPlayer/ShufflePlaylist",
829            );
830            let mut req = request.into_request();
831            req.extensions_mut()
832                .insert(GrpcMethod::new("player.MusicPlayer", "ShufflePlaylist"));
833            self.inner.unary(req, path, codec).await
834        }
835        /// Check for and remove deleted items from the playlist.
836        /// Unlike shuffle, this will send Removal events
837        pub async fn remove_deleted_tracks(
838            &mut self,
839            request: impl tonic::IntoRequest<super::Empty>,
840        ) -> std::result::Result<tonic::Response<super::Empty>, tonic::Status> {
841            self.inner
842                .ready()
843                .await
844                .map_err(|e| {
845                    tonic::Status::unknown(
846                        format!("Service was not ready: {}", e.into()),
847                    )
848                })?;
849            let codec = tonic_prost::ProstCodec::default();
850            let path = http::uri::PathAndQuery::from_static(
851                "/player.MusicPlayer/RemoveDeletedTracks",
852            );
853            let mut req = request.into_request();
854            req.extensions_mut()
855                .insert(GrpcMethod::new("player.MusicPlayer", "RemoveDeletedTracks"));
856            self.inner.unary(req, path, codec).await
857        }
858        /// Misc Commands
859        pub async fn reload_config(
860            &mut self,
861            request: impl tonic::IntoRequest<super::Empty>,
862        ) -> std::result::Result<tonic::Response<super::Empty>, tonic::Status> {
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                })?;
871            let codec = tonic_prost::ProstCodec::default();
872            let path = http::uri::PathAndQuery::from_static(
873                "/player.MusicPlayer/ReloadConfig",
874            );
875            let mut req = request.into_request();
876            req.extensions_mut()
877                .insert(GrpcMethod::new("player.MusicPlayer", "ReloadConfig"));
878            self.inner.unary(req, path, codec).await
879        }
880        pub async fn subscribe_server_updates(
881            &mut self,
882            request: impl tonic::IntoRequest<super::Empty>,
883        ) -> std::result::Result<
884            tonic::Response<tonic::codec::Streaming<super::StreamUpdates>>,
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                })?;
895            let codec = tonic_prost::ProstCodec::default();
896            let path = http::uri::PathAndQuery::from_static(
897                "/player.MusicPlayer/SubscribeServerUpdates",
898            );
899            let mut req = request.into_request();
900            req.extensions_mut()
901                .insert(GrpcMethod::new("player.MusicPlayer", "SubscribeServerUpdates"));
902            self.inner.server_streaming(req, path, codec).await
903        }
904    }
905}
906/// Generated server implementations.
907pub mod music_player_server {
908    #![allow(
909        unused_variables,
910        dead_code,
911        missing_docs,
912        clippy::wildcard_imports,
913        clippy::let_unit_value,
914    )]
915    use tonic::codegen::*;
916    /// Generated trait containing gRPC methods that should be implemented for use with MusicPlayerServer.
917    #[async_trait]
918    pub trait MusicPlayer: std::marker::Send + std::marker::Sync + 'static {
919        /// Player Commands
920        /// Toggle Pause/Play, returns the new state
921        async fn toggle_pause(
922            &self,
923            request: tonic::Request<super::Empty>,
924        ) -> std::result::Result<tonic::Response<super::PlayState>, tonic::Status>;
925        async fn skip_next(
926            &self,
927            request: tonic::Request<super::Empty>,
928        ) -> std::result::Result<tonic::Response<super::Empty>, tonic::Status>;
929        async fn skip_previous(
930            &self,
931            request: tonic::Request<super::Empty>,
932        ) -> std::result::Result<tonic::Response<super::Empty>, tonic::Status>;
933        async fn get_progress(
934            &self,
935            request: tonic::Request<super::Empty>,
936        ) -> std::result::Result<
937            tonic::Response<super::GetProgressResponse>,
938            tonic::Status,
939        >;
940        async fn volume_up(
941            &self,
942            request: tonic::Request<super::Empty>,
943        ) -> std::result::Result<tonic::Response<super::VolumeReply>, tonic::Status>;
944        async fn volume_down(
945            &self,
946            request: tonic::Request<super::Empty>,
947        ) -> std::result::Result<tonic::Response<super::VolumeReply>, tonic::Status>;
948        async fn speed_up(
949            &self,
950            request: tonic::Request<super::Empty>,
951        ) -> std::result::Result<tonic::Response<super::SpeedReply>, tonic::Status>;
952        async fn speed_down(
953            &self,
954            request: tonic::Request<super::Empty>,
955        ) -> std::result::Result<tonic::Response<super::SpeedReply>, tonic::Status>;
956        /// Toggle the gapless mdoe, returns the new state.
957        async fn toggle_gapless(
958            &self,
959            request: tonic::Request<super::Empty>,
960        ) -> std::result::Result<tonic::Response<super::GaplessState>, tonic::Status>;
961        async fn seek_forward(
962            &self,
963            request: tonic::Request<super::Empty>,
964        ) -> std::result::Result<tonic::Response<super::PlayerTime>, tonic::Status>;
965        async fn seek_backward(
966            &self,
967            request: tonic::Request<super::Empty>,
968        ) -> std::result::Result<tonic::Response<super::PlayerTime>, tonic::Status>;
969        /// Playlist Commands
970        /// Skip to a specific track in the playlist
971        /// at the momemnt, the one set via "current_track_index"
972        async fn play_specific(
973            &self,
974            request: tonic::Request<super::PlaylistPlaySpecific>,
975        ) -> std::result::Result<tonic::Response<super::Empty>, tonic::Status>;
976        /// Cycle the playlist loop mode, returns the new mode.
977        async fn cycle_loop(
978            &self,
979            request: tonic::Request<super::Empty>,
980        ) -> std::result::Result<
981            tonic::Response<super::PlaylistLoopMode>,
982            tonic::Status,
983        >;
984        /// Add one or multiple tracks to the playlist
985        async fn add_to_playlist(
986            &self,
987            request: tonic::Request<super::PlaylistTracksToAdd>,
988        ) -> std::result::Result<tonic::Response<super::Empty>, tonic::Status>;
989        /// Remove one or multiple tracks from the playlist
990        async fn remove_from_playlist(
991            &self,
992            request: tonic::Request<super::PlaylistTracksToRemove>,
993        ) -> std::result::Result<tonic::Response<super::Empty>, tonic::Status>;
994        /// Swap some tracks.
995        async fn swap_tracks(
996            &self,
997            request: tonic::Request<super::PlaylistSwapTracks>,
998        ) -> std::result::Result<tonic::Response<super::Empty>, tonic::Status>;
999        /// Get all tracks of the playlist.
1000        async fn get_playlist(
1001            &self,
1002            request: tonic::Request<super::Empty>,
1003        ) -> std::result::Result<tonic::Response<super::PlaylistTracks>, tonic::Status>;
1004        /// Shuffle the playlist, returns the new playlist tracks.
1005        async fn shuffle_playlist(
1006            &self,
1007            request: tonic::Request<super::Empty>,
1008        ) -> std::result::Result<tonic::Response<super::Empty>, tonic::Status>;
1009        /// Check for and remove deleted items from the playlist.
1010        /// Unlike shuffle, this will send Removal events
1011        async fn remove_deleted_tracks(
1012            &self,
1013            request: tonic::Request<super::Empty>,
1014        ) -> std::result::Result<tonic::Response<super::Empty>, tonic::Status>;
1015        /// Misc Commands
1016        async fn reload_config(
1017            &self,
1018            request: tonic::Request<super::Empty>,
1019        ) -> std::result::Result<tonic::Response<super::Empty>, tonic::Status>;
1020        /// Server streaming response type for the SubscribeServerUpdates method.
1021        type SubscribeServerUpdatesStream: tonic::codegen::tokio_stream::Stream<
1022                Item = std::result::Result<super::StreamUpdates, tonic::Status>,
1023            >
1024            + std::marker::Send
1025            + 'static;
1026        async fn subscribe_server_updates(
1027            &self,
1028            request: tonic::Request<super::Empty>,
1029        ) -> std::result::Result<
1030            tonic::Response<Self::SubscribeServerUpdatesStream>,
1031            tonic::Status,
1032        >;
1033    }
1034    #[derive(Debug)]
1035    pub struct MusicPlayerServer<T> {
1036        inner: Arc<T>,
1037        accept_compression_encodings: EnabledCompressionEncodings,
1038        send_compression_encodings: EnabledCompressionEncodings,
1039        max_decoding_message_size: Option<usize>,
1040        max_encoding_message_size: Option<usize>,
1041    }
1042    impl<T> MusicPlayerServer<T> {
1043        pub fn new(inner: T) -> Self {
1044            Self::from_arc(Arc::new(inner))
1045        }
1046        pub fn from_arc(inner: Arc<T>) -> Self {
1047            Self {
1048                inner,
1049                accept_compression_encodings: Default::default(),
1050                send_compression_encodings: Default::default(),
1051                max_decoding_message_size: None,
1052                max_encoding_message_size: None,
1053            }
1054        }
1055        pub fn with_interceptor<F>(
1056            inner: T,
1057            interceptor: F,
1058        ) -> InterceptedService<Self, F>
1059        where
1060            F: tonic::service::Interceptor,
1061        {
1062            InterceptedService::new(Self::new(inner), interceptor)
1063        }
1064        /// Enable decompressing requests with the given encoding.
1065        #[must_use]
1066        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
1067            self.accept_compression_encodings.enable(encoding);
1068            self
1069        }
1070        /// Compress responses with the given encoding, if the client supports it.
1071        #[must_use]
1072        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
1073            self.send_compression_encodings.enable(encoding);
1074            self
1075        }
1076        /// Limits the maximum size of a decoded message.
1077        ///
1078        /// Default: `4MB`
1079        #[must_use]
1080        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
1081            self.max_decoding_message_size = Some(limit);
1082            self
1083        }
1084        /// Limits the maximum size of an encoded message.
1085        ///
1086        /// Default: `usize::MAX`
1087        #[must_use]
1088        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
1089            self.max_encoding_message_size = Some(limit);
1090            self
1091        }
1092    }
1093    impl<T, B> tonic::codegen::Service<http::Request<B>> for MusicPlayerServer<T>
1094    where
1095        T: MusicPlayer,
1096        B: Body + std::marker::Send + 'static,
1097        B::Error: Into<StdError> + std::marker::Send + 'static,
1098    {
1099        type Response = http::Response<tonic::body::Body>;
1100        type Error = std::convert::Infallible;
1101        type Future = BoxFuture<Self::Response, Self::Error>;
1102        fn poll_ready(
1103            &mut self,
1104            _cx: &mut Context<'_>,
1105        ) -> Poll<std::result::Result<(), Self::Error>> {
1106            Poll::Ready(Ok(()))
1107        }
1108        fn call(&mut self, req: http::Request<B>) -> Self::Future {
1109            match req.uri().path() {
1110                "/player.MusicPlayer/TogglePause" => {
1111                    #[allow(non_camel_case_types)]
1112                    struct TogglePauseSvc<T: MusicPlayer>(pub Arc<T>);
1113                    impl<T: MusicPlayer> tonic::server::UnaryService<super::Empty>
1114                    for TogglePauseSvc<T> {
1115                        type Response = super::PlayState;
1116                        type Future = BoxFuture<
1117                            tonic::Response<Self::Response>,
1118                            tonic::Status,
1119                        >;
1120                        fn call(
1121                            &mut self,
1122                            request: tonic::Request<super::Empty>,
1123                        ) -> Self::Future {
1124                            let inner = Arc::clone(&self.0);
1125                            let fut = async move {
1126                                <T as MusicPlayer>::toggle_pause(&inner, request).await
1127                            };
1128                            Box::pin(fut)
1129                        }
1130                    }
1131                    let accept_compression_encodings = self.accept_compression_encodings;
1132                    let send_compression_encodings = self.send_compression_encodings;
1133                    let max_decoding_message_size = self.max_decoding_message_size;
1134                    let max_encoding_message_size = self.max_encoding_message_size;
1135                    let inner = self.inner.clone();
1136                    let fut = async move {
1137                        let method = TogglePauseSvc(inner);
1138                        let codec = tonic_prost::ProstCodec::default();
1139                        let mut grpc = tonic::server::Grpc::new(codec)
1140                            .apply_compression_config(
1141                                accept_compression_encodings,
1142                                send_compression_encodings,
1143                            )
1144                            .apply_max_message_size_config(
1145                                max_decoding_message_size,
1146                                max_encoding_message_size,
1147                            );
1148                        let res = grpc.unary(method, req).await;
1149                        Ok(res)
1150                    };
1151                    Box::pin(fut)
1152                }
1153                "/player.MusicPlayer/SkipNext" => {
1154                    #[allow(non_camel_case_types)]
1155                    struct SkipNextSvc<T: MusicPlayer>(pub Arc<T>);
1156                    impl<T: MusicPlayer> tonic::server::UnaryService<super::Empty>
1157                    for SkipNextSvc<T> {
1158                        type Response = super::Empty;
1159                        type Future = BoxFuture<
1160                            tonic::Response<Self::Response>,
1161                            tonic::Status,
1162                        >;
1163                        fn call(
1164                            &mut self,
1165                            request: tonic::Request<super::Empty>,
1166                        ) -> Self::Future {
1167                            let inner = Arc::clone(&self.0);
1168                            let fut = async move {
1169                                <T as MusicPlayer>::skip_next(&inner, request).await
1170                            };
1171                            Box::pin(fut)
1172                        }
1173                    }
1174                    let accept_compression_encodings = self.accept_compression_encodings;
1175                    let send_compression_encodings = self.send_compression_encodings;
1176                    let max_decoding_message_size = self.max_decoding_message_size;
1177                    let max_encoding_message_size = self.max_encoding_message_size;
1178                    let inner = self.inner.clone();
1179                    let fut = async move {
1180                        let method = SkipNextSvc(inner);
1181                        let codec = tonic_prost::ProstCodec::default();
1182                        let mut grpc = tonic::server::Grpc::new(codec)
1183                            .apply_compression_config(
1184                                accept_compression_encodings,
1185                                send_compression_encodings,
1186                            )
1187                            .apply_max_message_size_config(
1188                                max_decoding_message_size,
1189                                max_encoding_message_size,
1190                            );
1191                        let res = grpc.unary(method, req).await;
1192                        Ok(res)
1193                    };
1194                    Box::pin(fut)
1195                }
1196                "/player.MusicPlayer/SkipPrevious" => {
1197                    #[allow(non_camel_case_types)]
1198                    struct SkipPreviousSvc<T: MusicPlayer>(pub Arc<T>);
1199                    impl<T: MusicPlayer> tonic::server::UnaryService<super::Empty>
1200                    for SkipPreviousSvc<T> {
1201                        type Response = super::Empty;
1202                        type Future = BoxFuture<
1203                            tonic::Response<Self::Response>,
1204                            tonic::Status,
1205                        >;
1206                        fn call(
1207                            &mut self,
1208                            request: tonic::Request<super::Empty>,
1209                        ) -> Self::Future {
1210                            let inner = Arc::clone(&self.0);
1211                            let fut = async move {
1212                                <T as MusicPlayer>::skip_previous(&inner, request).await
1213                            };
1214                            Box::pin(fut)
1215                        }
1216                    }
1217                    let accept_compression_encodings = self.accept_compression_encodings;
1218                    let send_compression_encodings = self.send_compression_encodings;
1219                    let max_decoding_message_size = self.max_decoding_message_size;
1220                    let max_encoding_message_size = self.max_encoding_message_size;
1221                    let inner = self.inner.clone();
1222                    let fut = async move {
1223                        let method = SkipPreviousSvc(inner);
1224                        let codec = tonic_prost::ProstCodec::default();
1225                        let mut grpc = tonic::server::Grpc::new(codec)
1226                            .apply_compression_config(
1227                                accept_compression_encodings,
1228                                send_compression_encodings,
1229                            )
1230                            .apply_max_message_size_config(
1231                                max_decoding_message_size,
1232                                max_encoding_message_size,
1233                            );
1234                        let res = grpc.unary(method, req).await;
1235                        Ok(res)
1236                    };
1237                    Box::pin(fut)
1238                }
1239                "/player.MusicPlayer/GetProgress" => {
1240                    #[allow(non_camel_case_types)]
1241                    struct GetProgressSvc<T: MusicPlayer>(pub Arc<T>);
1242                    impl<T: MusicPlayer> tonic::server::UnaryService<super::Empty>
1243                    for GetProgressSvc<T> {
1244                        type Response = super::GetProgressResponse;
1245                        type Future = BoxFuture<
1246                            tonic::Response<Self::Response>,
1247                            tonic::Status,
1248                        >;
1249                        fn call(
1250                            &mut self,
1251                            request: tonic::Request<super::Empty>,
1252                        ) -> Self::Future {
1253                            let inner = Arc::clone(&self.0);
1254                            let fut = async move {
1255                                <T as MusicPlayer>::get_progress(&inner, request).await
1256                            };
1257                            Box::pin(fut)
1258                        }
1259                    }
1260                    let accept_compression_encodings = self.accept_compression_encodings;
1261                    let send_compression_encodings = self.send_compression_encodings;
1262                    let max_decoding_message_size = self.max_decoding_message_size;
1263                    let max_encoding_message_size = self.max_encoding_message_size;
1264                    let inner = self.inner.clone();
1265                    let fut = async move {
1266                        let method = GetProgressSvc(inner);
1267                        let codec = tonic_prost::ProstCodec::default();
1268                        let mut grpc = tonic::server::Grpc::new(codec)
1269                            .apply_compression_config(
1270                                accept_compression_encodings,
1271                                send_compression_encodings,
1272                            )
1273                            .apply_max_message_size_config(
1274                                max_decoding_message_size,
1275                                max_encoding_message_size,
1276                            );
1277                        let res = grpc.unary(method, req).await;
1278                        Ok(res)
1279                    };
1280                    Box::pin(fut)
1281                }
1282                "/player.MusicPlayer/VolumeUp" => {
1283                    #[allow(non_camel_case_types)]
1284                    struct VolumeUpSvc<T: MusicPlayer>(pub Arc<T>);
1285                    impl<T: MusicPlayer> tonic::server::UnaryService<super::Empty>
1286                    for VolumeUpSvc<T> {
1287                        type Response = super::VolumeReply;
1288                        type Future = BoxFuture<
1289                            tonic::Response<Self::Response>,
1290                            tonic::Status,
1291                        >;
1292                        fn call(
1293                            &mut self,
1294                            request: tonic::Request<super::Empty>,
1295                        ) -> Self::Future {
1296                            let inner = Arc::clone(&self.0);
1297                            let fut = async move {
1298                                <T as MusicPlayer>::volume_up(&inner, request).await
1299                            };
1300                            Box::pin(fut)
1301                        }
1302                    }
1303                    let accept_compression_encodings = self.accept_compression_encodings;
1304                    let send_compression_encodings = self.send_compression_encodings;
1305                    let max_decoding_message_size = self.max_decoding_message_size;
1306                    let max_encoding_message_size = self.max_encoding_message_size;
1307                    let inner = self.inner.clone();
1308                    let fut = async move {
1309                        let method = VolumeUpSvc(inner);
1310                        let codec = tonic_prost::ProstCodec::default();
1311                        let mut grpc = tonic::server::Grpc::new(codec)
1312                            .apply_compression_config(
1313                                accept_compression_encodings,
1314                                send_compression_encodings,
1315                            )
1316                            .apply_max_message_size_config(
1317                                max_decoding_message_size,
1318                                max_encoding_message_size,
1319                            );
1320                        let res = grpc.unary(method, req).await;
1321                        Ok(res)
1322                    };
1323                    Box::pin(fut)
1324                }
1325                "/player.MusicPlayer/VolumeDown" => {
1326                    #[allow(non_camel_case_types)]
1327                    struct VolumeDownSvc<T: MusicPlayer>(pub Arc<T>);
1328                    impl<T: MusicPlayer> tonic::server::UnaryService<super::Empty>
1329                    for VolumeDownSvc<T> {
1330                        type Response = super::VolumeReply;
1331                        type Future = BoxFuture<
1332                            tonic::Response<Self::Response>,
1333                            tonic::Status,
1334                        >;
1335                        fn call(
1336                            &mut self,
1337                            request: tonic::Request<super::Empty>,
1338                        ) -> Self::Future {
1339                            let inner = Arc::clone(&self.0);
1340                            let fut = async move {
1341                                <T as MusicPlayer>::volume_down(&inner, request).await
1342                            };
1343                            Box::pin(fut)
1344                        }
1345                    }
1346                    let accept_compression_encodings = self.accept_compression_encodings;
1347                    let send_compression_encodings = self.send_compression_encodings;
1348                    let max_decoding_message_size = self.max_decoding_message_size;
1349                    let max_encoding_message_size = self.max_encoding_message_size;
1350                    let inner = self.inner.clone();
1351                    let fut = async move {
1352                        let method = VolumeDownSvc(inner);
1353                        let codec = tonic_prost::ProstCodec::default();
1354                        let mut grpc = tonic::server::Grpc::new(codec)
1355                            .apply_compression_config(
1356                                accept_compression_encodings,
1357                                send_compression_encodings,
1358                            )
1359                            .apply_max_message_size_config(
1360                                max_decoding_message_size,
1361                                max_encoding_message_size,
1362                            );
1363                        let res = grpc.unary(method, req).await;
1364                        Ok(res)
1365                    };
1366                    Box::pin(fut)
1367                }
1368                "/player.MusicPlayer/SpeedUp" => {
1369                    #[allow(non_camel_case_types)]
1370                    struct SpeedUpSvc<T: MusicPlayer>(pub Arc<T>);
1371                    impl<T: MusicPlayer> tonic::server::UnaryService<super::Empty>
1372                    for SpeedUpSvc<T> {
1373                        type Response = super::SpeedReply;
1374                        type Future = BoxFuture<
1375                            tonic::Response<Self::Response>,
1376                            tonic::Status,
1377                        >;
1378                        fn call(
1379                            &mut self,
1380                            request: tonic::Request<super::Empty>,
1381                        ) -> Self::Future {
1382                            let inner = Arc::clone(&self.0);
1383                            let fut = async move {
1384                                <T as MusicPlayer>::speed_up(&inner, request).await
1385                            };
1386                            Box::pin(fut)
1387                        }
1388                    }
1389                    let accept_compression_encodings = self.accept_compression_encodings;
1390                    let send_compression_encodings = self.send_compression_encodings;
1391                    let max_decoding_message_size = self.max_decoding_message_size;
1392                    let max_encoding_message_size = self.max_encoding_message_size;
1393                    let inner = self.inner.clone();
1394                    let fut = async move {
1395                        let method = SpeedUpSvc(inner);
1396                        let codec = tonic_prost::ProstCodec::default();
1397                        let mut grpc = tonic::server::Grpc::new(codec)
1398                            .apply_compression_config(
1399                                accept_compression_encodings,
1400                                send_compression_encodings,
1401                            )
1402                            .apply_max_message_size_config(
1403                                max_decoding_message_size,
1404                                max_encoding_message_size,
1405                            );
1406                        let res = grpc.unary(method, req).await;
1407                        Ok(res)
1408                    };
1409                    Box::pin(fut)
1410                }
1411                "/player.MusicPlayer/SpeedDown" => {
1412                    #[allow(non_camel_case_types)]
1413                    struct SpeedDownSvc<T: MusicPlayer>(pub Arc<T>);
1414                    impl<T: MusicPlayer> tonic::server::UnaryService<super::Empty>
1415                    for SpeedDownSvc<T> {
1416                        type Response = super::SpeedReply;
1417                        type Future = BoxFuture<
1418                            tonic::Response<Self::Response>,
1419                            tonic::Status,
1420                        >;
1421                        fn call(
1422                            &mut self,
1423                            request: tonic::Request<super::Empty>,
1424                        ) -> Self::Future {
1425                            let inner = Arc::clone(&self.0);
1426                            let fut = async move {
1427                                <T as MusicPlayer>::speed_down(&inner, request).await
1428                            };
1429                            Box::pin(fut)
1430                        }
1431                    }
1432                    let accept_compression_encodings = self.accept_compression_encodings;
1433                    let send_compression_encodings = self.send_compression_encodings;
1434                    let max_decoding_message_size = self.max_decoding_message_size;
1435                    let max_encoding_message_size = self.max_encoding_message_size;
1436                    let inner = self.inner.clone();
1437                    let fut = async move {
1438                        let method = SpeedDownSvc(inner);
1439                        let codec = tonic_prost::ProstCodec::default();
1440                        let mut grpc = tonic::server::Grpc::new(codec)
1441                            .apply_compression_config(
1442                                accept_compression_encodings,
1443                                send_compression_encodings,
1444                            )
1445                            .apply_max_message_size_config(
1446                                max_decoding_message_size,
1447                                max_encoding_message_size,
1448                            );
1449                        let res = grpc.unary(method, req).await;
1450                        Ok(res)
1451                    };
1452                    Box::pin(fut)
1453                }
1454                "/player.MusicPlayer/ToggleGapless" => {
1455                    #[allow(non_camel_case_types)]
1456                    struct ToggleGaplessSvc<T: MusicPlayer>(pub Arc<T>);
1457                    impl<T: MusicPlayer> tonic::server::UnaryService<super::Empty>
1458                    for ToggleGaplessSvc<T> {
1459                        type Response = super::GaplessState;
1460                        type Future = BoxFuture<
1461                            tonic::Response<Self::Response>,
1462                            tonic::Status,
1463                        >;
1464                        fn call(
1465                            &mut self,
1466                            request: tonic::Request<super::Empty>,
1467                        ) -> Self::Future {
1468                            let inner = Arc::clone(&self.0);
1469                            let fut = async move {
1470                                <T as MusicPlayer>::toggle_gapless(&inner, request).await
1471                            };
1472                            Box::pin(fut)
1473                        }
1474                    }
1475                    let accept_compression_encodings = self.accept_compression_encodings;
1476                    let send_compression_encodings = self.send_compression_encodings;
1477                    let max_decoding_message_size = self.max_decoding_message_size;
1478                    let max_encoding_message_size = self.max_encoding_message_size;
1479                    let inner = self.inner.clone();
1480                    let fut = async move {
1481                        let method = ToggleGaplessSvc(inner);
1482                        let codec = tonic_prost::ProstCodec::default();
1483                        let mut grpc = tonic::server::Grpc::new(codec)
1484                            .apply_compression_config(
1485                                accept_compression_encodings,
1486                                send_compression_encodings,
1487                            )
1488                            .apply_max_message_size_config(
1489                                max_decoding_message_size,
1490                                max_encoding_message_size,
1491                            );
1492                        let res = grpc.unary(method, req).await;
1493                        Ok(res)
1494                    };
1495                    Box::pin(fut)
1496                }
1497                "/player.MusicPlayer/SeekForward" => {
1498                    #[allow(non_camel_case_types)]
1499                    struct SeekForwardSvc<T: MusicPlayer>(pub Arc<T>);
1500                    impl<T: MusicPlayer> tonic::server::UnaryService<super::Empty>
1501                    for SeekForwardSvc<T> {
1502                        type Response = super::PlayerTime;
1503                        type Future = BoxFuture<
1504                            tonic::Response<Self::Response>,
1505                            tonic::Status,
1506                        >;
1507                        fn call(
1508                            &mut self,
1509                            request: tonic::Request<super::Empty>,
1510                        ) -> Self::Future {
1511                            let inner = Arc::clone(&self.0);
1512                            let fut = async move {
1513                                <T as MusicPlayer>::seek_forward(&inner, request).await
1514                            };
1515                            Box::pin(fut)
1516                        }
1517                    }
1518                    let accept_compression_encodings = self.accept_compression_encodings;
1519                    let send_compression_encodings = self.send_compression_encodings;
1520                    let max_decoding_message_size = self.max_decoding_message_size;
1521                    let max_encoding_message_size = self.max_encoding_message_size;
1522                    let inner = self.inner.clone();
1523                    let fut = async move {
1524                        let method = SeekForwardSvc(inner);
1525                        let codec = tonic_prost::ProstCodec::default();
1526                        let mut grpc = tonic::server::Grpc::new(codec)
1527                            .apply_compression_config(
1528                                accept_compression_encodings,
1529                                send_compression_encodings,
1530                            )
1531                            .apply_max_message_size_config(
1532                                max_decoding_message_size,
1533                                max_encoding_message_size,
1534                            );
1535                        let res = grpc.unary(method, req).await;
1536                        Ok(res)
1537                    };
1538                    Box::pin(fut)
1539                }
1540                "/player.MusicPlayer/SeekBackward" => {
1541                    #[allow(non_camel_case_types)]
1542                    struct SeekBackwardSvc<T: MusicPlayer>(pub Arc<T>);
1543                    impl<T: MusicPlayer> tonic::server::UnaryService<super::Empty>
1544                    for SeekBackwardSvc<T> {
1545                        type Response = super::PlayerTime;
1546                        type Future = BoxFuture<
1547                            tonic::Response<Self::Response>,
1548                            tonic::Status,
1549                        >;
1550                        fn call(
1551                            &mut self,
1552                            request: tonic::Request<super::Empty>,
1553                        ) -> Self::Future {
1554                            let inner = Arc::clone(&self.0);
1555                            let fut = async move {
1556                                <T as MusicPlayer>::seek_backward(&inner, request).await
1557                            };
1558                            Box::pin(fut)
1559                        }
1560                    }
1561                    let accept_compression_encodings = self.accept_compression_encodings;
1562                    let send_compression_encodings = self.send_compression_encodings;
1563                    let max_decoding_message_size = self.max_decoding_message_size;
1564                    let max_encoding_message_size = self.max_encoding_message_size;
1565                    let inner = self.inner.clone();
1566                    let fut = async move {
1567                        let method = SeekBackwardSvc(inner);
1568                        let codec = tonic_prost::ProstCodec::default();
1569                        let mut grpc = tonic::server::Grpc::new(codec)
1570                            .apply_compression_config(
1571                                accept_compression_encodings,
1572                                send_compression_encodings,
1573                            )
1574                            .apply_max_message_size_config(
1575                                max_decoding_message_size,
1576                                max_encoding_message_size,
1577                            );
1578                        let res = grpc.unary(method, req).await;
1579                        Ok(res)
1580                    };
1581                    Box::pin(fut)
1582                }
1583                "/player.MusicPlayer/PlaySpecific" => {
1584                    #[allow(non_camel_case_types)]
1585                    struct PlaySpecificSvc<T: MusicPlayer>(pub Arc<T>);
1586                    impl<
1587                        T: MusicPlayer,
1588                    > tonic::server::UnaryService<super::PlaylistPlaySpecific>
1589                    for PlaySpecificSvc<T> {
1590                        type Response = super::Empty;
1591                        type Future = BoxFuture<
1592                            tonic::Response<Self::Response>,
1593                            tonic::Status,
1594                        >;
1595                        fn call(
1596                            &mut self,
1597                            request: tonic::Request<super::PlaylistPlaySpecific>,
1598                        ) -> Self::Future {
1599                            let inner = Arc::clone(&self.0);
1600                            let fut = async move {
1601                                <T as MusicPlayer>::play_specific(&inner, request).await
1602                            };
1603                            Box::pin(fut)
1604                        }
1605                    }
1606                    let accept_compression_encodings = self.accept_compression_encodings;
1607                    let send_compression_encodings = self.send_compression_encodings;
1608                    let max_decoding_message_size = self.max_decoding_message_size;
1609                    let max_encoding_message_size = self.max_encoding_message_size;
1610                    let inner = self.inner.clone();
1611                    let fut = async move {
1612                        let method = PlaySpecificSvc(inner);
1613                        let codec = tonic_prost::ProstCodec::default();
1614                        let mut grpc = tonic::server::Grpc::new(codec)
1615                            .apply_compression_config(
1616                                accept_compression_encodings,
1617                                send_compression_encodings,
1618                            )
1619                            .apply_max_message_size_config(
1620                                max_decoding_message_size,
1621                                max_encoding_message_size,
1622                            );
1623                        let res = grpc.unary(method, req).await;
1624                        Ok(res)
1625                    };
1626                    Box::pin(fut)
1627                }
1628                "/player.MusicPlayer/CycleLoop" => {
1629                    #[allow(non_camel_case_types)]
1630                    struct CycleLoopSvc<T: MusicPlayer>(pub Arc<T>);
1631                    impl<T: MusicPlayer> tonic::server::UnaryService<super::Empty>
1632                    for CycleLoopSvc<T> {
1633                        type Response = super::PlaylistLoopMode;
1634                        type Future = BoxFuture<
1635                            tonic::Response<Self::Response>,
1636                            tonic::Status,
1637                        >;
1638                        fn call(
1639                            &mut self,
1640                            request: tonic::Request<super::Empty>,
1641                        ) -> Self::Future {
1642                            let inner = Arc::clone(&self.0);
1643                            let fut = async move {
1644                                <T as MusicPlayer>::cycle_loop(&inner, request).await
1645                            };
1646                            Box::pin(fut)
1647                        }
1648                    }
1649                    let accept_compression_encodings = self.accept_compression_encodings;
1650                    let send_compression_encodings = self.send_compression_encodings;
1651                    let max_decoding_message_size = self.max_decoding_message_size;
1652                    let max_encoding_message_size = self.max_encoding_message_size;
1653                    let inner = self.inner.clone();
1654                    let fut = async move {
1655                        let method = CycleLoopSvc(inner);
1656                        let codec = tonic_prost::ProstCodec::default();
1657                        let mut grpc = tonic::server::Grpc::new(codec)
1658                            .apply_compression_config(
1659                                accept_compression_encodings,
1660                                send_compression_encodings,
1661                            )
1662                            .apply_max_message_size_config(
1663                                max_decoding_message_size,
1664                                max_encoding_message_size,
1665                            );
1666                        let res = grpc.unary(method, req).await;
1667                        Ok(res)
1668                    };
1669                    Box::pin(fut)
1670                }
1671                "/player.MusicPlayer/AddToPlaylist" => {
1672                    #[allow(non_camel_case_types)]
1673                    struct AddToPlaylistSvc<T: MusicPlayer>(pub Arc<T>);
1674                    impl<
1675                        T: MusicPlayer,
1676                    > tonic::server::UnaryService<super::PlaylistTracksToAdd>
1677                    for AddToPlaylistSvc<T> {
1678                        type Response = super::Empty;
1679                        type Future = BoxFuture<
1680                            tonic::Response<Self::Response>,
1681                            tonic::Status,
1682                        >;
1683                        fn call(
1684                            &mut self,
1685                            request: tonic::Request<super::PlaylistTracksToAdd>,
1686                        ) -> Self::Future {
1687                            let inner = Arc::clone(&self.0);
1688                            let fut = async move {
1689                                <T as MusicPlayer>::add_to_playlist(&inner, request).await
1690                            };
1691                            Box::pin(fut)
1692                        }
1693                    }
1694                    let accept_compression_encodings = self.accept_compression_encodings;
1695                    let send_compression_encodings = self.send_compression_encodings;
1696                    let max_decoding_message_size = self.max_decoding_message_size;
1697                    let max_encoding_message_size = self.max_encoding_message_size;
1698                    let inner = self.inner.clone();
1699                    let fut = async move {
1700                        let method = AddToPlaylistSvc(inner);
1701                        let codec = tonic_prost::ProstCodec::default();
1702                        let mut grpc = tonic::server::Grpc::new(codec)
1703                            .apply_compression_config(
1704                                accept_compression_encodings,
1705                                send_compression_encodings,
1706                            )
1707                            .apply_max_message_size_config(
1708                                max_decoding_message_size,
1709                                max_encoding_message_size,
1710                            );
1711                        let res = grpc.unary(method, req).await;
1712                        Ok(res)
1713                    };
1714                    Box::pin(fut)
1715                }
1716                "/player.MusicPlayer/RemoveFromPlaylist" => {
1717                    #[allow(non_camel_case_types)]
1718                    struct RemoveFromPlaylistSvc<T: MusicPlayer>(pub Arc<T>);
1719                    impl<
1720                        T: MusicPlayer,
1721                    > tonic::server::UnaryService<super::PlaylistTracksToRemove>
1722                    for RemoveFromPlaylistSvc<T> {
1723                        type Response = super::Empty;
1724                        type Future = BoxFuture<
1725                            tonic::Response<Self::Response>,
1726                            tonic::Status,
1727                        >;
1728                        fn call(
1729                            &mut self,
1730                            request: tonic::Request<super::PlaylistTracksToRemove>,
1731                        ) -> Self::Future {
1732                            let inner = Arc::clone(&self.0);
1733                            let fut = async move {
1734                                <T as MusicPlayer>::remove_from_playlist(&inner, request)
1735                                    .await
1736                            };
1737                            Box::pin(fut)
1738                        }
1739                    }
1740                    let accept_compression_encodings = self.accept_compression_encodings;
1741                    let send_compression_encodings = self.send_compression_encodings;
1742                    let max_decoding_message_size = self.max_decoding_message_size;
1743                    let max_encoding_message_size = self.max_encoding_message_size;
1744                    let inner = self.inner.clone();
1745                    let fut = async move {
1746                        let method = RemoveFromPlaylistSvc(inner);
1747                        let codec = tonic_prost::ProstCodec::default();
1748                        let mut grpc = tonic::server::Grpc::new(codec)
1749                            .apply_compression_config(
1750                                accept_compression_encodings,
1751                                send_compression_encodings,
1752                            )
1753                            .apply_max_message_size_config(
1754                                max_decoding_message_size,
1755                                max_encoding_message_size,
1756                            );
1757                        let res = grpc.unary(method, req).await;
1758                        Ok(res)
1759                    };
1760                    Box::pin(fut)
1761                }
1762                "/player.MusicPlayer/SwapTracks" => {
1763                    #[allow(non_camel_case_types)]
1764                    struct SwapTracksSvc<T: MusicPlayer>(pub Arc<T>);
1765                    impl<
1766                        T: MusicPlayer,
1767                    > tonic::server::UnaryService<super::PlaylistSwapTracks>
1768                    for SwapTracksSvc<T> {
1769                        type Response = super::Empty;
1770                        type Future = BoxFuture<
1771                            tonic::Response<Self::Response>,
1772                            tonic::Status,
1773                        >;
1774                        fn call(
1775                            &mut self,
1776                            request: tonic::Request<super::PlaylistSwapTracks>,
1777                        ) -> Self::Future {
1778                            let inner = Arc::clone(&self.0);
1779                            let fut = async move {
1780                                <T as MusicPlayer>::swap_tracks(&inner, request).await
1781                            };
1782                            Box::pin(fut)
1783                        }
1784                    }
1785                    let accept_compression_encodings = self.accept_compression_encodings;
1786                    let send_compression_encodings = self.send_compression_encodings;
1787                    let max_decoding_message_size = self.max_decoding_message_size;
1788                    let max_encoding_message_size = self.max_encoding_message_size;
1789                    let inner = self.inner.clone();
1790                    let fut = async move {
1791                        let method = SwapTracksSvc(inner);
1792                        let codec = tonic_prost::ProstCodec::default();
1793                        let mut grpc = tonic::server::Grpc::new(codec)
1794                            .apply_compression_config(
1795                                accept_compression_encodings,
1796                                send_compression_encodings,
1797                            )
1798                            .apply_max_message_size_config(
1799                                max_decoding_message_size,
1800                                max_encoding_message_size,
1801                            );
1802                        let res = grpc.unary(method, req).await;
1803                        Ok(res)
1804                    };
1805                    Box::pin(fut)
1806                }
1807                "/player.MusicPlayer/GetPlaylist" => {
1808                    #[allow(non_camel_case_types)]
1809                    struct GetPlaylistSvc<T: MusicPlayer>(pub Arc<T>);
1810                    impl<T: MusicPlayer> tonic::server::UnaryService<super::Empty>
1811                    for GetPlaylistSvc<T> {
1812                        type Response = super::PlaylistTracks;
1813                        type Future = BoxFuture<
1814                            tonic::Response<Self::Response>,
1815                            tonic::Status,
1816                        >;
1817                        fn call(
1818                            &mut self,
1819                            request: tonic::Request<super::Empty>,
1820                        ) -> Self::Future {
1821                            let inner = Arc::clone(&self.0);
1822                            let fut = async move {
1823                                <T as MusicPlayer>::get_playlist(&inner, request).await
1824                            };
1825                            Box::pin(fut)
1826                        }
1827                    }
1828                    let accept_compression_encodings = self.accept_compression_encodings;
1829                    let send_compression_encodings = self.send_compression_encodings;
1830                    let max_decoding_message_size = self.max_decoding_message_size;
1831                    let max_encoding_message_size = self.max_encoding_message_size;
1832                    let inner = self.inner.clone();
1833                    let fut = async move {
1834                        let method = GetPlaylistSvc(inner);
1835                        let codec = tonic_prost::ProstCodec::default();
1836                        let mut grpc = tonic::server::Grpc::new(codec)
1837                            .apply_compression_config(
1838                                accept_compression_encodings,
1839                                send_compression_encodings,
1840                            )
1841                            .apply_max_message_size_config(
1842                                max_decoding_message_size,
1843                                max_encoding_message_size,
1844                            );
1845                        let res = grpc.unary(method, req).await;
1846                        Ok(res)
1847                    };
1848                    Box::pin(fut)
1849                }
1850                "/player.MusicPlayer/ShufflePlaylist" => {
1851                    #[allow(non_camel_case_types)]
1852                    struct ShufflePlaylistSvc<T: MusicPlayer>(pub Arc<T>);
1853                    impl<T: MusicPlayer> tonic::server::UnaryService<super::Empty>
1854                    for ShufflePlaylistSvc<T> {
1855                        type Response = super::Empty;
1856                        type Future = BoxFuture<
1857                            tonic::Response<Self::Response>,
1858                            tonic::Status,
1859                        >;
1860                        fn call(
1861                            &mut self,
1862                            request: tonic::Request<super::Empty>,
1863                        ) -> Self::Future {
1864                            let inner = Arc::clone(&self.0);
1865                            let fut = async move {
1866                                <T as MusicPlayer>::shuffle_playlist(&inner, request).await
1867                            };
1868                            Box::pin(fut)
1869                        }
1870                    }
1871                    let accept_compression_encodings = self.accept_compression_encodings;
1872                    let send_compression_encodings = self.send_compression_encodings;
1873                    let max_decoding_message_size = self.max_decoding_message_size;
1874                    let max_encoding_message_size = self.max_encoding_message_size;
1875                    let inner = self.inner.clone();
1876                    let fut = async move {
1877                        let method = ShufflePlaylistSvc(inner);
1878                        let codec = tonic_prost::ProstCodec::default();
1879                        let mut grpc = tonic::server::Grpc::new(codec)
1880                            .apply_compression_config(
1881                                accept_compression_encodings,
1882                                send_compression_encodings,
1883                            )
1884                            .apply_max_message_size_config(
1885                                max_decoding_message_size,
1886                                max_encoding_message_size,
1887                            );
1888                        let res = grpc.unary(method, req).await;
1889                        Ok(res)
1890                    };
1891                    Box::pin(fut)
1892                }
1893                "/player.MusicPlayer/RemoveDeletedTracks" => {
1894                    #[allow(non_camel_case_types)]
1895                    struct RemoveDeletedTracksSvc<T: MusicPlayer>(pub Arc<T>);
1896                    impl<T: MusicPlayer> tonic::server::UnaryService<super::Empty>
1897                    for RemoveDeletedTracksSvc<T> {
1898                        type Response = super::Empty;
1899                        type Future = BoxFuture<
1900                            tonic::Response<Self::Response>,
1901                            tonic::Status,
1902                        >;
1903                        fn call(
1904                            &mut self,
1905                            request: tonic::Request<super::Empty>,
1906                        ) -> Self::Future {
1907                            let inner = Arc::clone(&self.0);
1908                            let fut = async move {
1909                                <T as MusicPlayer>::remove_deleted_tracks(&inner, request)
1910                                    .await
1911                            };
1912                            Box::pin(fut)
1913                        }
1914                    }
1915                    let accept_compression_encodings = self.accept_compression_encodings;
1916                    let send_compression_encodings = self.send_compression_encodings;
1917                    let max_decoding_message_size = self.max_decoding_message_size;
1918                    let max_encoding_message_size = self.max_encoding_message_size;
1919                    let inner = self.inner.clone();
1920                    let fut = async move {
1921                        let method = RemoveDeletedTracksSvc(inner);
1922                        let codec = tonic_prost::ProstCodec::default();
1923                        let mut grpc = tonic::server::Grpc::new(codec)
1924                            .apply_compression_config(
1925                                accept_compression_encodings,
1926                                send_compression_encodings,
1927                            )
1928                            .apply_max_message_size_config(
1929                                max_decoding_message_size,
1930                                max_encoding_message_size,
1931                            );
1932                        let res = grpc.unary(method, req).await;
1933                        Ok(res)
1934                    };
1935                    Box::pin(fut)
1936                }
1937                "/player.MusicPlayer/ReloadConfig" => {
1938                    #[allow(non_camel_case_types)]
1939                    struct ReloadConfigSvc<T: MusicPlayer>(pub Arc<T>);
1940                    impl<T: MusicPlayer> tonic::server::UnaryService<super::Empty>
1941                    for ReloadConfigSvc<T> {
1942                        type Response = super::Empty;
1943                        type Future = BoxFuture<
1944                            tonic::Response<Self::Response>,
1945                            tonic::Status,
1946                        >;
1947                        fn call(
1948                            &mut self,
1949                            request: tonic::Request<super::Empty>,
1950                        ) -> Self::Future {
1951                            let inner = Arc::clone(&self.0);
1952                            let fut = async move {
1953                                <T as MusicPlayer>::reload_config(&inner, request).await
1954                            };
1955                            Box::pin(fut)
1956                        }
1957                    }
1958                    let accept_compression_encodings = self.accept_compression_encodings;
1959                    let send_compression_encodings = self.send_compression_encodings;
1960                    let max_decoding_message_size = self.max_decoding_message_size;
1961                    let max_encoding_message_size = self.max_encoding_message_size;
1962                    let inner = self.inner.clone();
1963                    let fut = async move {
1964                        let method = ReloadConfigSvc(inner);
1965                        let codec = tonic_prost::ProstCodec::default();
1966                        let mut grpc = tonic::server::Grpc::new(codec)
1967                            .apply_compression_config(
1968                                accept_compression_encodings,
1969                                send_compression_encodings,
1970                            )
1971                            .apply_max_message_size_config(
1972                                max_decoding_message_size,
1973                                max_encoding_message_size,
1974                            );
1975                        let res = grpc.unary(method, req).await;
1976                        Ok(res)
1977                    };
1978                    Box::pin(fut)
1979                }
1980                "/player.MusicPlayer/SubscribeServerUpdates" => {
1981                    #[allow(non_camel_case_types)]
1982                    struct SubscribeServerUpdatesSvc<T: MusicPlayer>(pub Arc<T>);
1983                    impl<
1984                        T: MusicPlayer,
1985                    > tonic::server::ServerStreamingService<super::Empty>
1986                    for SubscribeServerUpdatesSvc<T> {
1987                        type Response = super::StreamUpdates;
1988                        type ResponseStream = T::SubscribeServerUpdatesStream;
1989                        type Future = BoxFuture<
1990                            tonic::Response<Self::ResponseStream>,
1991                            tonic::Status,
1992                        >;
1993                        fn call(
1994                            &mut self,
1995                            request: tonic::Request<super::Empty>,
1996                        ) -> Self::Future {
1997                            let inner = Arc::clone(&self.0);
1998                            let fut = async move {
1999                                <T as MusicPlayer>::subscribe_server_updates(
2000                                        &inner,
2001                                        request,
2002                                    )
2003                                    .await
2004                            };
2005                            Box::pin(fut)
2006                        }
2007                    }
2008                    let accept_compression_encodings = self.accept_compression_encodings;
2009                    let send_compression_encodings = self.send_compression_encodings;
2010                    let max_decoding_message_size = self.max_decoding_message_size;
2011                    let max_encoding_message_size = self.max_encoding_message_size;
2012                    let inner = self.inner.clone();
2013                    let fut = async move {
2014                        let method = SubscribeServerUpdatesSvc(inner);
2015                        let codec = tonic_prost::ProstCodec::default();
2016                        let mut grpc = tonic::server::Grpc::new(codec)
2017                            .apply_compression_config(
2018                                accept_compression_encodings,
2019                                send_compression_encodings,
2020                            )
2021                            .apply_max_message_size_config(
2022                                max_decoding_message_size,
2023                                max_encoding_message_size,
2024                            );
2025                        let res = grpc.server_streaming(method, req).await;
2026                        Ok(res)
2027                    };
2028                    Box::pin(fut)
2029                }
2030                _ => {
2031                    Box::pin(async move {
2032                        let mut response = http::Response::new(
2033                            tonic::body::Body::default(),
2034                        );
2035                        let headers = response.headers_mut();
2036                        headers
2037                            .insert(
2038                                tonic::Status::GRPC_STATUS,
2039                                (tonic::Code::Unimplemented as i32).into(),
2040                            );
2041                        headers
2042                            .insert(
2043                                http::header::CONTENT_TYPE,
2044                                tonic::metadata::GRPC_CONTENT_TYPE,
2045                            );
2046                        Ok(response)
2047                    })
2048                }
2049            }
2050        }
2051    }
2052    impl<T> Clone for MusicPlayerServer<T> {
2053        fn clone(&self) -> Self {
2054            let inner = self.inner.clone();
2055            Self {
2056                inner,
2057                accept_compression_encodings: self.accept_compression_encodings,
2058                send_compression_encodings: self.send_compression_encodings,
2059                max_decoding_message_size: self.max_decoding_message_size,
2060                max_encoding_message_size: self.max_encoding_message_size,
2061            }
2062        }
2063    }
2064    /// Generated gRPC service name
2065    pub const SERVICE_NAME: &str = "player.MusicPlayer";
2066    impl<T> tonic::server::NamedService for MusicPlayerServer<T> {
2067        const NAME: &'static str = SERVICE_NAME;
2068    }
2069}