#[non_exhaustive]pub struct ExtractedText {
pub text: String,
pub fragments: Vec<TextFragment>,
pub truncated: bool,
}Expand description
Extracted text with position information.
Pipeline output: returned by the extract_text* entry points on
Page / PdfDocument.
#[non_exhaustive] so future fields (e.g. per-run diagnostics) can be added
without a breaking change — construct one outside the crate via
ExtractedText::new.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.text: StringThe extracted text content
fragments: Vec<TextFragment>Text fragments with position information (if preserve_layout is true)
truncated: booltrue when extraction stopped early because
ExtractionOptions::max_extracted_bytes was reached, so text is a
bounded prefix of the page’s full text rather than the whole page
(issue #382). Always false when no limit is set.
Implementations§
Source§impl ExtractedText
impl ExtractedText
Sourcepub fn new(text: String, fragments: Vec<TextFragment>) -> Self
pub fn new(text: String, fragments: Vec<TextFragment>) -> Self
Build an ExtractedText from its text and fragments, with truncated
set to false. Provided because ExtractedText is #[non_exhaustive],
so external callers cannot use a struct literal. Set truncated
afterwards if you are synthesizing a bounded result.
Trait Implementations§
Source§impl Clone for ExtractedText
impl Clone for ExtractedText
Source§fn clone(&self) -> ExtractedText
fn clone(&self) -> ExtractedText
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more