pub struct OcrBackendCapabilities {
pub name: String,
pub supported_languages: Vec<String>,
}Expand description
A registered OCR backend’s declared name and language capabilities.
Returned by list_ocr_backend_capabilities. See that function’s documentation for the
determinism guarantees and the important caveat about what an empty supported_languages
means.
Fields§
§name: StringThe backend’s registered name, as returned by list_ocr_backends.
supported_languages: Vec<String>The languages this backend declares support for, via
OcrBackend::supported_languages.
An empty list means the backend does not enumerate its languages — it is not a
statement that the backend supports no languages. OcrBackend::supported_languages
is a defaulted trait method that returns vec![], and not every backend overrides it:
the VLM backend (llm::vlm_ocr::VlmOcrBackend) accepts every language via
supports_language while inheriting the empty default here. Use
ocr_backend_supports_language to decide whether one specific language is usable —
never infer “unsupported” from an empty list.
The order of this list is preserved exactly as the backend reported it and is not
re-sorted. Tesseract’s order comes from enumerating installed tessdata files; PaddleOCR’s
comes from its own SUPPORTED_LANGUAGES constant. Re-sorting would disagree with the
precedence each backend’s own supports_language implementation uses internally.
This is the no-override answer (list_ocr_backend_capabilities). Use
list_ocr_backend_capabilities_for when the caller sets OcrConfig.tessdata_path: for
Tesseract the language list is a property of the resolved tessdata directory, and the
no-override chain can name a different directory than the one a job using that config
will load from. See GH#1857.
Trait Implementations§
Source§impl Clone for OcrBackendCapabilities
impl Clone for OcrBackendCapabilities
Source§impl Debug for OcrBackendCapabilities
impl Debug for OcrBackendCapabilities
Source§impl<'de> Deserialize<'de> for OcrBackendCapabilities
impl<'de> Deserialize<'de> for OcrBackendCapabilities
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>,
impl Eq for OcrBackendCapabilities
Source§impl PartialEq for OcrBackendCapabilities
impl PartialEq for OcrBackendCapabilities
Source§impl Serialize for OcrBackendCapabilities
impl Serialize for OcrBackendCapabilities
impl StructuralPartialEq for OcrBackendCapabilities
Auto Trait Implementations§
impl Freeze for OcrBackendCapabilities
impl RefUnwindSafe for OcrBackendCapabilities
impl Send for OcrBackendCapabilities
impl Sync for OcrBackendCapabilities
impl Unpin for OcrBackendCapabilities
impl UnsafeUnpin for OcrBackendCapabilities
impl UnwindSafe for OcrBackendCapabilities
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.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> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more