pub struct EnhancedStatus {
pub class: u8,
pub subject: u16,
pub detail: u16,
}Expand description
An enhanced status code from RFC 3463, parsed out of an SMTP reply
when the server has advertised the ENHANCEDSTATUSCODES extension
(RFC 2034).
Enhanced codes are formatted class.subject.detail, for example
5.7.1 (relay access denied) or 4.7.0 (security feature
temporarily unavailable). The basic three-digit reply code (e.g.
550) and the enhanced code share the leading digit (the
“class”); the remaining two fields refine the diagnosis far
beyond what the basic code carries.
This type is preserved across the Reply on which it is parsed,
and reproduced in crate::ProtocolError::UnexpectedCode when an
unexpected reply triggers an error. Callers can use the structured
fields to make routing decisions (“if subject is 5.1.* the address
is permanently bad; if 4.x.x retry later”).
Per RFC 3463 §2:
classis one of 2, 4, or 5 (success / persistent transient / permanent).subjectanddetailare 0–999.
Fields§
§class: u8Leading class digit (2, 4, or 5).
subject: u16Second field: the broad subject category (e.g. 1 = address,
7 = security/policy).
detail: u16Third field: the specific detail within the subject.
Implementations§
Trait Implementations§
Source§impl Clone for EnhancedStatus
impl Clone for EnhancedStatus
Source§fn clone(&self) -> EnhancedStatus
fn clone(&self) -> EnhancedStatus
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for EnhancedStatus
impl Debug for EnhancedStatus
Source§impl Display for EnhancedStatus
impl Display for EnhancedStatus
Source§impl Hash for EnhancedStatus
impl Hash for EnhancedStatus
Source§impl PartialEq for EnhancedStatus
impl PartialEq for EnhancedStatus
Source§fn eq(&self, other: &EnhancedStatus) -> bool
fn eq(&self, other: &EnhancedStatus) -> bool
self and other values to be equal, and is used by ==.