Struct MusicPlayerClient

Source
pub struct MusicPlayerClient<Stub = Channel<MusicPlayerRequest, MusicPlayerResponse>>(/* private fields */);
Expand description

The client stub that makes RPC calls to the server. All request methods return Futures.

Implementations§

Source§

impl MusicPlayerClient

Source

pub fn new<T>( config: Config, transport: T, ) -> NewClient<Self, RequestDispatch<MusicPlayerRequest, MusicPlayerResponse, T>>

Returns a new client stub that sends requests over the given transport.

Source§

impl<Stub> MusicPlayerClient<Stub>
where Stub: Stub<Req = MusicPlayerRequest, Resp = MusicPlayerResponse>,

Source

pub fn register_listener( &self, ctx: Context, listener_addr: SocketAddr, ) -> impl Future<Output = Result<(), RpcError>> + '_

Register a UDP listener with the daemon.

Source

pub fn ping( &self, ctx: Context, ) -> impl Future<Output = Result<String, RpcError>> + '_

Source

pub fn library_rescan( &self, ctx: Context, ) -> impl Future<Output = Result<Result<(), SerializableLibraryError>, RpcError>> + '_

Rescans the music library, only error is if a rescan is already in progress.

Source

pub fn library_rescan_in_progress( &self, ctx: Context, ) -> impl Future<Output = Result<bool, RpcError>> + '_

Check if a rescan is in progress.

Source

pub fn library_analyze( &self, ctx: Context, overwrite: bool, ) -> impl Future<Output = Result<Result<(), SerializableLibraryError>, RpcError>> + '_

Analyze the music library, only error is if an analysis is already in progress.

Source

pub fn library_analyze_in_progress( &self, ctx: Context, ) -> impl Future<Output = Result<bool, RpcError>> + '_

Check if an analysis is in progress.

Source

pub fn library_recluster( &self, ctx: Context, ) -> impl Future<Output = Result<Result<(), SerializableLibraryError>, RpcError>> + '_

Recluster the music library, only error is if a recluster is already in progress.

Source

pub fn library_recluster_in_progress( &self, ctx: Context, ) -> impl Future<Output = Result<bool, RpcError>> + '_

Check if a recluster is in progress.

Source

pub fn library_brief( &self, ctx: Context, ) -> impl Future<Output = Result<Result<LibraryBrief, SerializableLibraryError>, RpcError>> + '_

Returns brief information about the music library.

Source

pub fn library_full( &self, ctx: Context, ) -> impl Future<Output = Result<Result<LibraryFull, SerializableLibraryError>, RpcError>> + '_

Returns full information about the music library. (all songs, artists, albums, etc.)

Source

pub fn library_artists_brief( &self, ctx: Context, ) -> impl Future<Output = Result<Result<Box<[ArtistBrief]>, SerializableLibraryError>, RpcError>> + '_

Returns brief information about the music library’s artists.

Source

pub fn library_artists_full( &self, ctx: Context, ) -> impl Future<Output = Result<Result<Box<[Artist]>, SerializableLibraryError>, RpcError>> + '_

Returns full information about the music library’s artists.

Source

pub fn library_albums_brief( &self, ctx: Context, ) -> impl Future<Output = Result<Result<Box<[AlbumBrief]>, SerializableLibraryError>, RpcError>> + '_

Returns brief information about the music library’s albums.

Source

pub fn library_albums_full( &self, ctx: Context, ) -> impl Future<Output = Result<Result<Box<[Album]>, SerializableLibraryError>, RpcError>> + '_

Returns full information about the music library’s albums.

Source

pub fn library_songs_brief( &self, ctx: Context, ) -> impl Future<Output = Result<Result<Box<[SongBrief]>, SerializableLibraryError>, RpcError>> + '_

Returns brief information about the music library’s songs.

Source

pub fn library_songs_full( &self, ctx: Context, ) -> impl Future<Output = Result<Result<Box<[Song]>, SerializableLibraryError>, RpcError>> + '_

Returns full information about the music library’s songs.

Source

