pub struct MSRApiClient { /* private fields */ }Expand description
默认的MSR API客户端,使用官方API地址
这个客户端提供了对MSR API的完整封装,使用官方的API地址作为默认配置。 支持所有主要的API调用,包括歌曲、专辑、新闻和搜索功能。
Implementations§
Source§impl MSRApiClient
impl MSRApiClient
Sourcepub async fn get_all_songs(&self) -> Result<AllSongsResp, AppError>
pub async fn get_all_songs(&self) -> Result<AllSongsResp, AppError>
获取所有歌曲列表
Sourcepub async fn get_album_detail(
&self,
id: String,
) -> Result<AlbumDetailResp, AppError>
pub async fn get_album_detail( &self, id: String, ) -> Result<AlbumDetailResp, AppError>
获取指定ID的专辑详情(包含歌曲列表)
Sourcepub async fn get_all_albums(
&self,
) -> Result<ApiResp<Vec<AllAlbumsItem>>, AppError>
pub async fn get_all_albums( &self, ) -> Result<ApiResp<Vec<AllAlbumsItem>>, AppError>
获取所有专辑列表
Sourcepub async fn get_all_news(
&self,
last_cid: Option<String>,
) -> Result<SearchNewsResp, AppError>
pub async fn get_all_news( &self, last_cid: Option<String>, ) -> Result<SearchNewsResp, AppError>
Sourcepub async fn get_news_detail(
&self,
id: String,
) -> Result<NewsDetailResp, AppError>
pub async fn get_news_detail( &self, id: String, ) -> Result<NewsDetailResp, AppError>
获取指定ID的新闻详情
Sourcepub async fn search_albums(
&self,
keyword: String,
last_cid: Option<String>,
) -> Result<SearchAlbumResp, AppError>
pub async fn search_albums( &self, keyword: String, last_cid: Option<String>, ) -> Result<SearchAlbumResp, AppError>
Sourcepub async fn search_news(
&self,
keyword: String,
last_cid: Option<String>,
) -> Result<SearchNewsResp, AppError>
pub async fn search_news( &self, keyword: String, last_cid: Option<String>, ) -> Result<SearchNewsResp, AppError>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for MSRApiClient
impl !RefUnwindSafe for MSRApiClient
impl Send for MSRApiClient
impl Sync for MSRApiClient
impl Unpin for MSRApiClient
impl !UnwindSafe for MSRApiClient
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more