pub struct StreamingDocument<R: Read + Seek> { /* private fields */ }Expand description
A PDF document that supports streaming operations
Implementations§
Source§impl<R: Read + Seek> StreamingDocument<R>
impl<R: Read + Seek> StreamingDocument<R>
Sourcepub fn new(reader: R, options: StreamingOptions) -> Result<Self>
pub fn new(reader: R, options: StreamingOptions) -> Result<Self>
Create a new streaming document
Sourcepub fn next_page(&mut self) -> Result<Option<StreamingPage>>
pub fn next_page(&mut self) -> Result<Option<StreamingPage>>
Get the next page for processing
Sourcepub fn process_pages<F>(&mut self, callback: F) -> Result<()>
pub fn process_pages<F>(&mut self, callback: F) -> Result<()>
Process all pages with a callback
Sourcepub fn memory_usage(&self) -> usize
pub fn memory_usage(&self) -> usize
Get current memory usage
Sourcepub fn clear_cache(&mut self)
pub fn clear_cache(&mut self)
Clear page cache to free memory
Auto Trait Implementations§
impl<R> Freeze for StreamingDocument<R>where
R: Freeze,
impl<R> RefUnwindSafe for StreamingDocument<R>where
R: RefUnwindSafe,
impl<R> Send for StreamingDocument<R>where
R: Send,
impl<R> Sync for StreamingDocument<R>where
R: Sync,
impl<R> Unpin for StreamingDocument<R>where
R: Unpin,
impl<R> UnwindSafe for StreamingDocument<R>where
R: UnwindSafe,
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more