pub struct OcrRequest {
pub body: OcrBody,
/* private fields */
}Expand description
OCR recognition request encoded as multipart/form-data.
Builder for the OCR endpoint. Set the image via
OcrRequest::with_file_path, then call OcrRequest::send_via.
Fields§
§body: OcrBodyMultipart form fields (tool type, language, …).
Implementations§
Source§impl OcrRequest
impl OcrRequest
Sourcepub fn with_file_path(self, path: impl Into<PathBuf>) -> Self
pub fn with_file_path(self, path: impl Into<PathBuf>) -> Self
Set the local image file path to recognize (required).
Sourcepub fn with_tool_type(self, tool_type: OcrToolType) -> Self
pub fn with_tool_type(self, tool_type: OcrToolType) -> Self
Set the OCR tool type (e.g. handwriting).
Sourcepub fn with_language_type(self, language_type: OcrLanguageType) -> Self
pub fn with_language_type(self, language_type: OcrLanguageType) -> Self
Set the document language.
Sourcepub fn with_probability(self, probability: bool) -> Self
pub fn with_probability(self, probability: bool) -> Self
Whether to return per-character recognition probabilities.
Sourcepub fn with_request_id(self, request_id: impl Into<String>) -> Self
pub fn with_request_id(self, request_id: impl Into<String>) -> Self
Set the client-side request id.
Sourcepub fn with_user_id(self, user_id: impl Into<String>) -> Self
pub fn with_user_id(self, user_id: impl Into<String>) -> Self
Set the end-user id.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for OcrRequest
impl RefUnwindSafe for OcrRequest
impl Send for OcrRequest
impl Sync for OcrRequest
impl Unpin for OcrRequest
impl UnsafeUnpin for OcrRequest
impl UnwindSafe for OcrRequest
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