Page

Struct Page 

Source
#[non_exhaustive]
pub struct Page {
Show 17 fields pub page_number: i32, pub image: Option<Image>, pub transforms: Vec<Matrix>, pub dimension: Option<Dimension>, pub layout: Option<Layout>, pub detected_languages: Vec<DetectedLanguage>, pub blocks: Vec<Block>, pub paragraphs: Vec<Paragraph>, pub lines: Vec<Line>, pub tokens: Vec<Token>, pub visual_elements: Vec<VisualElement>, pub tables: Vec<Table>, pub form_fields: Vec<FormField>, pub symbols: Vec<Symbol>, pub detected_barcodes: Vec<DetectedBarcode>, pub image_quality_scores: Option<ImageQualityScores>, pub provenance: Option<Provenance>, /* private fields */
}
Expand description

A page in a Document.

Fields (Non-exhaustive)§

This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.
§page_number: i32

1-based index for current Page in a parent Document. Useful when a page is taken out of a Document for individual processing.

§image: Option<Image>

Rendered image for this page. This image is preprocessed to remove any skew, rotation, and distortions such that the annotation bounding boxes can be upright and axis-aligned.

§transforms: Vec<Matrix>

Transformation matrices that were applied to the original document image to produce Page.image.

§dimension: Option<Dimension>

Physical dimension of the page.

§layout: Option<Layout>

Layout for the page.

§detected_languages: Vec<DetectedLanguage>

A list of detected languages together with confidence.

§blocks: Vec<Block>

A list of visually detected text blocks on the page. A block has a set of lines (collected into paragraphs) that have a common line-spacing and orientation.

§paragraphs: Vec<Paragraph>

A list of visually detected text paragraphs on the page. A collection of lines that a human would perceive as a paragraph.

§lines: Vec<Line>

A list of visually detected text lines on the page. A collection of tokens that a human would perceive as a line.

§tokens: Vec<Token>

A list of visually detected tokens on the page.

§visual_elements: Vec<VisualElement>

A list of detected non-text visual elements e.g. checkbox, signature etc. on the page.

§tables: Vec<Table>

A list of visually detected tables on the page.

§form_fields: Vec<FormField>

A list of visually detected form fields on the page.

§symbols: Vec<Symbol>

A list of visually detected symbols on the page.

§detected_barcodes: Vec<DetectedBarcode>

A list of detected barcodes.

§image_quality_scores: Option<ImageQualityScores>

Image quality scores.

§provenance: Option<Provenance>
👎Deprecated

The history of this page.

Implementations§

Source§

impl Page

Source

pub fn new() -> Self

Source

pub fn set_page_number<T: Into<i32>>(self, v: T) -> Self

Sets the value of page_number.

Source

pub fn set_image<T>(self, v: T) -> Self
where T: Into<Image>,

Sets the value of image.

Source

pub fn set_or_clear_image<T>(self, v: Option<T>) -> Self
where T: Into<Image>,

Sets or clears the value of image.

Source

pub fn set_transforms<T, V>(self, v: T) -> Self
where T: IntoIterator<Item = V>, V: Into<Matrix>,

Sets the value of transforms.

Source

pub fn set_dimension<T>(self, v: T) -> Self
where T: Into<Dimension>,

Sets the value of dimension.

Source

pub fn set_or_clear_dimension<T>(self, v: Option<T>) -> Self
where T: Into<Dimension>,

Sets or clears the value of dimension.

Source

pub fn set_layout<T>(self, v: T) -> Self
where T: Into<Layout>,

Sets the value of layout.

Source

pub fn set_or_clear_layout<T>(self, v: Option<T>) -> Self
where T: Into<Layout>,

Sets or clears the value of layout.

Source

pub fn set_detected_languages<T, V>(self, v: T) -> Self
where T: IntoIterator<Item = V>, V: Into<DetectedLanguage>,

Sets the value of detected_languages.

Source

pub fn set_blocks<T, V>(self, v: T) -> Self
where T: IntoIterator<Item = V>, V: Into<Block>,

Sets the value of blocks.

Source

pub fn set_paragraphs<T, V>(self, v: T) -> Self
where T: IntoIterator<Item = V>, V: Into<Paragraph>,

Sets the value of paragraphs.

Source

pub fn set_lines<T, V>(self, v: T) -> Self
where T: IntoIterator<Item = V>, V: Into<Line>,

Sets the value of lines.

Source

pub fn set_tokens<T, V>(self, v: T) -> Self
where T: IntoIterator<Item = V>, V: Into<Token>,

Sets the value of tokens.

Source

pub fn set_visual_elements<T, V>(self, v: T) -> Self
where T: IntoIterator<Item = V>, V: Into<VisualElement>,

Sets the value of visual_elements.

Source

pub fn set_tables<T, V>(self, v: T) -> Self
where T: IntoIterator<Item = V>, V: Into<Table>,

Sets the value of tables.

Source

pub fn set_form_fields<T, V>(self, v: T) -> Self
where T: IntoIterator<Item = V>, V: Into<FormField>,

Sets the value of form_fields.

Source

pub fn set_symbols<T, V>(self, v: T) -> Self
where T: IntoIterator<Item = V>, V: Into<Symbol>,

Sets the value of symbols.

Source

pub fn set_detected_barcodes<T, V>(self, v: T) -> Self
where T: IntoIterator<Item = V>, V: Into<DetectedBarcode>,

Sets the value of detected_barcodes.

Source

pub fn set_image_quality_scores<T>(self, v: T) -> Self

Sets the value of image_quality_scores.

Source

pub fn set_or_clear_image_quality_scores<T>(self, v: Option<T>) -> Self

Sets or clears the value of image_quality_scores.

Source

pub fn set_provenance<T>(self, v: T) -> Self
where T: Into<Provenance>,

👎Deprecated

Sets the value of provenance.

Source

pub fn set_or_clear_provenance<T>(self, v: Option<T>) -> Self
where T: Into<Provenance>,

👎Deprecated

Sets or clears the value of provenance.

Trait Implementations§

Source§

impl Clone for Page

Source§

fn clone(&self) -> Page

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 Page

Source§

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

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

impl Default for Page

Source§

fn default() -> Page

Returns the “default value” for a type. Read more
Source§

impl Message for Page

Source§

fn typename() -> &'static str

The typename of this message.
Source§

impl PartialEq for Page

Source§

fn eq(&self, other: &Page) -> 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 Page

Auto Trait Implementations§

§

impl !Freeze for Page

§

impl RefUnwindSafe for Page

§

impl Send for Page

§

impl Sync for Page

§

impl Unpin for Page

§

impl UnwindSafe for Page

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> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
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, 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.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,