1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
//! # SmallPict Rust SDK
//!
//! Official Rust client library for the [SmallPict Image Optimization API](https://smallpict.app) —
//! next-gen image transcoding (AVIF, WebP), smart compression, Edge CDN delivery, and cache purging.
//!
//! ## Quick Start (Async)
//!
//! ```no_run
//! use smallpict::{Client, ImageFormat, OptimizeOptions};
//!
//! #[tokio::main]
//! async fn main() -> Result<(), Box<dyn std::error::Error>> {
//! let client = Client::builder()
//! .api_key(std::env::var("SMALLPICT_API_KEY")?)
//! .secret_key(std::env::var("SMALLPICT_SECRET_KEY")?)
//! .build()?;
//! let image_data = std::fs::read("hero.png")?;
//!
//! let options = OptimizeOptions::builder()
//! .format(ImageFormat::Avif)
//! .quality(80)
//! .max_width(1920)
//! .build();
//!
//! let result = client.optimize(&image_data, Some(options)).await?;
//! println!("CDN URL: {}", result.url);
//! println!("Saved: {:.2}% ({} bytes)", result.savings_percentage, result.bytes_saved);
//! Ok(())
//! }
//! ```
//!
//! ## Quick Start (Blocking)
//!
//! Enable the `blocking` feature in `Cargo.toml`:
//! ```toml
//! [dependencies]
//! smallpict = { version = "0.1", features = ["blocking"] }
//! ```
//!
//! ```no_run
//! #[cfg(feature = "blocking")]
//! {
//! use smallpict::blocking::BlockingClient;
//! use smallpict::models::{ImageFormat, OptimizeOptions};
//!
//! let client = BlockingClient::builder()
//! .api_key(std::env::var("SMALLPICT_API_KEY")?)
//! .secret_key(std::env::var("SMALLPICT_SECRET_KEY")?)
//! .build()?;
//! let image_data = std::fs::read("hero.png")?;
//! let result = client.optimize(&image_data, None)?;
//! println!("CDN URL: {}", result.url);
//! }
//! # Ok::<(), Box<dyn std::error::Error>>(())
//! ```
pub
pub
// Re-exports for convenient top-level usage
pub use ;
pub use ;
pub use ;
pub use ;