pub struct SmtpReplyCode {
pub class: u8,
pub subject: u8,
pub detail: u8,
}Expand description
A 3-digit SMTP reply code.
Each digit carries independent meaning: class (1st digit) signals the
broad outcome, subject (2nd digit) and detail (3rd digit) refine it.
Fields§
§class: u8First digit: 2 (positive completion), 3 (positive intermediate), 4 (transient negative), or 5 (permanent negative).
subject: u8Second digit: 0–9.
detail: u8Third digit: 0–9.
Implementations§
Source§impl SmtpReplyCode
impl SmtpReplyCode
Sourcepub const SYSTEM_STATUS: Self
pub const SYSTEM_STATUS: Self
211 System status
Sourcepub const HELP_MESSAGE: Self
pub const HELP_MESSAGE: Self
214 Help message
Sourcepub const SERVICE_READY: Self
pub const SERVICE_READY: Self
220 Service ready
Sourcepub const SERVICE_CLOSING: Self
pub const SERVICE_CLOSING: Self
221 Service closing transmission channel
Sourcepub const AUTH_SUCCESSFUL: Self
pub const AUTH_SUCCESSFUL: Self
235 Authentication successful (RFC 4954)
Sourcepub const USER_NOT_LOCAL_WILL_FORWARD: Self
pub const USER_NOT_LOCAL_WILL_FORWARD: Self
251 User not local; will forward
Sourcepub const CANNOT_VRFY_USER: Self
pub const CANNOT_VRFY_USER: Self
252 Cannot VRFY user, but will accept message
Sourcepub const AUTH_CONTINUE: Self
pub const AUTH_CONTINUE: Self
334 Server challenge (AUTH continuation)
Sourcepub const START_MAIL_INPUT: Self
pub const START_MAIL_INPUT: Self
354 Start mail input
Sourcepub const SERVICE_NOT_AVAILABLE: Self
pub const SERVICE_NOT_AVAILABLE: Self
421 Service not available, closing transmission channel
Sourcepub const MAILBOX_UNAVAILABLE_TEMP: Self
pub const MAILBOX_UNAVAILABLE_TEMP: Self
450 Requested mail action not taken: mailbox unavailable
Sourcepub const LOCAL_ERROR: Self
pub const LOCAL_ERROR: Self
451 Requested action aborted: local error in processing
Sourcepub const INSUFFICIENT_STORAGE: Self
pub const INSUFFICIENT_STORAGE: Self
452 Requested action not taken: insufficient system storage
Sourcepub const UNABLE_TO_ACCOMMODATE: Self
pub const UNABLE_TO_ACCOMMODATE: Self
455 Server unable to accommodate parameters
Sourcepub const SYNTAX_ERROR: Self
pub const SYNTAX_ERROR: Self
500 Syntax error, command unrecognized
Sourcepub const SYNTAX_ERROR_PARAMS: Self
pub const SYNTAX_ERROR_PARAMS: Self
501 Syntax error in parameters or arguments
Sourcepub const COMMAND_NOT_IMPLEMENTED: Self
pub const COMMAND_NOT_IMPLEMENTED: Self
502 Command not implemented
Sourcepub const BAD_SEQUENCE: Self
pub const BAD_SEQUENCE: Self
503 Bad sequence of commands
Sourcepub const PARAM_NOT_IMPLEMENTED: Self
pub const PARAM_NOT_IMPLEMENTED: Self
504 Command parameter not implemented
Sourcepub const AUTH_REQUIRED: Self
pub const AUTH_REQUIRED: Self
530 Authentication required (RFC 4954)
Sourcepub const AUTH_TOO_WEAK: Self
pub const AUTH_TOO_WEAK: Self
534 Authentication mechanism is too weak (RFC 4954)
Sourcepub const AUTH_INVALID: Self
pub const AUTH_INVALID: Self
535 Authentication credentials invalid (RFC 4954)
Sourcepub const MAILBOX_UNAVAILABLE: Self
pub const MAILBOX_UNAVAILABLE: Self
550 Requested action not taken: mailbox unavailable
Sourcepub const USER_NOT_LOCAL: Self
pub const USER_NOT_LOCAL: Self
551 User not local; please try forwarding
Sourcepub const EXCEEDED_STORAGE: Self
pub const EXCEEDED_STORAGE: Self
552 Requested mail action aborted: exceeded storage allocation
Sourcepub const MAILBOX_NAME_NOT_ALLOWED: Self
pub const MAILBOX_NAME_NOT_ALLOWED: Self
553 Requested action not taken: mailbox name not allowed
Sourcepub const TRANSACTION_FAILED: Self
pub const TRANSACTION_FAILED: Self
554 Transaction failed
Sourcepub const PARAMS_NOT_RECOGNIZED: Self
pub const PARAMS_NOT_RECOGNIZED: Self
555 MAIL FROM/RCPT TO parameters not recognized or not implemented
Sourcepub fn parse<'a>(bytes: &'a [u8]) -> Result<SmtpReplyCode, Vec<Rich<'a, u8>>>
pub fn parse<'a>(bytes: &'a [u8]) -> Result<SmtpReplyCode, Vec<Rich<'a, u8>>>
Parses a reply code from raw bytes, consuming the whole input.
Sourcepub fn is_positive_completion(&self) -> bool
pub fn is_positive_completion(&self) -> bool
Returns true if this is a positive completion reply (2xx).
Sourcepub fn is_positive_intermediate(&self) -> bool
pub fn is_positive_intermediate(&self) -> bool
Returns true if this is a positive intermediate reply (3xx).
Sourcepub fn is_transient_negative(&self) -> bool
pub fn is_transient_negative(&self) -> bool
Returns true if this is a transient negative reply (4xx).
Sourcepub fn is_permanent_negative(&self) -> bool
pub fn is_permanent_negative(&self) -> bool
Returns true if this is a permanent negative reply (5xx).
Sourcepub fn is_success(&self) -> bool
pub fn is_success(&self) -> bool
Returns true if this is a success reply (2xx or 3xx).
Trait Implementations§
Source§impl Clone for SmtpReplyCode
impl Clone for SmtpReplyCode
Source§fn clone(&self) -> SmtpReplyCode
fn clone(&self) -> SmtpReplyCode
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for SmtpReplyCode
Source§impl Debug for SmtpReplyCode
impl Debug for SmtpReplyCode
Source§impl Display for SmtpReplyCode
impl Display for SmtpReplyCode
impl Eq for SmtpReplyCode
Source§impl Hash for SmtpReplyCode
impl Hash for SmtpReplyCode
Source§impl IntoBoundedStatic for SmtpReplyCode
impl IntoBoundedStatic for SmtpReplyCode
Source§type Static = SmtpReplyCode
type Static = SmtpReplyCode
'static lifetime.Source§fn into_static(self) -> Self::Static
fn into_static(self) -> Self::Static
T into an owned T such that T: 'static.Source§impl Ord for SmtpReplyCode
impl Ord for SmtpReplyCode
Source§fn cmp(&self, other: &SmtpReplyCode) -> Ordering
fn cmp(&self, other: &SmtpReplyCode) -> Ordering
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl PartialEq for SmtpReplyCode
impl PartialEq for SmtpReplyCode
Source§impl PartialOrd for SmtpReplyCode
impl PartialOrd for SmtpReplyCode
impl StructuralPartialEq for SmtpReplyCode
Source§impl ToBoundedStatic for SmtpReplyCode
impl ToBoundedStatic for SmtpReplyCode
Auto Trait Implementations§
impl Freeze for SmtpReplyCode
impl RefUnwindSafe for SmtpReplyCode
impl Send for SmtpReplyCode
impl Sync for SmtpReplyCode
impl Unpin for SmtpReplyCode
impl UnsafeUnpin for SmtpReplyCode
impl UnwindSafe for SmtpReplyCode
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.impl<T> OrderedSeq<'_, T> for Twhere
T: Clone,
Source§impl<'p, T> Seq<'p, T> for Twhere
T: Clone,
impl<'p, T> Seq<'p, T> for Twhere
T: Clone,
Source§impl<T, S> SpanWrap<S> for Twhere
S: WrappingSpan<T>,
impl<T, S> SpanWrap<S> for Twhere
S: WrappingSpan<T>,
Source§fn with_span(self, span: S) -> <S as WrappingSpan<Self>>::Spanned
fn with_span(self, span: S) -> <S as WrappingSpan<Self>>::Spanned
WrappingSpan::make_wrapped to wrap an AST node in a span.