[−][src]Struct ksoft::music::Music
Fields
http: Arc<HttpClient>
Implementations
impl Music
[src]
pub fn new(http_client: Arc<HttpClient>) -> Self
[src]
pub async fn advanced_lyrics<'_>(
&'_ self,
query: impl ToString,
text_only: bool,
limit: u32
) -> Result<Lyrics>
[src]
&'_ self,
query: impl ToString,
text_only: bool,
limit: u32
) -> Result<Lyrics>
Get lyrics of a song specifying custom parameters
Example
ⓘThis example is not tested
if let Ok(res) = client.music.advanced_lyrics("despacito", false, 10).await { match res { Ok(lyrics) => { //do something with lyrics }, Err(why) => { //do something with the <MusicError> struct } } }
pub async fn lyrics<'_>(&'_ self, query: impl ToString) -> Result<Lyrics>
[src]
Get lyrics of a song
Example
ⓘThis example is not tested
if let Ok(res) = client.music.lyrics("despacito").await { match res { Ok(lyrics) => { //do something with lyrics }, Err(why) => { //do something with the <MusicError> struct } } }
pub async fn advanced_recommendations<'_>(
&'_ self,
tracks: ProviderType,
youtube_token: Option<String>,
limit: Option<u32>,
recommend_type: Option<String>
) -> HttpResult<MusicRecommendationsResponse, MusicError>
[src]
&'_ self,
tracks: ProviderType,
youtube_token: Option<String>,
limit: Option<u32>,
recommend_type: Option<String>
) -> HttpResult<MusicRecommendationsResponse, MusicError>
Get recommendations of songs with given query specifying custom parameters
You need a premium plan to use this endpoint
Example
ⓘThis example is not tested
if let Ok(res) = client.music.advanced_recommendations( ProviderType::YoutubeTitles(vec![String::from("despacito")]), None, None, None).await { match res { Ok(recommendations) => { //do something with recommendations }, Err(why) => { //do something with the <MusicError> struct } }
pub async fn recommendations<'_>(
&'_ self,
tracks: ProviderType
) -> HttpResult<MusicRecommendationsResponse, MusicError>
[src]
&'_ self,
tracks: ProviderType
) -> HttpResult<MusicRecommendationsResponse, MusicError>
Get recommendations of songs with given query
You need a premium plan to use this endpoint
Example
ⓘThis example is not tested
if let Ok(res) = client.music.recommendations( ProviderType::YoutubeTitles(vec![String::from("despacito")])).await { match res { Ok(recommendations) => { //do something with recommendations }, Err(why) => { //do something with the <MusicError> struct } }
Auto Trait Implementations
impl !RefUnwindSafe for Music
[src]
impl Send for Music
[src]
impl Sync for Music
[src]
impl Unpin for Music
[src]
impl !UnwindSafe for Music
[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T> Instrument for T
[src]
pub fn instrument(self, span: Span) -> Instrumented<Self>
[src]
pub fn in_current_span(self) -> Instrumented<Self>
[src]
impl<T> Instrument for T
[src]
pub fn instrument(self, span: Span) -> Instrumented<Self>
[src]
pub fn in_current_span(self) -> Instrumented<Self>
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,