pub fn library_health( &self, ctx: Context, ) -> impl Future<Output = Result<Result<LibraryHealth, SerializableLibraryError>, RpcError>> + '_

Returns information about the health of the music library (are there any missing files, etc.)

Source

pub fn library_song_get( &self, ctx: Context, id: SongId, ) -> impl Future<Output = Result<Option<Song>, RpcError>> + '_

Get a song by its ID.

Source

pub fn library_song_get_by_path( &self, ctx: Context, path: PathBuf, ) -> impl Future<Output = Result<Option<Song>, RpcError>> + '_

Get a song by its path.

Source

pub fn library_song_get_artist( &self, ctx: Context, id: SongId, ) -> impl Future<Output = Result<OneOrMany<Artist>, RpcError>> + '_

Get the artists of a song.

Source

pub fn library_song_get_album( &self, ctx: Context, id: SongId, ) -> impl Future<Output = Result<Option<Album>, RpcError>> + '_

Get the album of a song.

Source

pub fn library_song_get_playlists( &self, ctx: Context, id: SongId, ) -> impl Future<Output = Result<Box<[Playlist]>, RpcError>> + '_

Get the Playlists a song is in.

Source

pub fn library_song_get_collections( &self, ctx: Context, id: SongId, ) -> impl Future<Output = Result<Box<[Collection]>, RpcError>> + '_

Get the Collections a song is in.

Source

pub fn library_album_get( &self, ctx: Context, id: AlbumId, ) -> impl Future<Output = Result<Option<Album>, RpcError>> + '_

Get an album by its ID.

Source

pub fn library_album_get_artist( &self, ctx: Context, id: AlbumId, ) -> impl Future<Output = Result<OneOrMany<Artist>, RpcError>> + '_

Get the artists of an album

Source

pub fn library_album_get_songs( &self, ctx: Context, id: AlbumId, ) -> impl Future<Output = Result<Option<Box<[Song]>>, RpcError>> + '_

Get the songs of an album

Source

pub fn library_artist_get( &self, ctx: Context, id: ArtistId, ) -> impl Future<Output = Result<Option<Artist>, RpcError>> + '_

Get an artist by its ID.

Source

pub fn library_artist_get_songs( &self, ctx: Context, id: ArtistId, ) -> impl Future<Output = Result<Option<Box<[Song]>>, RpcError>> + '_

Get the songs of an artist

Source

pub fn library_artist_get_albums( &self, ctx: Context, id: ArtistId, ) -> impl Future<Output = Result<Option<Box<[Album]>>, RpcError>> + '_

Get the albums of an artist

Source

pub fn daemon_shutdown( &self, ctx: Context, ) -> impl Future<Output = Result<(), RpcError>> + '_

tells the daemon to shutdown.

Source

pub fn state_audio( &self, ctx: Context, ) -> impl Future<Output = Result<Option<StateAudio>, RpcError>> + '_

returns full information about the current state of the audio player (queue, current song, etc.)

Source

pub fn current_artist( &self, ctx: Context, ) -> impl Future<Output = Result<OneOrMany<Artist>, RpcError>> + '_

returns the current artist.

Source

pub fn current_album( &self, ctx: Context, ) -> impl Future<Output = Result<Option<Album>, RpcError>> + '_

returns the current album.

Source

pub fn current_song( &self, ctx: Context, ) -> impl Future<Output = Result<Option<Song>, RpcError>> + '_

returns the current song.

Source

pub fn rand_artist( &self, ctx: Context, ) -> impl Future<Output = Result<Option<Artist>, RpcError>> + '_

returns a random artist.

Source

pub fn rand_album( &self, ctx: Context, ) -> impl Future<Output = Result<Option<Album>, RpcError>> + '_

returns a random album.

Source

pub fn rand_song( &self, ctx: Context, ) -> impl Future<Output = Result<Option<Song>, RpcError>> + '_

returns a random song.

Source

pub fn search( &self, ctx: Context, query: String, limit: u32, ) -> impl Future<Output = Result<SearchResult, RpcError>> + '_

returns a list of artists, albums, and songs matching the given search query.

Source

