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

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The alignment of pointer.

The type for initializers.

Initializes a with the given initializer. Read more

Dereferences the given pointer. Read more

Mutably dereferences the given pointer. Read more

Drops the object pointed to by the given pointer. Read more

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.