changxi 0.3.0

TUI EPUB Reader
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
pub mod epub;

use crate::core::models::Chapter;
use crate::core::parser::ChapterInfo;
use crate::error::EpubError;

pub trait Reader: Send + Sync {
    fn title(&self) -> &str;
    fn author(&self) -> &str;
    fn chapter_count(&self) -> usize;
    fn get_chapter(&self, index: usize) -> Result<Chapter, EpubError>;
    fn get_chapters_info(&self) -> Vec<ChapterInfo>;
    fn get_image_by_path(&self, path: &str) -> Result<Vec<u8>, EpubError>;
    fn cover_image(&self) -> Result<Option<Vec<u8>>, EpubError>;
}