pub fn search_artist( &self, ctx: Context, query: String, limit: u32, ) -> impl Future<Output = Result<Box<[Artist]>, RpcError>> + '_

returns a list of artists matching the given search query.

Source

pub fn search_album( &self, ctx: Context, query: String, limit: u32, ) -> impl Future<Output = Result<Box<[Album]>, RpcError>> + '_

returns a list of albums matching the given search query.

Source

pub fn search_song( &self, ctx: Context, query: String, limit: u32, ) -> impl Future<Output = Result<Box<[Song]>, RpcError>> + '_

returns a list of songs matching the given search query.

Source

pub fn playback_toggle( &self, ctx: Context, ) -> impl Future<Output = Result<(), RpcError>> + '_

toggles playback (play/pause).

Source

pub fn playback_play( &self, ctx: Context, ) -> impl Future<Output = Result<(), RpcError>> + '_

start playback (unpause).

Source

pub fn playback_pause( &self, ctx: Context, ) -> impl Future<Output = Result<(), RpcError>> + '_

pause playback.

Source

pub fn playback_stop( &self, ctx: Context, ) -> impl Future<Output = Result<(), RpcError>> + '_

stop playback.

Source

pub fn playback_restart( &self, ctx: Context, ) -> impl Future<Output = Result<(), RpcError>> + '_

restart the current song.

Source

pub fn playback_skip_forward( &self, ctx: Context, amount: usize, ) -> impl Future<Output = Result<(), RpcError>> + '_

skip forward by the given amount of songs

Source

pub fn playback_skip_backward( &self, ctx: Context, amount: usize, ) -> impl Future<Output = Result<(), RpcError>> + '_

go backwards by the given amount of songs.

Source

pub fn playback_clear_player( &self, ctx: Context, ) -> impl Future<Output = Result<(), RpcError>> + '_

only clear the player (i.e. stop playback)

Source

pub fn playback_clear( &self, ctx: Context, ) -> impl Future<Output = Result<(), RpcError>> + '_

clears the queue and stops playback.

Source

pub fn playback_seek( &self, ctx: Context, seek: SeekType, duration: Duration, ) -> impl Future<Output = Result<(), RpcError>> + '_

seek forwards, backwards, or to an absolute second in the current song.

Source

pub fn playback_repeat( &self, ctx: Context, mode: RepeatMode, ) -> impl Future<Output = Result<(), RpcError>> + '_

set the repeat mode.

Source

pub fn playback_shuffle( &self, ctx: Context, ) -> impl Future<Output = Result<(), RpcError>> + '_

Shuffle the current queue, then start playing from the 1st Song in the queue.

Source

pub fn playback_volume( &self, ctx: Context, volume: f32, ) -> impl Future<Output = Result<(), RpcError>> + '_

set the volume to the given value The value 1.0 is the “normal” volume (unfiltered input). Any value other than 1.0 will multiply each sample by this value.

Source

pub fn playback_volume_up( &self, ctx: Context, amount: f32, ) -> impl Future<Output = Result<(), RpcError>> + '_

increase the volume by the given amount

Source

pub fn playback_volume_down( &self, ctx: Context, amount: f32, ) -> impl Future<Output = Result<(), RpcError>> + '_

decrease the volume by the given amount

Source

pub fn playback_volume_toggle_mute( &self, ctx: Context, ) -> impl Future<Output = Result<(), RpcError>> + '_

toggle the volume mute.

Source

pub fn playback_mute( &self, ctx: Context, ) -> impl Future<Output = Result<(), RpcError>> + '_

mute the volume.

Source

pub fn playback_unmute( &self, ctx: Context, ) -> impl Future<Output = Result<(), RpcError>> + '_

unmute the volume.

Source

pub fn queue_add( &self, ctx: Context, thing: RecordId, ) -> impl Future<Output = Result<Result<(), SerializableLibraryError>, RpcError>> + '_

add a thing to the queue. (if the queue is empty, it will start playing the song.)

Source

pub fn queue_add_list( &self, ctx: Context, list: Vec<RecordId>, ) -> impl Future<Output = Result<Result<(), SerializableLibraryError>, RpcError>> + '_

