pub struct FixtureOcrBackend { /* private fields */ }Expand description
Fixture-driven OCR backend for tests and local scaffolding.
This backend returns pre-registered OCR results keyed by exact file path, file name, or file stem (in that order). It is intended for ingestion pipeline development when native OCR runtimes are unavailable.
Implementations§
Source§impl FixtureOcrBackend
impl FixtureOcrBackend
Sourcepub fn with_engine(engine: OcrEngine) -> Self
pub fn with_engine(engine: OcrEngine) -> Self
Create an empty fixture backend with a custom engine label.
Sourcepub fn with_document(
self,
key: impl Into<String>,
document: OcrDocument,
) -> Self
pub fn with_document( self, key: impl Into<String>, document: OcrDocument, ) -> Self
Register a fixture document for a given path-like lookup key.
The key can be:
- exact path string
- file name (e.g.,
Screenshot.png) - file stem (e.g.,
Screenshot)
Sourcepub fn with_default_document(self, document: OcrDocument) -> Self
pub fn with_default_document(self, document: OcrDocument) -> Self
Register a default fixture returned when no key-specific fixture exists.
Trait Implementations§
Source§impl Clone for FixtureOcrBackend
impl Clone for FixtureOcrBackend
Source§fn clone(&self) -> FixtureOcrBackend
fn clone(&self) -> FixtureOcrBackend
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 FixtureOcrBackend
impl Debug for FixtureOcrBackend
Source§impl Default for FixtureOcrBackend
impl Default for FixtureOcrBackend
Source§impl OcrBackend for FixtureOcrBackend
impl OcrBackend for FixtureOcrBackend
Source§fn extract<'life0, 'life1, 'async_trait>(
&'life0 self,
request: &'life1 ImageOcrRequest,
) -> Pin<Box<dyn Future<Output = Result<OcrDocument>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn extract<'life0, 'life1, 'async_trait>(
&'life0 self,
request: &'life1 ImageOcrRequest,
) -> Pin<Box<dyn Future<Output = Result<OcrDocument>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Extract OCR text and block metadata from an image.
Auto Trait Implementations§
impl Freeze for FixtureOcrBackend
impl RefUnwindSafe for FixtureOcrBackend
impl Send for FixtureOcrBackend
impl Sync for FixtureOcrBackend
impl Unpin for FixtureOcrBackend
impl UnsafeUnpin for FixtureOcrBackend
impl UnwindSafe for FixtureOcrBackend
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