Trait novel_api::Client

source ·
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§

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 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 buy_chapter( &self, info: &ChapterInfo ) -> impl Future<Output = Result<(), Error>> + Send

Buy chapter

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

Object Safety§

This trait is not object safe.

Implementors§