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

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