DocDigitizer Rust SDK
Official Rust SDK for the DocDigitizer document processing API.
v0.1.x is deprecated. Upgrade to v0.2.0+ for the new API endpoint. The previous endpoint (
https://apix.docdigitizer.com/sync) will be removed in a future release.
Installation
Add to your Cargo.toml:
[]
= "0.1"
= { = "1", = ["full"] }
Quick Start
use DocDigitizer;
async
Configuration
use ;
use Duration;
// Option 1: API key only
let dd = new;
// Option 2: With config
let config = new
.base_url
.timeout
.max_retries;
let dd = with_config;
// Option 3: From environment
// DOCDIGITIZER_API_KEY=your-api-key
let dd = from_env?;
Processing Documents
use ;
let dd = new;
// From file path
let result = dd.process.await?;
// From bytes
let bytes = read?;
let result = dd.process_with_options.await?;
// With options
let result = dd.process_with_options.await?;
Error Handling
use ;
let dd = new;
match dd.process.await
Error Variants
| Variant | HTTP Status | Description |
|---|---|---|
Validation |
400 | Invalid request |
Authentication |
401 | Invalid/missing API key |
RateLimit |
429 | Rate limit exceeded |
Server |
500 | Internal server error |
ServiceUnavailable |
503 | Downstream service unavailable |
Timeout |
504 | Processing timeout |
Retryable errors (429, 500, 503, 504) are automatically retried with exponential backoff.
Requirements
- Rust 1.70+
- tokio runtime