Skip to main content

Crate temp_mail_org

Crate temp_mail_org 

Source
Expand description

A Rust client for creating disposable mailboxes with temp-mail.org.

The crate exposes a small, borrowed API centered around Client, Mailbox, and Message. Typical usage is:

  1. Create a Client.
  2. Create a disposable Mailbox.
  3. Poll Mailbox::list_messages for MessagePreview values.
  4. Convert a preview into a full Message with MessagePreview::to_message.
  5. Get the attachments of a message with Message::get_attachment.

§Example

use temp_mail_org::{Client, Error};

let client = Client::new();
let mailbox = client.create_mailbox().await?;
println!("Mailbox: {}", mailbox.address());

let message = mailbox.list_messages(None)
    .await?
    .into_iter()
    .next()
    .unwrap()
    .to_message()
    .await?;
println!("Received message from {}", message.subject());

Structs§

AttachmentMetadata
Metadata describing a message attachment.
Client
Entry point for the temp-mail.org API.
Mailbox
A disposable mailbox created through Client.
Message
A full message received by a Mailbox.
MessagePreview
A lightweight view of a message returned by Mailbox::list_messages.

Enums§

Error
Errors returned by temp-mail.org API operations.