pub trait Client: Send {
Show 23 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 comments(
&self,
id: u32,
comment_type: CommentType,
need_replies: bool,
page: u16,
size: u16,
) -> impl Future<Output = Result<Option<Vec<Comment>>, 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 content_infos_multiple(
&self,
infos: &[ChapterInfo],
) -> impl Future<Output = Result<Vec<ContentInfos>, Error>> + Send;
fn order_chapter(
&self,
info: &ChapterInfo,
) -> impl Future<Output = Result<(), Error>> + Send;
fn order_novel(
&self,
id: u32,
infos: &VolumeInfos,
) -> 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;
fn has_this_type_of_comments(comment_type: CommentType) -> bool;
}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 comments(
&self,
id: u32,
comment_type: CommentType,
need_replies: bool,
page: u16,
size: u16,
) -> impl Future<Output = Result<Option<Vec<Comment>>, Error>> + Send
fn comments( &self, id: u32, comment_type: CommentType, need_replies: bool, page: u16, size: u16, ) -> impl Future<Output = Result<Option<Vec<Comment>>, Error>> + Send
Get comments of the novel
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 content_infos_multiple(
&self,
infos: &[ChapterInfo],
) -> impl Future<Output = Result<Vec<ContentInfos>, Error>> + Send
fn content_infos_multiple( &self, infos: &[ChapterInfo], ) -> impl Future<Output = Result<Vec<ContentInfos>, Error>> + Send
Get multiple content Information
Sourcefn order_chapter(
&self,
info: &ChapterInfo,
) -> impl Future<Output = Result<(), Error>> + Send
fn order_chapter( &self, info: &ChapterInfo, ) -> impl Future<Output = Result<(), Error>> + Send
Order chapter
Sourcefn order_novel(
&self,
id: u32,
infos: &VolumeInfos,
) -> impl Future<Output = Result<(), Error>> + Send
fn order_novel( &self, id: u32, infos: &VolumeInfos, ) -> impl Future<Output = Result<(), Error>> + Send
Order the whole novel
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
Sourcefn search_infos(
&self,
option: &Options,
page: u16,
size: u16,
) -> impl Future<Output = Result<Option<Vec<u32>>, Error>> + Send
fn search_infos( &self, option: &Options, page: u16, size: u16, ) -> impl Future<Output = Result<Option<Vec<u32>>, Error>> + Send
Search all matching novels
Sourcefn has_this_type_of_comments(comment_type: CommentType) -> bool
fn has_this_type_of_comments(comment_type: CommentType) -> bool
Does the app have comment in this type
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.