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 the PdfPage moves out of scope.
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§
Source§impl Clone for PdfPageContentRegenerationStrategy
impl Clone for PdfPageContentRegenerationStrategy
Source§fn clone(&self) -> PdfPageContentRegenerationStrategy
fn clone(&self) -> PdfPageContentRegenerationStrategy
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for PdfPageContentRegenerationStrategy
Source§impl PartialEq for PdfPageContentRegenerationStrategy
impl PartialEq for PdfPageContentRegenerationStrategy
Source§fn eq(&self, other: &PdfPageContentRegenerationStrategy) -> bool
fn eq(&self, other: &PdfPageContentRegenerationStrategy) -> bool
self and other values to be equal, and is used by ==.impl StructuralPartialEq for PdfPageContentRegenerationStrategy
Auto Trait Implementations§
impl Freeze for PdfPageContentRegenerationStrategy
impl RefUnwindSafe for PdfPageContentRegenerationStrategy
impl Send for PdfPageContentRegenerationStrategy
impl Sync for PdfPageContentRegenerationStrategy
impl Unpin for PdfPageContentRegenerationStrategy
impl UnsafeUnpin for PdfPageContentRegenerationStrategy
impl UnwindSafe for PdfPageContentRegenerationStrategy
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>
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>
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