21 releases

new 0.11.3 Apr 28, 2025
0.11.1 Mar 2, 2025
0.11.0 Sep 3, 2024
0.10.2 Jul 29, 2024
0.3.0 Jul 31, 2021

#73 in HTTP client

Download history 1826/week @ 2025-01-08 1070/week @ 2025-01-15 1067/week @ 2025-01-22 1042/week @ 2025-01-29 1110/week @ 2025-02-05 1204/week @ 2025-02-12 2310/week @ 2025-02-19 2223/week @ 2025-02-26 2304/week @ 2025-03-05 2872/week @ 2025-03-12 2898/week @ 2025-03-19 2161/week @ 2025-03-26 2881/week @ 2025-04-02 2921/week @ 2025-04-09 1514/week @ 2025-04-16 1345/week @ 2025-04-23

9,568 downloads per month
Used in 2 crates (via atuin-server)

MIT/Apache

97KB
2K SLoC

Postmark

ci crates.io Documentation License

A rust library to query Postmark API.

Usage

Add the crate dependency to your Cargo.toml:

[dependencies]
postmark = "x.y.z"

And use it, see documentation at: https://docs.rs/postmark.

use postmark::api::email::SendEmailRequest;
use postmark::api::Body;
use postmark::reqwest::PostmarkClient;
use postmark::Query;

async fn send_email(){
  let client = PostmarkClient::builder()
   .server_token("<sometoken>")
   .build();

  let req = SendEmailRequest::builder()
    .from("me@example.com")
    .to("you@example.com")
    .body(Body::text("it's me, Mario!".to_string()))
    .build();
  let resp = req.execute(&client).await;
}

Releasing a new version

Prerequisite:

cargo install cargo-release

On Release:

cargo release --dry-run
# check it does the good thing
cargo release

Thanks

This crate's API design is heavily inspired by the article "Designing Rust bindings for REST APIs by Ben Boeckel.

License

postmark-rs is dual-licensed under either:

at your option.

Dependencies

~4–16MB
~191K SLoC