pub trait Client {
Show 16 methods
// Required methods
fn proxy(&mut self, proxy: Url);
fn no_proxy(&mut self);
fn cert<T>(&mut self, cert_path: T)
where T: AsRef<Path>;
fn shutdown<'life0, 'async_trait>(
&'life0 self
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn add_cookie<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
cookie_str: &'life1 str,
url: &'life2 Url
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait;
fn login<'life0, 'async_trait>(
&'life0 self,
username: String,
password: String
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn user_info<'life0, 'async_trait>(
&'life0 self
) -> Pin<Box<dyn Future<Output = Result<Option<UserInfo>, Error>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn novel_info<'life0, 'async_trait>(
&'life0 self,
id: u32
) -> Pin<Box<dyn Future<Output = Result<Option<NovelInfo>, Error>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn volume_infos<'life0, 'async_trait>(
&'life0 self,
id: u32
) -> Pin<Box<dyn Future<Output = Result<VolumeInfos, Error>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn content_infos<'life0, 'life1, 'async_trait>(
&'life0 self,
info: &'life1 ChapterInfo
) -> Pin<Box<dyn Future<Output = Result<ContentInfos, Error>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn image<'life0, 'life1, 'async_trait>(
&'life0 self,
url: &'life1 Url
) -> Pin<Box<dyn Future<Output = Result<DynamicImage, Error>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn search_infos<'life0, 'async_trait, T>(
&'life0 self,
text: T,
page: u16,
size: u16
) -> Pin<Box<dyn Future<Output = Result<Vec<u32>, Error>> + Send + 'async_trait>>
where T: AsRef<str> + Send + Sync + 'async_trait,
Self: 'async_trait,
'life0: 'async_trait;
fn bookshelf_infos<'life0, 'async_trait>(
&'life0 self
) -> Pin<Box<dyn Future<Output = Result<Vec<u32>, Error>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn categories<'life0, 'async_trait>(
&'life0 self
) -> Pin<Box<dyn Future<Output = Result<&Vec<Category>, Error>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn tags<'life0, 'async_trait>(
&'life0 self
) -> Pin<Box<dyn Future<Output = Result<&Vec<Tag>, Error>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn novels<'life0, 'life1, 'async_trait>(
&'life0 self,
option: &'life1 Options,
page: u16,
size: u16
) -> Pin<Box<dyn Future<Output = Result<Vec<u32>, Error>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
}Expand description
Traits that abstract client behavior
Required Methods§
sourcefn cert<T>(&mut self, cert_path: T)where
T: AsRef<Path>,
fn cert<T>(&mut self, cert_path: T)where T: AsRef<Path>,
Set the certificate path for use with packet capture tools
sourcefn shutdown<'life0, 'async_trait>(
&'life0 self
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn shutdown<'life0, 'async_trait>( &'life0 self ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait,
Stop the client, save the data
Add cookie
sourcefn login<'life0, 'async_trait>(
&'life0 self,
username: String,
password: String
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn login<'life0, 'async_trait>( &'life0 self, username: String, password: String ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait,
Login
sourcefn user_info<'life0, 'async_trait>(
&'life0 self
) -> Pin<Box<dyn Future<Output = Result<Option<UserInfo>, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn user_info<'life0, 'async_trait>( &'life0 self ) -> Pin<Box<dyn Future<Output = Result<Option<UserInfo>, Error>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait,
Get the information of the logged-in user, if the information fails to get, it will return None
sourcefn novel_info<'life0, 'async_trait>(
&'life0 self,
id: u32
) -> Pin<Box<dyn Future<Output = Result<Option<NovelInfo>, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn novel_info<'life0, 'async_trait>( &'life0 self, id: u32 ) -> Pin<Box<dyn Future<Output = Result<Option<NovelInfo>, Error>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait,
Get Novel Information
sourcefn volume_infos<'life0, 'async_trait>(
&'life0 self,
id: u32
) -> Pin<Box<dyn Future<Output = Result<VolumeInfos, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn volume_infos<'life0, 'async_trait>( &'life0 self, id: u32 ) -> Pin<Box<dyn Future<Output = Result<VolumeInfos, Error>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait,
Get volume Information
sourcefn content_infos<'life0, 'life1, 'async_trait>(
&'life0 self,
info: &'life1 ChapterInfo
) -> Pin<Box<dyn Future<Output = Result<ContentInfos, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn content_infos<'life0, 'life1, 'async_trait>( &'life0 self, info: &'life1 ChapterInfo ) -> Pin<Box<dyn Future<Output = Result<ContentInfos, Error>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,
Get content Information
sourcefn image<'life0, 'life1, 'async_trait>(
&'life0 self,
url: &'life1 Url
) -> Pin<Box<dyn Future<Output = Result<DynamicImage, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn image<'life0, 'life1, 'async_trait>( &'life0 self, url: &'life1 Url ) -> Pin<Box<dyn Future<Output = Result<DynamicImage, Error>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,
Download image
sourcefn search_infos<'life0, 'async_trait, T>(
&'life0 self,
text: T,
page: u16,
size: u16
) -> Pin<Box<dyn Future<Output = Result<Vec<u32>, Error>> + Send + 'async_trait>>where
T: AsRef<str> + Send + Sync + 'async_trait,
Self: 'async_trait,
'life0: 'async_trait,
fn search_infos<'life0, 'async_trait, T>( &'life0 self, text: T, page: u16, size: u16 ) -> Pin<Box<dyn Future<Output = Result<Vec<u32>, Error>> + Send + 'async_trait>>where T: AsRef<str> + Send + Sync + 'async_trait, Self: 'async_trait, 'life0: 'async_trait,
Search, return novel id
sourcefn bookshelf_infos<'life0, 'async_trait>(
&'life0 self
) -> Pin<Box<dyn Future<Output = Result<Vec<u32>, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn bookshelf_infos<'life0, 'async_trait>( &'life0 self ) -> Pin<Box<dyn Future<Output = Result<Vec<u32>, Error>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait,
Get the favorite novel of the logged-in user and return the novel id
sourcefn categories<'life0, 'async_trait>(
&'life0 self
) -> Pin<Box<dyn Future<Output = Result<&Vec<Category>, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn categories<'life0, 'async_trait>( &'life0 self ) -> Pin<Box<dyn Future<Output = Result<&Vec<Category>, Error>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait,
Get all categories
Get all tags