Rust

transport

Module

Bytes to and from the server.

Line assembly and the reply grammar live in the crate::Client, so a transport moves bytes and nothing else, and a scripted double is all a test needs.

Contents

use utopia_smtp::TcpTransport;
Rust
pub struct TcpTransport

TCP on tokio, with TLS by rustls.

Rust
use utopia_smtp::{Client, Encryption, TcpTransport, Tls};

let transport = TcpTransport::new("smtp.example.test", 587, Tls::default());
let mut client = Client::new(transport).with_encryption(Encryption::StartTls);
client.noop().await?;
Compiles in CI; needs a running service to execute.
use utopia_smtp::Transport;
Rust
pub trait Transport: Send

Bytes to and from the server. Implement it to carry SMTP over something other than TcpTransport (a proxy, a test double).

Implemented byTcpTransport