pub struct BookSourceParser {
pub book_source: BookSource,
pub http_client: HttpClient,
pub analyzer: AnalyzerManager,
pub temp: Option<String>,
}
Fields§
§book_source: BookSource
§http_client: HttpClient
§analyzer: AnalyzerManager
§temp: Option<String>
Implementations§
Source§impl BookSourceParser
impl BookSourceParser
pub fn new(book_source: BookSource) -> Result<Self>
Sourcepub async fn get_explores(&mut self) -> Result<ExploreList>
pub async fn get_explores(&mut self) -> Result<ExploreList>
获取分类信息
Sourcepub async fn search_books(
&mut self,
key: &str,
page: u32,
page_size: u32,
) -> Result<BookList>
pub async fn search_books( &mut self, key: &str, page: u32, page_size: u32, ) -> Result<BookList>
搜索书籍
Sourcepub async fn explore_books(
&mut self,
url: &str,
page: u32,
page_size: u32,
) -> Result<BookList>
pub async fn explore_books( &mut self, url: &str, page: u32, page_size: u32, ) -> Result<BookList>
使用explore_item的url获取书籍列表
Sourcepub async fn get_book_info(&mut self, book_url: &str) -> Result<BookInfo>
pub async fn get_book_info(&mut self, book_url: &str) -> Result<BookInfo>
获取书籍信息
pub async fn get_chapters(&mut self, toc_url: &str) -> Result<Vec<Chapter>>
pub async fn get_content(&mut self, chapter_url: &str) -> Result<String>
Trait Implementations§
Source§impl Clone for BookSourceParser
impl Clone for BookSourceParser
Source§fn clone(&self) -> BookSourceParser
fn clone(&self) -> BookSourceParser
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for BookSourceParser
impl Debug for BookSourceParser
Source§impl TryFrom<BookSource> for BookSourceParser
impl TryFrom<BookSource> for BookSourceParser
Source§type Error = ParseError
type Error = ParseError
The type returned in the event of a conversion error.
Source§fn try_from(book_source: BookSource) -> Result<Self>
fn try_from(book_source: BookSource) -> Result<Self>
Performs the conversion.
Auto Trait Implementations§
impl Freeze for BookSourceParser
impl !RefUnwindSafe for BookSourceParser
impl Send for BookSourceParser
impl Sync for BookSourceParser
impl Unpin for BookSourceParser
impl !UnwindSafe for BookSourceParser
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more