pub trait Client: Send {
Show 19 methods
// Required methods
fn proxy(&mut self, proxy: Url);
fn no_proxy(&mut self);
fn cert(&mut self, cert_path: PathBuf);
fn shutdown(&self) -> impl Future<Output = Result<(), Error>> + Send;
fn add_cookie(
&self,
cookie_str: &str,
url: &Url
) -> impl Future<Output = Result<(), Error>> + Send;
fn log_in(
&self,
username: String,
password: Option<String>
) -> impl Future<Output = Result<(), Error>> + Send;
fn logged_in(&self) -> impl Future<Output = Result<bool, Error>> + Send;
fn user_info(&self) -> impl Future<Output = Result<UserInfo, Error>> + Send;
fn money(&self) -> impl Future<Output = Result<u32, Error>> + Send;
fn sign_in(&self) -> impl Future<Output = Result<(), Error>> + Send;
fn bookshelf_infos(
&self
) -> impl Future<Output = Result<Vec<u32>, Error>> + Send;
fn novel_info(
&self,
id: u32
) -> impl Future<Output = Result<Option<NovelInfo>, Error>> + Send;
fn volume_infos(
&self,
id: u32
) -> impl Future<Output = Result<Option<VolumeInfos>, Error>> + Send;
fn content_infos(
&self,
info: &ChapterInfo
) -> impl Future<Output = Result<ContentInfos, Error>> + Send;
fn buy_chapter(
&self,
info: &ChapterInfo
) -> impl Future<Output = Result<(), Error>> + Send;
fn image(
&self,
url: &Url
) -> impl Future<Output = Result<DynamicImage, Error>> + Send;
fn categories(
&self
) -> impl Future<Output = Result<&Vec<Category>, Error>> + Send;
fn tags(&self) -> impl Future<Output = Result<&Vec<Tag>, Error>> + Send;
fn search_infos(
&self,
option: &Options,
page: u16,
size: u16
) -> impl Future<Output = Result<Option<Vec<u32>>, Error>> + Send;
}Expand description
Traits that abstract client behavior
Required Methods§
sourcefn cert(&mut self, cert_path: PathBuf)
fn cert(&mut self, cert_path: PathBuf)
Set the certificate path for use with packet capture tools
sourcefn shutdown(&self) -> impl Future<Output = Result<(), Error>> + Send
fn shutdown(&self) -> impl Future<Output = Result<(), Error>> + Send
Stop the client, save the data
Add cookie
sourcefn log_in(
&self,
username: String,
password: Option<String>
) -> impl Future<Output = Result<(), Error>> + Send
fn log_in( &self, username: String, password: Option<String> ) -> impl Future<Output = Result<(), Error>> + Send
Login in
sourcefn logged_in(&self) -> impl Future<Output = Result<bool, Error>> + Send
fn logged_in(&self) -> impl Future<Output = Result<bool, Error>> + Send
Check if you are logged in
sourcefn user_info(&self) -> impl Future<Output = Result<UserInfo, Error>> + Send
fn user_info(&self) -> impl Future<Output = Result<UserInfo, Error>> + Send
Get the information of the logged-in user
sourcefn bookshelf_infos(
&self
) -> impl Future<Output = Result<Vec<u32>, Error>> + Send
fn bookshelf_infos( &self ) -> impl Future<Output = Result<Vec<u32>, Error>> + Send
Get the favorite novel of the logged-in user and return the novel id
sourcefn novel_info(
&self,
id: u32
) -> impl Future<Output = Result<Option<NovelInfo>, Error>> + Send
fn novel_info( &self, id: u32 ) -> impl Future<Output = Result<Option<NovelInfo>, Error>> + Send
Get Novel Information
sourcefn volume_infos(
&self,
id: u32
) -> impl Future<Output = Result<Option<VolumeInfos>, Error>> + Send
fn volume_infos( &self, id: u32 ) -> impl Future<Output = Result<Option<VolumeInfos>, Error>> + Send
Get volume Information
sourcefn content_infos(
&self,
info: &ChapterInfo
) -> impl Future<Output = Result<ContentInfos, Error>> + Send
fn content_infos( &self, info: &ChapterInfo ) -> impl Future<Output = Result<ContentInfos, Error>> + Send
Get content Information
sourcefn buy_chapter(
&self,
info: &ChapterInfo
) -> impl Future<Output = Result<(), Error>> + Send
fn buy_chapter( &self, info: &ChapterInfo ) -> impl Future<Output = Result<(), Error>> + Send
Buy chapter
sourcefn image(
&self,
url: &Url
) -> impl Future<Output = Result<DynamicImage, Error>> + Send
fn image( &self, url: &Url ) -> impl Future<Output = Result<DynamicImage, Error>> + Send
Download image
sourcefn categories(
&self
) -> impl Future<Output = Result<&Vec<Category>, Error>> + Send
fn categories( &self ) -> impl Future<Output = Result<&Vec<Category>, Error>> + Send
Get all categories
Get all tags
Object Safety§
This trait is not object safe.