pub struct SmtpEhloResponse<'a> {
pub domain: SmtpDomain<'a>,
pub greet: Option<SmtpText<'a>>,
pub capabilities: Vec<Cow<'a, str>>,
}Expand description
EHLO response containing server capabilities.
Each capability is stored as a raw string exactly as advertised by
the server (e.g. "AUTH PLAIN LOGIN", "SIZE 10485760",
"STARTTLS"). Individual RFC modules are responsible for parsing
the parameters of their own capability.
Fields§
§domain: SmtpDomain<'a>The server’s domain name.
greet: Option<SmtpText<'a>>Optional greeting text on the first line.
capabilities: Vec<Cow<'a, str>>Server capabilities as raw keyword strings.
Implementations§
Source§impl SmtpEhloResponse<'_>
impl SmtpEhloResponse<'_>
Sourcepub fn is_complete(buf: &[u8]) -> bool
pub fn is_complete(buf: &[u8]) -> bool
Returns true if buf contains a complete EHLO response.
Sourcepub fn parse<'a>(
buf: &'a [u8],
) -> Result<SmtpEhloResponse<'a>, Vec<Rich<'a, u8>>>
pub fn parse<'a>( buf: &'a [u8], ) -> Result<SmtpEhloResponse<'a>, Vec<Rich<'a, u8>>>
Parses an EHLO response from raw bytes.
Sourcepub fn has_capability(&self, keyword: &str) -> bool
pub fn has_capability(&self, keyword: &str) -> bool
Returns true if the server advertised the given capability keyword.
The comparison is case-insensitive and matches only the keyword part
(e.g. "AUTH" matches "AUTH PLAIN LOGIN").
Sourcepub fn get_capability(&self, keyword: &str) -> Option<&str>
pub fn get_capability(&self, keyword: &str) -> Option<&str>
Returns the full capability line for the given keyword, if advertised.
The returned string is the raw line including the keyword and
any parameters (e.g. "AUTH PLAIN LOGIN", "SIZE 52428800").
Parse capability-specific values with str::parse::<T>()
using the type from the relevant RFC module.
The keyword comparison is case-insensitive.
Trait Implementations§
Source§impl<'a> Clone for SmtpEhloResponse<'a>
impl<'a> Clone for SmtpEhloResponse<'a>
Source§fn clone(&self) -> SmtpEhloResponse<'a>
fn clone(&self) -> SmtpEhloResponse<'a>
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl<'a> Debug for SmtpEhloResponse<'a>
impl<'a> Debug for SmtpEhloResponse<'a>
impl<'a> Eq for SmtpEhloResponse<'a>
Source§impl<'a> Hash for SmtpEhloResponse<'a>
impl<'a> Hash for SmtpEhloResponse<'a>
Source§impl<'a> IntoBoundedStatic for SmtpEhloResponse<'a>
impl<'a> IntoBoundedStatic for SmtpEhloResponse<'a>
Source§type Static = SmtpEhloResponse<'static>
type Static = SmtpEhloResponse<'static>
'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<'a> PartialEq for SmtpEhloResponse<'a>
impl<'a> PartialEq for SmtpEhloResponse<'a>
impl<'a> StructuralPartialEq for SmtpEhloResponse<'a>
Source§impl<'a> ToBoundedStatic for SmtpEhloResponse<'a>
impl<'a> ToBoundedStatic for SmtpEhloResponse<'a>
Auto Trait Implementations§
impl<'a> Freeze for SmtpEhloResponse<'a>
impl<'a> RefUnwindSafe for SmtpEhloResponse<'a>
impl<'a> Send for SmtpEhloResponse<'a>
impl<'a> Sync for SmtpEhloResponse<'a>
impl<'a> Unpin for SmtpEhloResponse<'a>
impl<'a> UnsafeUnpin for SmtpEhloResponse<'a>
impl<'a> UnwindSafe for SmtpEhloResponse<'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
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
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.