pub enum PdfPageContentRegenerationStrategy {
AutomaticOnEveryChange,
AutomaticOnDrop,
Manual,
}Expand description
Content regeneration strategies that instruct pdfium-render when, if ever, it should
automatically regenerate the content of a PdfPage.
Updates to a PdfPage are not committed to the underlying PdfDocument until the page’s content is regenerated. If a page is reloaded or closed without regenerating the page’s content, any changes not applied are lost.
By default, pdfium-render will trigger content regeneration on any change to a PdfPage;
this removes the possibility of data loss, and ensures changes can be read back from other
data structures as soon as they are made. However, if many changes are made to a page at once,
then regenerating the content after every change is inefficient; it is faster to stage
all changes first, then regenerate the page’s content just once. In this case,
changing the content regeneration strategy for a PdfPage can improve performance,
but you must be careful not to forget to commit your changes before closing
or reloading the page.
Variants
AutomaticOnEveryChange
pdfium-render will call the PdfPage::regenerate_content() function on any
change to this PdfPage. This is the default setting.
AutomaticOnDrop
pdfium-render will call the PdfPage::regenerate_content() function only when
this PdfPage is about to move out of scope.
Manual
pdfium-render will never call the PdfPage::regenerate_content() function.
You must do so manually after staging your changes, or your changes will be lost
when this PdfPage moves out of scope.
Trait Implementations
sourceimpl Clone for PdfPageContentRegenerationStrategy
impl Clone for PdfPageContentRegenerationStrategy
sourcefn clone(&self) -> PdfPageContentRegenerationStrategy
fn clone(&self) -> PdfPageContentRegenerationStrategy
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source. Read more
impl Copy for PdfPageContentRegenerationStrategy
impl StructuralPartialEq for PdfPageContentRegenerationStrategy
Auto Trait Implementations
impl RefUnwindSafe for PdfPageContentRegenerationStrategy
impl Send for PdfPageContentRegenerationStrategy
impl Sync for PdfPageContentRegenerationStrategy
impl Unpin for PdfPageContentRegenerationStrategy
impl UnwindSafe for PdfPageContentRegenerationStrategy
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more