pub struct StreamingParser { /* private fields */ }Expand description
Lazy file parser: reads only the xref chain eagerly, then parses
individual objects on demand with windowed file reads (offsets come from
the xref table). Objects — including large stream bodies — that are never
requested are never loaded into RAM, unlike Parser::parse, which
materializes the whole file. Each object is cached after its first read.
Implementations§
Source§impl StreamingParser
impl StreamingParser
Sourcepub fn open(path: impl AsRef<Path>) -> PdfResult<Self>
pub fn open(path: impl AsRef<Path>) -> PdfResult<Self>
Opens path and walks its xref chain. Object content is not read yet.
Sourcepub fn with_parser(parser: Parser, path: impl AsRef<Path>) -> PdfResult<Self>
pub fn with_parser(parser: Parser, path: impl AsRef<Path>) -> PdfResult<Self>
Opens with a configured Parser, e.g. carrying custom
ParserLimits.
pub fn catalog(&self) -> Option<ObjectId>
pub fn info(&self) -> Option<ObjectId>
Sourcepub fn object_count(&self) -> usize
pub fn object_count(&self) -> usize
Number of entries in the xref table (includes free entries).
Auto Trait Implementations§
impl !Freeze for StreamingParser
impl !RefUnwindSafe for StreamingParser
impl !Sync for StreamingParser
impl Send for StreamingParser
impl Unpin for StreamingParser
impl UnsafeUnpin for StreamingParser
impl UnwindSafe for StreamingParser
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