pub struct OcrDocument {
pub engine: OcrEngine,
pub target_kind: OcrTargetKind,
pub full_text: String,
pub blocks: Vec<OcrTextBlock>,
pub extracted_at: DateTime<Utc>,
pub provenance: SourceProvenance,
}Expand description
OCR extraction result.
Fields§
§engine: OcrEngineOCR backend used to produce this result.
target_kind: OcrTargetKindThe source target kind.
full_text: StringFull-text result if the backend produced one directly.
blocks: Vec<OcrTextBlock>Structured OCR blocks.
extracted_at: DateTime<Utc>Extraction timestamp.
provenance: SourceProvenanceShared provenance for the source image.
Implementations§
Source§impl OcrDocument
impl OcrDocument
Sourcepub fn new(
engine: OcrEngine,
target_kind: OcrTargetKind,
provenance: SourceProvenance,
) -> Self
pub fn new( engine: OcrEngine, target_kind: OcrTargetKind, provenance: SourceProvenance, ) -> Self
Create an empty OCR document for incremental population.
Sourcepub fn effective_text(&self) -> String
pub fn effective_text(&self) -> String
Returns the best available text for indexing.
Uses full_text when present, otherwise concatenates non-empty blocks.
Sourcepub fn filtered_text(&self, min_confidence: f32) -> String
pub fn filtered_text(&self, min_confidence: f32) -> String
Returns text from blocks whose confidence meets the threshold.
Trait Implementations§
Source§impl Clone for OcrDocument
impl Clone for OcrDocument
Source§fn clone(&self) -> OcrDocument
fn clone(&self) -> OcrDocument
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for OcrDocument
impl Debug for OcrDocument
Source§impl<'de> Deserialize<'de> for OcrDocument
impl<'de> Deserialize<'de> for OcrDocument
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for OcrDocument
impl RefUnwindSafe for OcrDocument
impl Send for OcrDocument
impl Sync for OcrDocument
impl Unpin for OcrDocument
impl UnsafeUnpin for OcrDocument
impl UnwindSafe for OcrDocument
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request