pub struct GoogleVisionBackend { /* private fields */ }Expand description
Blocking HTTP OCR backend for Google Cloud Vision.
Authentication supports:
- API key via
GoogleVisionBackend::from_api_key - Service-account JSON via
GoogleVisionBackend::from_service_account - Auto-detection via
GoogleVisionBackend::from_env
Implementations§
Source§impl GoogleVisionBackend
impl GoogleVisionBackend
Sourcepub fn from_api_key(key: &str) -> Self
pub fn from_api_key(key: &str) -> Self
Create a backend from an API key.
Sourcepub fn from_service_account(json_path: &str) -> Result<Self, OcrError>
pub fn from_service_account(json_path: &str) -> Result<Self, OcrError>
Create a backend from a service-account JSON file.
The credentials are loaded eagerly and an OAuth access token is minted on demand using the service-account private key.
Trait Implementations§
Source§impl OcrBackend for GoogleVisionBackend
Available on crate feature ocr-google only.
impl OcrBackend for GoogleVisionBackend
Available on crate feature
ocr-google only.Auto Trait Implementations§
impl Freeze for GoogleVisionBackend
impl !RefUnwindSafe for GoogleVisionBackend
impl Send for GoogleVisionBackend
impl Sync for GoogleVisionBackend
impl Unpin for GoogleVisionBackend
impl UnsafeUnpin for GoogleVisionBackend
impl !UnwindSafe for GoogleVisionBackend
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> 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>
Converts
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>
Converts
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