Skip to main content

EnhancedStatus

Struct EnhancedStatus 

Source
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:

  • class is one of 2, 4, or 5 (success / persistent transient / permanent).
  • subject and detail are 0–999.

Fields§

§class: u8

Leading class digit (2, 4, or 5).

§subject: u16

Second field: the broad subject category (e.g. 1 = address, 7 = security/policy).

§detail: u16

Third field: the specific detail within the subject.

Implementations§

Source§

impl EnhancedStatus

Source

pub fn to_dotted(&self) -> String

Format as class.subject.detail. This is the wire form RFC 3463 uses, with the leading dot-decimal and no padding.

Trait Implementations§

Source§

impl Clone for EnhancedStatus

Source§

fn clone(&self) -> EnhancedStatus

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for EnhancedStatus

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Display for EnhancedStatus

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Hash for EnhancedStatus

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl PartialEq for EnhancedStatus

Source§

fn eq(&self, other: &EnhancedStatus) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Copy for EnhancedStatus

Source§

impl Eq for EnhancedStatus

Source§

impl StructuralPartialEq for EnhancedStatus

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.