Rust

reply

Module

Server replies and the class each belongs to.

Contents

use utopia_smtp::Reply;
Rust
pub struct Reply

One server response: a three digit code, the text of each line, and the enhanced status code of RFC 3463 when the server sends one.

Rust
use utopia_smtp::{Outcome, Reply};

let reply = Reply::new(250, ["2.1.5 Recipient ok"])?;
assert_eq!(reply.status(), Some("2.1.5"));
assert_eq!(reply.outcome(), Outcome::Success);
assert_eq!(reply.to_string(), "250 2.1.5 Recipient ok");
Also implements Display.
use utopia_smtp::Outcome;
Rust
pub enum Outcome

The four reply classes of RFC 5321 section 4.2.1. A reply is exactly one of these, and 3yz is not a failure.