pub struct Client {
pub client_id: RwLock<String>,
pub retry_config: RetryConfig,
}Expand description
SoundCloud API client
Fields§
§client_id: RwLock<String>§retry_config: RetryConfigImplementations§
Source§impl Client
impl Client
pub async fn search_albums( &self, query: Option<&AlbumQuery>, ) -> Result<Playlists, Error>
Source§impl Client
impl Client
pub async fn new() -> Result<Self, Error>
pub async fn with_retry_config(retry_config: RetryConfig) -> Result<Self, Error>
pub async fn refresh_client_id(&self) -> Result<(), Error>
pub async fn get_client_id_value(&self) -> String
pub async fn get_json<R: DeserializeOwned, Q: Serialize>( base_url: &str, path: Option<&str>, query: Option<&Q>, client_id: &str, ) -> Result<(R, u16), Error>
pub async fn get<Q: Serialize, R: DeserializeOwned>( &self, path: &str, query: Option<&Q>, ) -> Result<R, Error>
Sourcepub async fn health_check(&self) -> bool
pub async fn health_check(&self) -> bool
Health check endpoint that calls /me on the API Returns true if the API responds successfully (2xx), false otherwise
Source§impl Client
impl Client
pub async fn search_playlists( &self, query: Option<&PlaylistsQuery>, ) -> Result<Playlists, Error>
pub async fn get_playlist( &self, identifier: &Identifier, ) -> Result<Playlist, Error>
pub async fn get_playlist_reposters( &self, identifier: &Identifier, pagination: Option<&Paging>, ) -> Result<Users, Error>
pub async fn download_playlist( &self, identifier: &Identifier, destination: Option<&str>, playlist_name: Option<&str>, ) -> Result<(), Error>
Source§impl Client
impl Client
pub async fn get_search_results( &self, query: Option<&SearchResultsQuery>, ) -> Result<SearchResultsResponse, Error>
pub async fn search_all( &self, query: Option<&SearchAllQuery>, ) -> Result<SearchAllResponse, Error>
Source§impl Client
impl Client
pub async fn search_tracks( &self, query: Option<&TracksQuery>, ) -> Result<Tracks, Error>
pub async fn get_track(&self, identifier: &Identifier) -> Result<Track, Error>
pub async fn download_track( &self, identifier: &Identifier, stream_type: Option<&StreamType>, destination: Option<&str>, filename: Option<&str>, ) -> Result<(), Error>
pub async fn get_track_waveform( &self, identifier: &Identifier, ) -> Result<Waveform, Error>
pub async fn get_stream_url( &self, identifier: &Identifier, stream_type: Option<&StreamType>, ) -> Result<String, Error>
Source§impl Client
impl Client
pub async fn search_users( &self, query: Option<&UsersQuery>, ) -> Result<Users, Error>
pub async fn get_user(&self, identifier: &Identifier) -> Result<User, Error>
pub async fn get_user_followers( &self, identifier: &Identifier, pagination: Option<&Paging>, ) -> Result<Users, Error>
pub async fn get_user_followings( &self, identifier: &Identifier, pagination: Option<&Paging>, ) -> Result<Users, Error>
pub async fn get_user_playlists( &self, identifier: &Identifier, pagination: Option<&Paging>, ) -> Result<Playlists, Error>
pub async fn get_user_tracks( &self, identifier: &Identifier, pagination: Option<&Paging>, ) -> Result<Tracks, Error>
pub async fn get_user_reposts( &self, identifier: &Identifier, pagination: Option<&Paging>, ) -> Result<Reposts, Error>
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for Client
impl !RefUnwindSafe for Client
impl !UnwindSafe for Client
impl Send for Client
impl Sync for Client
impl Unpin for Client
impl UnsafeUnpin for Client
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