Skip to main content

ExtractWarning

Struct ExtractWarning 

Source
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: String

Human-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

Source

pub fn new(description: impl Into<String>) -> Self

Create a warning with just a description.

Source

pub fn on_page(description: impl Into<String>, page: usize) -> Self

Create a warning with page context.

Source

pub fn with_context( description: impl Into<String>, page: usize, element: impl Into<String>, ) -> Self

Create a warning with full source context.

Source

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

Source§

fn clone(&self) -> ExtractWarning

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for ExtractWarning

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Display for ExtractWarning

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl PartialEq for ExtractWarning

Source§

fn eq(&self, other: &ExtractWarning) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl StructuralPartialEq for ExtractWarning

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

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

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

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

fn clone_into(&self, target: &mut T)

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

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.