Client

Trait Client 

Source
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§

Source

fn proxy(&mut self, proxy: Url)

set proxy

Source

fn no_proxy(&mut self)

Do not use proxy (environment variables used to set proxy are ignored)

Source

fn cert(&mut self, cert_path: PathBuf)

Set the certificate path for use with packet capture tools

Source

fn shutdown(&self) -> impl Future<Output = Result<(), Error>> + Send

Stop the client, save the data

Add cookie

Source

fn log_in( &self, username: String, password: Option<String>, ) -> impl Future<Output = Result<(), Error>> + Send

Login in

Source

fn logged_in(&self) -> impl Future<Output = Result<bool, Error>> + Send

Check if you are logged in

Source

fn user_info(&self) -> impl Future<Output = Result<UserInfo, Error>> + Send

Get the information of the logged-in user

Source

fn money(&self) -> impl Future<Output = Result<u32, Error>> + Send

Get user’s existing money

Source

fn sign_in(&self) -> impl Future<Output = Result<(), Error>> + Send

Sign in

Source

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

Source

fn novel_info( &self, id: u32, ) -> impl Future<Output = Result<Option<NovelInfo>, Error>> + Send

Get novel Information

Source

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

Source

fn volume_infos( &self, id: u32, ) -> impl Future<Output = Result<Option<VolumeInfos>, Error>> + Send

Get volume Information

Source

fn content_infos( &self, info: &ChapterInfo, ) -> impl Future<Output = Result<ContentInfos, Error>> + Send

Get content Information

Source

fn content_infos_multiple( &self, infos: &[ChapterInfo], ) -> impl Future<Output = Result<Vec<ContentInfos>, Error>> + Send

Get multiple content Information

Source

fn order_chapter( &self, info: &ChapterInfo, ) -> impl Future<Output = Result<(), Error>> + Send

Order chapter

Source

fn order_novel( &self, id: u32, infos: &VolumeInfos, ) -> impl Future<Output = Result<(), Error>> + Send

Order the whole novel

Source

fn image( &self, url: &Url, ) -> impl Future<Output = Result<DynamicImage, Error>> + Send

Download image

Source

fn categories( &self, ) -> impl Future<Output = Result<&Vec<Category>, Error>> + Send

Get all categories

Source

fn tags(&self) -> impl Future<Output = Result<&Vec<Tag>, Error>> + Send

Get all tags

Source

fn search_infos( &self, option: &Options, page: u16, size: u16, ) -> impl Future<Output = Result<Option<Vec<u32>>, Error>> + Send

Search all matching novels

Source

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.

Implementors§