Struct SoundCloudClient

Source
pub struct SoundCloudClient { /* private fields */ }

Implementations§

Source§

impl SoundCloudClient

Source

pub async fn default() -> ClientResult<Self>

Source

pub async fn new( client_id: Option<String>, auth_token: Option<String>, ) -> ClientResult<Self>

Source

pub fn is_authenticated(&self) -> bool

Source

pub async fn api_get( &self, url: &str, query_params: Query, ) -> ClientResult<String>

Convenience method to send GET requests related to an endpoint in the API.

Source

pub async fn api_post( &self, url: &str, query_params: Query, body: &Value, ) -> ClientResult<String>

Convenience method to send POST requests related to an endpoint in the API.

Source

pub async fn api_put(&self, url: &str, body: &Value) -> ClientResult<String>

Convenience method to send PUT requests related to an endpoint in the API.

Source

pub async fn api_delete(&self, url: &str) -> ClientResult<String>

Convenience method to send DELETE requests related to an endpoint in the API.

Source

pub fn set_auth_token(&mut self, auth_token: Option<String>)

Source

pub async fn generate_client_id() -> ClientResult<String>

Trait Implementations§

Source§

impl MeApi for SoundCloudClient

Source§

fn get_me<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = ClientResult<User>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Get current user’s profile. ! Need authentication.
Source§

