pub struct RemoteApiClient { /* private fields */ }Expand description
远程API客户端
封装了HTTP客户端和API基础URL,提供所有MSR API的调用方法。 支持自定义超时时间和基础URL配置。
Implementations§
Source§impl RemoteApiClient
impl RemoteApiClient
Sourcepub fn with_config(base: String, timeout: Duration) -> Self
pub fn with_config(base: String, timeout: Duration) -> Self
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>
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>
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§
Source§impl Clone for RemoteApiClient
impl Clone for RemoteApiClient
Source§fn clone(&self) -> RemoteApiClient
fn clone(&self) -> RemoteApiClient
Returns a duplicate of the value. Read more
1.0.0§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for RemoteApiClient
impl !RefUnwindSafe for RemoteApiClient
impl Send for RemoteApiClient
impl Sync for RemoteApiClient
impl Unpin for RemoteApiClient
impl !UnwindSafe for RemoteApiClient
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
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
🔬This is a nightly-only experimental API. (
clone_to_uninit)