pub struct SpClient(/* private fields */);
Implementations§
Source§impl SpClient
impl SpClient
pub fn set_strategy(&self, strategy: RequestStrategy)
pub async fn flush_accesspoint(&self)
pub async fn get_accesspoint(&self) -> Result<SocketAddress, Error>
pub async fn base_url(&self) -> Result<String, Error>
pub async fn client_token(&self) -> Result<String, Error>
pub async fn request_with_protobuf<M: Message + MessageFull>( &self, method: &Method, endpoint: &str, headers: Option<HeaderMap>, message: &M, ) -> SpClientResult
pub async fn request_with_protobuf_and_options<M: Message + MessageFull>( &self, method: &Method, endpoint: &str, headers: Option<HeaderMap>, message: &M, options: &RequestOptions, ) -> SpClientResult
pub async fn request_as_json( &self, method: &Method, endpoint: &str, headers: Option<HeaderMap>, body: Option<&str>, ) -> SpClientResult
pub async fn request( &self, method: &Method, endpoint: &str, headers: Option<HeaderMap>, body: Option<&[u8]>, ) -> SpClientResult
pub async fn request_with_options( &self, method: &Method, endpoint: &str, headers: Option<HeaderMap>, body: Option<&[u8]>, options: &RequestOptions, ) -> SpClientResult
pub async fn put_connect_state_request( &self, state: &PutStateRequest, ) -> SpClientResult
pub async fn delete_connect_state_request(&self) -> SpClientResult
pub async fn put_connect_state_inactive(&self, notify: bool) -> SpClientResult
pub async fn get_metadata(&self, scope: &str, id: &SpotifyId) -> SpClientResult
pub async fn get_track_metadata(&self, track_id: &SpotifyId) -> SpClientResult
pub async fn get_episode_metadata( &self, episode_id: &SpotifyId, ) -> SpClientResult
pub async fn get_album_metadata(&self, album_id: &SpotifyId) -> SpClientResult
pub async fn get_artist_metadata(&self, artist_id: &SpotifyId) -> SpClientResult
pub async fn get_show_metadata(&self, show_id: &SpotifyId) -> SpClientResult
pub async fn get_lyrics(&self, track_id: &SpotifyId) -> SpClientResult
pub async fn get_lyrics_for_image( &self, track_id: &SpotifyId, image_id: &FileId, ) -> SpClientResult
pub async fn get_playlist(&self, playlist_id: &SpotifyId) -> SpClientResult
pub async fn get_user_profile( &self, username: &str, playlist_limit: Option<u32>, artist_limit: Option<u32>, ) -> SpClientResult
pub async fn get_user_followers(&self, username: &str) -> SpClientResult
pub async fn get_user_following(&self, username: &str) -> SpClientResult
pub async fn get_radio_for_track(&self, track_id: &SpotifyId) -> SpClientResult
pub async fn get_apollo_station( &self, scope: &str, context_uri: &str, count: Option<usize>, previous_tracks: Vec<SpotifyId>, autoplay: bool, ) -> SpClientResult
pub async fn get_next_page(&self, next_page_uri: &str) -> SpClientResult
pub async fn get_extended_metadata( &self, request: BatchedEntityRequest, ) -> SpClientResult
pub async fn get_audio_storage(&self, file_id: &FileId) -> SpClientResult
pub fn stream_from_cdn<U>( &self, cdn_url: U, offset: usize, length: usize, ) -> Result<IntoStream<ResponseFuture>, Error>
pub async fn request_url(&self, url: &str) -> SpClientResult
pub async fn get_audio_preview(&self, preview_id: &FileId) -> SpClientResult
pub async fn get_head_file(&self, file_id: &FileId) -> SpClientResult
pub async fn get_image(&self, image_id: &FileId) -> SpClientResult
Sourcepub async fn get_context(&self, uri: &str) -> Result<Context, Error>
pub async fn get_context(&self, uri: &str) -> Result<Context, Error>
Request the context for an uri
All SpotifyId uris are supported in addition to the following special uris:
- liked songs:
- all:
spotify:user:<user_id>:collection
- of artist:
spotify:user:<user_id>:collection:artist:<artist_id>
- all:
- search:
spotify:search:<search+query>
(whitespaces are replaced with+
)
§Query params found in the wild:
- include_video=true
§Known results of uri types:
- uris of type
track
- returns a single page with a single track
- when requesting a single track with a query in the request, the returned track uri will contain the query
- uris of type
artist
- returns 2 pages with tracks: 10 most popular tracks and latest/popular album
- remaining pages are artist albums sorted by popularity (only provided as page_url)
- uris of type
search
- is massively influenced by the provided query
- the query result shown by the search expects no query at all
- uri looks like
spotify:search:never+gonna
pub async fn get_autoplay_context( &self, context_request: &AutoplayContextRequest, ) -> Result<Context, Error>
pub async fn get_rootlist( &self, from: usize, length: Option<usize>, ) -> SpClientResult
Trait Implementations§
Auto Trait Implementations§
impl Freeze for SpClient
impl !RefUnwindSafe for SpClient
impl Send for SpClient
impl Sync for SpClient
impl Unpin for SpClient
impl !UnwindSafe for SpClient
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more