| Crates.io | laneful-rs |
| lib.rs | laneful-rs |
| version | 0.1.2 |
| created_at | 2026-01-17 02:25:26.061793+00 |
| updated_at | 2026-01-20 00:06:45.097274+00 |
| description | Rust SDK for Laneful email sending API |
| homepage | https://laneful.com/docs/rust-sdk/ |
| repository | https://github.com/lanefulhq/laneful-rust |
| max_upload_size | |
| id | 2049760 |
| size | 81,134 |
Rust SDK for the Laneful email sending API.
Add to Cargo.toml:
laneful-rs = "0.1"
Async API:
laneful-rs = { version = "0.1", features = ["async"] }
TLS backend (optional; defaults to rustls; use native-tls to switch):
laneful-rs = { version = "0.1", features = ["native-tls"] }
use laneful_rs::{Email, LanefulClient};
let client = LanefulClient::new("https://custom-endpoint.api.laneful.com", "my-api-key")?;
let email = Email::builder()
.from("sender@example.com", Some("Sender"))
.to("recipient@example.com", Some("Recipient"))
.subject("Hello from Laneful!")
.text_content("This is a test email.")
.build()?;
let response = client.send_one(email)?;
println!("Sent: {:?}", response);
Async usage (requires the async feature):
use laneful_rs::{Email, LanefulClient};
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let client = LanefulClient::new("https://custom-endpoint.api.laneful.com", "my-api-key")?;
let email = Email::builder()
.from("sender@example.com", Some("Sender"))
.to("recipient@example.com", Some("Recipient"))
.subject("Hello from Laneful (async)!")
.text_content("This is a test email.")
.build()?;
let response = client.send_one_async(email).await?;
println!("Sent: {:?}", response);
Ok(())
}
Set env vars:
export LANEFUL_ENDPOINT="https://custom-endpoint.api.laneful.com"
export LANEFUL_API_KEY="my-api-key"
Run the async example:
cargo run --example async --features async -- --from sender@example.com --to recipient@example.com
Run the sync example:
cargo run --example sync -- --from sender@example.com --to recipient@example.com
async feature is enabled.rustls by default; use native-tls to switch.