1 unstable release
0.1.0 | Jan 8, 2023 |
---|
#251 in Email
11KB
129 lines
TempMail.lol Rust API
Crate API wrapper for TempMail.lol service.
Installation
Install from crates.io. Add the following line to your Cargo.toml file's dependencies section:
[dependencies]
tempmail-lol = "0.1"
Usage
Library support async and sync functions.
Sync
fn main() -> Result<(), tempmail_lol::TempMailError> {
let inbox = tempmail_lol::create_inbox()?;
println!("Got random inbox: {:?}", inbox);
}
Async
For async functions you need to use async
feature flag:
[dependencies]
tempmail-lol = { version = "0.1", features = ["async"] }
And then use any async runtime:
#[tokio::main]
async fn main() -> Result<(), tempmail_lol::TempMailError> {
let inbox = tempmail_lol::create_inbox_async().await?;
println!("Got random inbox: {:?}", inbox);
}
More examples you can find in examples
folder.
Dependencies
~4–17MB
~225K SLoC