pub struct ImageOcrRequest {
pub path: PathBuf,
pub target_kind: OcrTargetKind,
pub provenance: SourceProvenance,
pub language_hints: Vec<String>,
pub min_confidence: Option<f32>,
pub metadata: HashMap<String, String>,
}Expand description
Request passed to OCR backends.
Fields§
§path: PathBufPath to the source image file.
target_kind: OcrTargetKindHigh-level target kind for backend tuning.
provenance: SourceProvenanceShared provenance metadata for this image.
language_hints: Vec<String>Language hints (e.g., en, de) to improve OCR.
min_confidence: Option<f32>Optional minimum confidence filter hint.
metadata: HashMap<String, String>Source-specific request metadata.
Implementations§
Source§impl ImageOcrRequest
impl ImageOcrRequest
Sourcepub fn new(
path: impl Into<PathBuf>,
target_kind: OcrTargetKind,
provenance: SourceProvenance,
) -> Self
pub fn new( path: impl Into<PathBuf>, target_kind: OcrTargetKind, provenance: SourceProvenance, ) -> Self
Create a new OCR request.
Sourcepub fn with_language_hint(self, language: impl Into<String>) -> Self
pub fn with_language_hint(self, language: impl Into<String>) -> Self
Add a language hint.
Sourcepub fn with_min_confidence(self, min_confidence: f32) -> Self
pub fn with_min_confidence(self, min_confidence: f32) -> Self
Set a minimum confidence hint.
Trait Implementations§
Source§impl Clone for ImageOcrRequest
impl Clone for ImageOcrRequest
Source§fn clone(&self) -> ImageOcrRequest
fn clone(&self) -> ImageOcrRequest
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 ImageOcrRequest
impl Debug for ImageOcrRequest
Source§impl<'de> Deserialize<'de> for ImageOcrRequest
impl<'de> Deserialize<'de> for ImageOcrRequest
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 ImageOcrRequest
impl RefUnwindSafe for ImageOcrRequest
impl Send for ImageOcrRequest
impl Sync for ImageOcrRequest
impl Unpin for ImageOcrRequest
impl UnsafeUnpin for ImageOcrRequest
impl UnwindSafe for ImageOcrRequest
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