pub struct SmtpResponse<'a> {
pub code: SmtpReplyCode,
pub lines: SmtpVec1<SmtpText<'a>>,
}Expand description
A complete SMTP response (possibly multi-line).
Fields§
§code: SmtpReplyCodeThe 3-digit reply code
lines: SmtpVec1<SmtpText<'a>>One or more response lines
Implementations§
Source§impl SmtpResponse<'_>
impl SmtpResponse<'_>
Sourcepub fn is_complete(buf: &[u8]) -> bool
pub fn is_complete(buf: &[u8]) -> bool
Returns true if buf contains a complete SMTP response.
A response is complete when the last CRLF-terminated line has
ddd SP (not ddd -).
Sourcepub fn parse<'a>(buf: &'a [u8]) -> Result<SmtpResponse<'a>, Vec<Rich<'a, u8>>>
pub fn parse<'a>(buf: &'a [u8]) -> Result<SmtpResponse<'a>, Vec<Rich<'a, u8>>>
Parses a response from raw bytes.
Sourcepub fn new<'a>(code: SmtpReplyCode, text: SmtpText<'a>) -> SmtpResponse<'a>
pub fn new<'a>(code: SmtpReplyCode, text: SmtpText<'a>) -> SmtpResponse<'a>
Creates a new single-line response.
Sourcepub fn new_multiline<'a>(
code: SmtpReplyCode,
lines: SmtpVec1<SmtpText<'a>>,
) -> SmtpResponse<'a>
pub fn new_multiline<'a>( code: SmtpReplyCode, lines: SmtpVec1<SmtpText<'a>>, ) -> SmtpResponse<'a>
Creates a new multi-line response.
Sourcepub fn is_success(&self) -> bool
pub fn is_success(&self) -> bool
Returns true if this is a success response.
Trait Implementations§
Source§impl<'a> Clone for SmtpResponse<'a>
impl<'a> Clone for SmtpResponse<'a>
Source§fn clone(&self) -> SmtpResponse<'a>
fn clone(&self) -> SmtpResponse<'a>
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<'a> Debug for SmtpResponse<'a>
impl<'a> Debug for SmtpResponse<'a>
impl<'a> Eq for SmtpResponse<'a>
Source§impl<'a> Hash for SmtpResponse<'a>
impl<'a> Hash for SmtpResponse<'a>
Source§impl<'a> IntoBoundedStatic for SmtpResponse<'a>
impl<'a> IntoBoundedStatic for SmtpResponse<'a>
Source§type Static = SmtpResponse<'static>
type Static = SmtpResponse<'static>
The target type is bounded by the
'static lifetime.Source§fn into_static(self) -> Self::Static
fn into_static(self) -> Self::Static
Convert an owned
T into an owned T such that T: 'static.Source§impl<'a> PartialEq for SmtpResponse<'a>
impl<'a> PartialEq for SmtpResponse<'a>
impl<'a> StructuralPartialEq for SmtpResponse<'a>
Source§impl<'a> ToBoundedStatic for SmtpResponse<'a>
impl<'a> ToBoundedStatic for SmtpResponse<'a>
Auto Trait Implementations§
impl<'a> Freeze for SmtpResponse<'a>
impl<'a> RefUnwindSafe for SmtpResponse<'a>
impl<'a> Send for SmtpResponse<'a>
impl<'a> Sync for SmtpResponse<'a>
impl<'a> Unpin for SmtpResponse<'a>
impl<'a> UnsafeUnpin for SmtpResponse<'a>
impl<'a> UnwindSafe for SmtpResponse<'a>
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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
Compare self to
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
Invokes
WrappingSpan::make_wrapped to wrap an AST node in a span.