Lob (Rust)
A small, async Rust client for the Lob API, built on top of reqwest with a type-safe builder API.
This library is intentionally minimal and focuses on:
- Explicit client construction
- A fluent postcard request builder
- Strongly typed error handling
Sending A Postcard
use LobClient;
use Serialize;
let client = new;
let lob_client = builder
.client
.api_key
.build;
const CASE_NUMBER: &str = "JP01-25-E01";
const FRONT_HTML: &str = r#"
<html>
<head>
<style>
p {
padding: 20px;
}
</style>
</head>
<body>
<p>Hello {{case_number}}!</p>
</body>
</html>
"#;
const BACK_HTML: &str = r#"
<html>
<head>
<style>
p {
padding: 20px;
}
</style>
</head>
<body>
<p>Back Side: {{case_number}}!</p>
</body>
</html>
"#;
let response = lob_client
.create_postcard
.idempotency_key
.name
.address_line_1
.address_line_2
.city
.state
.zip_code
.front
.back
.use_type
.size
.mail_type
.description
.merge
.send
.await
.unwrap;
println!;