add a list of things to the queue. (if the queue is empty, it will start playing the first thing in the list.)

Source

pub fn queue_set_index( &self, ctx: Context, index: usize, ) -> impl Future<Output = Result<(), RpcError>> + '_

set the current song to a queue index. if the index is out of bounds, it will be clamped to the nearest valid index.

Source

pub fn queue_remove_range( &self, ctx: Context, range: Range<usize>, ) -> impl Future<Output = Result<(), RpcError>> + '_

remove a range of songs from the queue. if the range is out of bounds, it will be clamped to the nearest valid range.

Source

pub fn playlist_list( &self, ctx: Context, ) -> impl Future<Output = Result<Box<[PlaylistBrief]>, RpcError>> + '_

Returns brief information about the users playlists.

Source

pub fn playlist_get_or_create( &self, ctx: Context, name: String, ) -> impl Future<Output = Result<Result<PlaylistId, SerializableLibraryError>, RpcError>> + '_

create a new playlist with the given name (if it does not already exist).

Source

pub fn playlist_remove( &self, ctx: Context, id: PlaylistId, ) -> impl Future<Output = Result<Result<(), SerializableLibraryError>, RpcError>> + '_

remove a playlist.

Source

pub fn playlist_clone( &self, ctx: Context, id: PlaylistId, ) -> impl Future<Output = Result<Result<PlaylistId, SerializableLibraryError>, RpcError>> + '_

clone a playlist. (creates a new playlist with the same name (append “copy”) and contents as the given playlist.) returns the id of the new playlist.

Source

pub fn playlist_get_id( &self, ctx: Context, name: String, ) -> impl Future<Output = Result<Option<PlaylistId>, RpcError>> + '_

get the id of a playlist. returns none if the playlist does not exist.

Source

pub fn playlist_remove_songs( &self, ctx: Context, playlist: PlaylistId, songs: Vec<SongId>, ) -> impl Future<Output = Result<Result<(), SerializableLibraryError>, RpcError>> + '_

remove a list of songs from a playlist. if the songs are not in the playlist, this will do nothing.

Source

pub fn playlist_add( &self, ctx: Context, playlist: PlaylistId, thing: RecordId, ) -> impl Future<Output = Result<Result<(), SerializableLibraryError>, RpcError>> + '_

Add a thing to a playlist. If the thing is something that has songs (an album, artist, etc.), it will add all the songs.

Source

pub fn playlist_add_list( &self, ctx: Context, playlist: PlaylistId, list: Vec<RecordId>, ) -> impl Future<Output = Result<Result<(), SerializableLibraryError>, RpcError>> + '_

Add a list of things to a playlist. If the things are something that have songs (an album, artist, etc.), it will add all the songs.

Source

pub fn playlist_get( &self, ctx: Context, id: PlaylistId, ) -> impl Future<Output = Result<Option<Playlist>, RpcError>> + '_

Get a playlist by its ID.

Source

pub fn playlist_get_songs( &self, ctx: Context, id: PlaylistId, ) -> impl Future<Output = Result<Option<Box<[Song]>>, RpcError>> + '_

Get the songs of a playlist

Source

pub fn playlist_rename( &self, ctx: Context, id: PlaylistId, name: String, ) -> impl Future<Output = Result<Result<Playlist, SerializableLibraryError>, RpcError>> + '_

Rename a playlist.

Source

pub fn collection_list( &self, ctx: Context, ) -> impl Future<Output = Result<Box<[CollectionBrief]>, RpcError>> + '_

Collections: Return brief information about the users auto curration collections.

Source

pub fn collection_get( &self, ctx: Context, id: CollectionId, ) -> impl Future<Output = Result<Option<Collection>, RpcError>> + '_

Collections: get a collection by its ID.

Source

pub fn collection_freeze( &self, ctx: Context, id: CollectionId, name: String, ) -> impl Future<Output = Result<Result<PlaylistId, SerializableLibraryError>, RpcError>> + '_

Collections: freeze a collection (convert it to a playlist).

Source

pub fn collection_get_songs( &self, ctx: Context, id: CollectionId, ) -> impl Future<Output = Result<Option<Box<[Song]>>, RpcError>> + '_

