pub struct Page {
pub index: usize,
pub content: String,
}Expand description
A single page of text content from an EPUB book.
Pages are extracted from the EPUB’s HTML/XHTML content files in the order defined by the spine element in the OPF file. Each page contains the plain text content with HTML tags stripped.
§Example
use epub_parser::Page;
let page = Page::new(0, "Chapter 1\n\nIt was a dark and stormy night...".to_string());
println!("Page {}: {} characters", page.index, page.content.len());Fields§
§index: usizeThe position of this page in the reading order (0-indexed).
content: StringThe plain text content of the page.
HTML tags are stripped, and the text is cleaned of control characters. Paragraphs and other block elements are separated by newlines.
Implementations§
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Page
impl RefUnwindSafe for Page
impl Send for Page
impl Sync for Page
impl Unpin for Page
impl UnwindSafe for Page
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