millionsend 0.4.0

Official Rust SDK for MillionSend — a self-hostable, Resend-compatible email API.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
use std::sync::Arc;

use crate::error::Result;
use crate::http::Config;
use crate::types::UsageReport;

/// Plan limits and today's send count (MillionSend extension).
#[derive(Clone)]
pub struct Usage(pub(crate) Arc<Config>);

impl Usage {
    /// `GET /usage`
    pub async fn get(&self) -> Result<UsageReport> {
        self.0.get(&["usage"], &[]).await
    }
}