pub struct OcrRequest {
pub key: String,
pub body: OcrBody,
/* private fields */
}Expand description
OCR recognition request (multipart/form-data)
Fields§
§key: String§body: OcrBodyImplementations§
Source§impl OcrRequest
impl OcrRequest
pub fn new(key: String) -> Self
pub fn with_file_path(self, path: impl Into<String>) -> Self
pub fn with_tool_type(self, tool_type: OcrToolType) -> Self
pub fn with_language_type(self, language_type: OcrLanguageType) -> Self
pub fn with_probability(self, probability: bool) -> Self
pub fn with_request_id(self, request_id: impl Into<String>) -> Self
pub fn with_user_id(self, user_id: impl Into<String>) -> Self
pub fn validate(&self) -> ZaiResult<()>
pub async fn send(&self) -> ZaiResult<OcrResponse>
Trait Implementations§
Source§impl HttpClient for OcrRequest
impl HttpClient for OcrRequest
type Body = OcrBody
type ApiUrl = &'static str
type ApiKey = String
fn api_url(&self) -> &Self::ApiUrl
fn api_key(&self) -> &Self::ApiKey
fn body(&self) -> &Self::Body
Source§fn post(&self) -> impl Future<Output = ZaiResult<Response>> + Send
fn post(&self) -> impl Future<Output = ZaiResult<Response>> + Send
Sends a POST request to the API endpoint. Read more
Source§fn http_config(&self) -> Arc<HttpClientConfig>
fn http_config(&self) -> Arc<HttpClientConfig>
Get HTTP client configuration for this request Read more
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