Get the songs of a collection

Source

pub fn radio_get_similar( &self, ctx: Context, things: Vec<RecordId>, n: u32, ) -> impl Future<Output = Result<Result<Box<[Song]>, SerializableLibraryError>, RpcError>> + '_

Radio: get the n most similar songs to the given things.

Source

pub fn radio_get_similar_ids( &self, ctx: Context, things: Vec<RecordId>, n: u32, ) -> impl Future<Output = Result<Result<Box<[SongId]>, SerializableLibraryError>, RpcError>> + '_

Radio: get the ids of the n most similar songs to the given things.

Source

pub fn dynamic_playlist_create( &self, ctx: Context, name: String, query: Query, ) -> impl Future<Output = Result<Result<DynamicPlaylistId, SerializableLibraryError>, RpcError>> + '_

Dynamic Playlists: create a new DP with the given name and query

Source

pub fn dynamic_playlist_list( &self, ctx: Context, ) -> impl Future<Output = Result<Box<[DynamicPlaylist]>, RpcError>> + '_

Dynamic Playlists: list all DPs

Source

pub fn dynamic_playlist_update( &self, ctx: Context, id: DynamicPlaylistId, changes: DynamicPlaylistChangeSet, ) -> impl Future<Output = Result<Result<DynamicPlaylist, SerializableLibraryError>, RpcError>> + '_

Dynamic Playlists: update a DP

Source

pub fn dynamic_playlist_remove( &self, ctx: Context, id: DynamicPlaylistId, ) -> impl Future<Output = Result<Result<(), SerializableLibraryError>, RpcError>> + '_

Dynamic Playlists: remove a DP

Source

pub fn dynamic_playlist_get( &self, ctx: Context, id: DynamicPlaylistId, ) -> impl Future<Output = Result<Option<DynamicPlaylist>, RpcError>> + '_

Dynamic Playlists: get a DP by its ID

Source

pub fn dynamic_playlist_get_songs( &self, ctx: Context, id: DynamicPlaylistId, ) -> impl Future<Output = Result<Option<Box<[Song]>>, RpcError>> + '_

Dynamic Playlists: get the songs of a DP

Trait Implementations§

Source§

impl<Stub: Clone> Clone for MusicPlayerClient<Stub>

Source§

fn clone(&self) -> MusicPlayerClient<Stub>

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<Stub: Debug> Debug for MusicPlayerClient<Stub>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<Stub> From<Stub> for MusicPlayerClient<Stub>
where Stub: Stub<Req = MusicPlayerRequest, Resp = MusicPlayerResponse>,

Source§

fn from(stub: Stub) -> Self

Returns a new client stub that sends requests over the given transport.

Auto Trait Implementations§

§

impl<Stub> Freeze for MusicPlayerClient<Stub>
where Stub: Freeze,

§

impl<Stub> RefUnwindSafe for MusicPlayerClient<Stub>
where Stub: RefUnwindSafe,

§

impl<Stub> Send for MusicPlayerClient<Stub>
where Stub: Send,

§

impl<Stub> Sync for MusicPlayerClient<Stub>
where Stub: Sync,

§

impl<Stub> Unpin for MusicPlayerClient<Stub>
where Stub: Unpin,

§

impl<Stub> UnwindSafe for MusicPlayerClient<Stub>
where Stub: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<S> FromSample<S> for S

Source§

fn from_sample_(s: S) -> S

Source§

impl<T> FutureExt for T

Source§

fn with_context(self, otel_cx: Context) -> WithContext<Self>

Attaches the provided Context to this type, returning a WithContext wrapper. Read more
Source§

fn with_current_context(self) -> WithContext<Self>

Attaches the current Context to this type, returning a WithContext wrapper. Read more
Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<F, T> IntoSample<T> for F
where T: FromSample<F>,

Source§

fn into_sample(self) -> T

Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> ToSample<U> for T
where U: FromSample<T>,

Source§

fn to_sample_(self) -> U

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<S, T> Duplex<S> for T
where T: FromSample<S> + ToSample<S>,