pub struct HtmlDocument {
text: String,
content: XmlTree,
engine: Engine,
pages: Vec<Page>,
parent: PathBuf,
size: usize,
viewer_stylesheet: PathBuf,
user_stylesheet: PathBuf,
ignore_document_css: bool,
}Fields§
§text: String§content: XmlTree§engine: Engine§pages: Vec<Page>§parent: PathBuf§size: usize§viewer_stylesheet: PathBuf§user_stylesheet: PathBuf§ignore_document_css: boolImplementations§
Source§impl HtmlDocument
impl HtmlDocument
pub fn new<P: AsRef<Path>>(path: P) -> Result<HtmlDocument, Error>
pub fn new_from_memory(text: &str) -> HtmlDocument
pub fn update(&mut self, text: &str)
pub fn set_margin(&mut self, margin: &Edge)
pub fn set_font_size(&mut self, font_size: f32)
pub fn set_viewer_stylesheet<P: AsRef<Path>>(&mut self, path: P)
pub fn set_user_stylesheet<P: AsRef<Path>>(&mut self, path: P)
fn page_index(&mut self, offset: usize) -> Option<usize>
fn resolve_link( &mut self, uri: &str, cache: &mut FxHashMap<String, usize>, ) -> Option<usize>
fn cache_uris( &mut self, node: NodeRef<'_>, name: &str, cache: &mut FxHashMap<String, usize>, )
fn build_pages(&mut self) -> Vec<Page> ⓘ
pub fn categories(&self) -> Option<String>
pub fn description(&self) -> Option<String>
pub fn language(&self) -> Option<String>
pub fn year(&self) -> Option<String>
Trait Implementations§
Source§impl Document for HtmlDocument
impl Document for HtmlDocument
fn dims(&self, _index: usize) -> Option<(f32, f32)>
fn pages_count(&self) -> usize
fn toc(&mut self) -> Option<Vec<TocEntry>>
fn chapter<'a>( &mut self, _offset: usize, _toc: &'a [TocEntry], ) -> Option<(&'a TocEntry, f32)>
fn chapter_relative<'a>( &mut self, _offset: usize, _dir: CycleDir, _toc: &'a [TocEntry], ) -> Option<&'a TocEntry>
fn resolve_location(&mut self, loc: Location) -> Option<usize>
fn words(&mut self, loc: Location) -> Option<(Vec<BoundedText>, usize)>
fn lines(&mut self, _loc: Location) -> Option<(Vec<BoundedText>, usize)>
fn images(&mut self, loc: Location) -> Option<(Vec<Boundary>, usize)>
fn links(&mut self, loc: Location) -> Option<(Vec<BoundedText>, usize)>
fn pixmap( &mut self, loc: Location, scale: f32, samples: usize, ) -> Option<(Pixmap, usize)>
fn layout(&mut self, width: u32, height: u32, font_size: f32, dpi: u16)
fn set_text_align(&mut self, text_align: TextAlign)
fn set_font_family(&mut self, family_name: &str, search_path: &str)
fn set_margin_width(&mut self, width: i32)
fn set_line_height(&mut self, line_height: f32)
fn set_hyphen_penalty(&mut self, hyphen_penalty: i32)
fn set_stretch_tolerance(&mut self, stretch_tolerance: f32)
fn set_ignore_document_css(&mut self, ignore: bool)
fn title(&self) -> Option<String>
fn metadata(&self, key: &str) -> Option<String>
fn save(&self, path: &str) -> Result<(), Error>
fn is_reflowable(&self) -> bool
fn has_synthetic_page_numbers(&self) -> bool
fn preview_pixmap( &mut self, width: f32, height: f32, samples: usize, ) -> Option<Pixmap>
impl Send for HtmlDocument
impl Sync for HtmlDocument
Auto Trait Implementations§
impl Freeze for HtmlDocument
impl RefUnwindSafe for HtmlDocument
impl Unpin for HtmlDocument
impl UnwindSafe for HtmlDocument
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
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Converts
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Converts
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further
downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Converts
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Converts
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.