fn get_my_history<'life0, 'async_trait>( &'life0 self, collection_params: CollectionParams, ) -> Pin<Box<dyn Future<Output = ClientResult<Vec<HistoryItem>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Get the user’s listening history. ! Need authentication.
Source§

fn get_my_stream<'life0, 'async_trait>( &'life0 self, collection_params: CollectionParams, ) -> Pin<Box<dyn Future<Output = ClientResult<Vec<StreamItem>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Get the user’s stream of uploads and reposts. ! Need authentication.
Source§

impl MiscApi for SoundCloudClient

Source§

fn resolve<'life0, 'life1, 'async_trait>( &'life0 self, url: &'life1 str, ) -> Pin<Box<dyn Future<Output = ClientResult<SearchItem>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Resolve a URL to a SoundCloud resource.
Source§

fn resolve_track<'life0, 'life1, 'async_trait>( &'life0 self, url: &'life1 str, ) -> Pin<Box<dyn Future<Output = ClientResult<Track>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Resolve a URL to a SoundCloud track.
Source§

fn resolve_album_playlist<'life0, 'life1, 'async_trait>( &'life0 self, url: &'life1 str, ) -> Pin<Box<dyn Future<Output = ClientResult<AlbumPlaylist>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Resolve a URL to a SoundCloud album or playlist.
Source§

fn resolve_user<'life0, 'life1, 'async_trait>( &'life0 self, url: &'life1 str, ) -> Pin<Box<dyn Future<Output = ClientResult<User>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Resolve a URL to a SoundCloud user.
Source§

impl PlaylistsApi for SoundCloudClient

Source§

fn get_playlist<'life0, 'async_trait>( &'life0 self, playlist_id: ResourceId, ) -> Pin<Box<dyn Future<Output = ClientResult<BasicAlbumPlaylist>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Returns the playlist with the given playlist_id.
Source§

fn get_playlist_likers<'life0, 'async_trait>( &'life0 self, playlist_id: ResourceId, ) -> Pin<Box<dyn Future<Output = ClientResult<Vec<User>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Get people who liked this playlist.
Source§

fn get_playlist_reposters<'life0, 'async_trait>( &'life0 self, playlist_id: ResourceId, ) -> Pin<Box<dyn Future<Output = ClientResult<Vec<User>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Get people who reposted this playlist.
Source§

fn extract_playlist_id<'life0, 'async_trait>( &'life0 self, playlist_id: ResourceId, ) -> Pin<Box<dyn Future<Output = ClientResult<u64>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Extracts the playlist id from the given playlist_id.
Source§

impl SearchApi for SoundCloudClient

Source§

fn search<'life0, 'async_trait>( &'life0 self, query: String, collection_params: CollectionParams, ) -> Pin<Box<dyn Future<Output = ClientResult<Vec<SearchItem>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Search for users, tracks and playlists
Source§

fn search_tracks<'life0, 'async_trait>( &'life0 self, query: String, collection_params: CollectionParams, ) -> Pin<Box<dyn Future<Output = ClientResult<Vec<SearchItem>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Search for tracks
Source§

fn search_users<'life0, 'async_trait>( &'life0 self, query: String, collection_params: CollectionParams, ) -> Pin<Box<dyn Future<Output = ClientResult<Vec<SearchItem>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Search for users
Source§

fn search_albums<'life0, 'async_trait>( &'life0 self, query: String, collection_params: CollectionParams, ) -> Pin<Box<dyn Future<Output = ClientResult<Vec<SearchItem>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Search for albums
Source§

fn search_playlists<'life0, 'async_trait>( &'life0 self, query: String, collection_params: CollectionParams, ) -> Pin<Box<dyn Future<Output = ClientResult<Vec<SearchItem>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Search for playlists
Source§

fn get_tag_tracks_recent<'life0, 'async_trait>( &'life0 self, tag: String, collection_params: CollectionParams, ) -> Pin<Box<dyn Future<Output = ClientResult<Vec<Track>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Get most recent tracks for this tag
Source§

impl TracksApi for SoundCloudClient

Source§

fn get_track<'life0, 'async_trait>( &'life0 self, track_id: ResourceId, ) -> Pin<Box<dyn Future<Output = ClientResult<BasicTrack>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Returns the track with the given track_id.
Source§

fn get_tracks<'life0, 'async_trait>( &'life0 self, track_ids: Vec<u64>, playlist_id: Option<u64>, playlist_secret_token: Option<String>, ) -> Pin<Box<dyn Future<Output = ClientResult<Vec<BasicTrack>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Returns the tracks with the given track_ids. Can be used to get track info for hidden tracks in a hidden playlist.
Source§

fn get_track_albums<'life0, 'async_trait>( &'life0 self, track_id: ResourceId, ) -> Pin<Box<dyn Future<Output = ClientResult<Vec<BasicAlbumPlaylist>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Get albums that this track is in.
Source§

fn get_track_playlists<'life0, 'async_trait>( &'life0 self, track_id: ResourceId, ) -> Pin<Box<dyn Future<Output = ClientResult<Vec<BasicAlbumPlaylist>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Get playlists that this track is in.
Source§

fn get_track_comments<'life0, 'async_trait>( &'life0 self, track_id: ResourceId, threaded: Option<u32>, ) -> Pin<Box<dyn Future<Output = ClientResult<Vec<BasicComment>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Get comments on this track.
Source§

fn get_track_likers<'life0, 'async_trait>( &'life0 self, track_id: ResourceId, ) -> Pin<Box<dyn Future<Output = ClientResult<Vec<User>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Get users who liked this track.
Source§

fn get_track_reposters<'life0, 'async_trait>( &'life0 self, track_id: ResourceId, ) -> Pin<Box<dyn Future<Output = ClientResult<Vec<User>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Get users who reposted this track.
Get related tracks.
Get track original download link. If track is private, requires secret token to be provided (last part of secret URL). ! Need authentication.
Source§

fn extract_track_id<'life0, 'async_trait>( &'life0 self, track_id: ResourceId, ) -> Pin<Box<dyn Future<Output = ClientResult<u64>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Extracts the track id from the given track_id.
Source§

impl UsersApi for SoundCloudClient

Source§

fn get_user<'life0, 'async_trait>( &'life0 self, user_id: ResourceId, ) -> Pin<Box<dyn Future<Output = ClientResult<User>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Returns the user with the given user_id.
Source§

fn get_user_by_username<'life0, 'life1, 'async_trait>( &'life0 self, username: &'life1 str, ) -> Pin<Box<dyn Future<Output = ClientResult<User>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Returns the user with the given username.
Source§

fn get_user_comments<'life0, 'async_trait>( &'life0 self, user_id: ResourceId, ) -> Pin<Box<dyn Future<Output = ClientResult<Vec<Comment>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Get comments by this user.
Source§

fn get_user_emails<'life0, 'async_trait>( &'life0 self, user_id: ResourceId, ) -> Pin<Box<dyn Future<Output = ClientResult<Vec<UserEmail>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Get user’s email addresses. ! Needs authentication.
Get profiles featured by this user.
Source§

fn get_user_followers<'life0, 'async_trait>( &'life0 self, user_id: ResourceId, ) -> Pin<Box<dyn Future<Output = ClientResult<Vec<User>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Get followers of this user.
Source§

fn get_user_followings<'life0, 'async_trait>( &'life0 self, user_id: ResourceId, ) -> Pin<Box<dyn Future<Output = ClientResult<Vec<User>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Get users followed by this user.
Source§

fn get_user_likes<'life0, 'async_trait>( &'life0 self, user_id: ResourceId, ) -> Pin<Box<dyn Future<Output = ClientResult<Vec<LikeItem>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Get user’s likes.
Get artists related to this user.
Source§

fn get_user_reposts<'life0, 'async_trait>( &'life0 self, user_id: ResourceId, ) -> Pin<Box<dyn Future<Output = ClientResult<Vec<RepostItem>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Get user’s reposts.
Source§

fn get_user_streams<'life0, 'async_trait>( &'life0 self, user_id: ResourceId, ) -> Pin<Box<dyn Future<Output = ClientResult<Vec<StreamItem>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Get user’s streams
Source§

fn get_user_tracks<'life0, 'async_trait>( &'life0 self, user_id: ResourceId, ) -> Pin<Box<dyn Future<Output = ClientResult<Vec<BasicTrack>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Get user’s tracks.
Get user’s popular tracks
Source§

fn get_user_albums<'life0, 'async_trait>( &'life0 self, user_id: ResourceId, ) -> Pin<Box<dyn Future<Output = ClientResult<Vec<BasicAlbumPlaylist>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Get user’s albums.
Source§

fn get_user_playlists<'life0, 'async_trait>( &'life0 self, user_id: ResourceId, ) -> Pin<Box<dyn Future<Output = ClientResult<Vec<BasicAlbumPlaylist>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Get user’s playlists.
Get user’s links.
Source§

fn get_user_conversations<'life0, 'async_trait>( &'life0 self, user_id: ResourceId, ) -> Pin<Box<dyn Future<Output = ClientResult<Vec<Conversation>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Get user’s conversations ! Needs authentication.
Source§

fn get_conversation_messages<'life0, 'async_trait>( &'life0 self, user_id: ResourceId, conversation_id: u64, ) -> Pin<Box<dyn Future<Output = ClientResult<Vec<Message>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Get conversation messages. ! Needs authentication.
Source§

fn get_unread_conversations<'life0, 'async_trait>( &'life0 self, user_id: ResourceId, ) -> Pin<Box<dyn Future<Output = ClientResult<Vec<Conversation>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Get unread conversations ! Needs authentication.
Source§

fn extract_user_id<'life0, 'async_trait>( &'life0 self, user_id: ResourceId, ) -> Pin<Box<dyn Future<Output = ClientResult<u64>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Extracts the user id from the given user_id.

Auto Trait Implementations§

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> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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<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<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<T> ErasedDestructor for T
where T: 'static,

Source§

impl<T> MaybeSendSync for T