pub struct ExtractWarning {
pub description: String,
pub page: Option<usize>,
pub element: Option<String>,
pub operator_index: Option<usize>,
pub font_name: Option<String>,
}Expand description
A non-fatal warning encountered during extraction.
Warnings allow best-effort continuation when issues are encountered (e.g., missing font metrics, unknown operators). They include a description and optional source location context such as page number, operator index, and font name.
Fields§
§description: StringHuman-readable description of the warning.
page: Option<usize>Page number where the warning occurred (0-indexed), if applicable.
element: Option<String>Element context (e.g., “char at offset 42”).
operator_index: Option<usize>Index of the operator in the content stream where the warning occurred.
font_name: Option<String>Font name associated with the warning, if applicable.
Implementations§
Source§impl ExtractWarning
impl ExtractWarning
Sourcepub fn on_page(description: impl Into<String>, page: usize) -> Self
pub fn on_page(description: impl Into<String>, page: usize) -> Self
Create a warning with page context.
Sourcepub fn with_context(
description: impl Into<String>,
page: usize,
element: impl Into<String>,
) -> Self
pub fn with_context( description: impl Into<String>, page: usize, element: impl Into<String>, ) -> Self
Create a warning with full source context.
Sourcepub fn with_operator_context(
description: impl Into<String>,
operator_index: usize,
font_name: impl Into<String>,
) -> Self
pub fn with_operator_context( description: impl Into<String>, operator_index: usize, font_name: impl Into<String>, ) -> Self
Create a warning with operator and font context.
Includes the operator index in the content stream and the font name, useful for diagnosing font-related issues during text extraction.
Trait Implementations§
Source§impl Clone for ExtractWarning
impl Clone for ExtractWarning
Source§fn clone(&self) -> ExtractWarning
fn clone(&self) -> ExtractWarning
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more