pub struct SmtpAuthCapability<'a>(/* private fields */);Expand description
The AUTH EHLO capability: the set of SASL mechanisms offered by the server.
Borrows directly from the raw capability line returned by
SmtpEhloResponse::get_capability(AUTH).
§Example
ⓘ
use io_smtp::rfc4954::capability::{AUTH, SmtpAuthCapability};
use io_smtp::rfc4616::plain::PLAIN;
use io_smtp::login::LOGIN;
let cap = SmtpAuthCapability::parse(ehlo.get_capability(AUTH).unwrap()).unwrap();
assert!(cap.has(PLAIN));
assert!(cap.has(LOGIN));Implementations§
Source§impl<'a> SmtpAuthCapability<'a>
impl<'a> SmtpAuthCapability<'a>
Sourcepub fn parse(s: &'a str) -> Result<Self, SmtpAuthCapabilityError>
pub fn parse(s: &'a str) -> Result<Self, SmtpAuthCapabilityError>
Parses the raw AUTH capability line (e.g. "AUTH PLAIN LOGIN").
Sourcepub fn has(&self, mechanism: &str) -> bool
pub fn has(&self, mechanism: &str) -> bool
Returns true if the given SASL mechanism is advertised.
The comparison is case-insensitive.
Sourcepub fn mechanisms(&self) -> impl Iterator<Item = &str>
pub fn mechanisms(&self) -> impl Iterator<Item = &str>
Returns an iterator over the advertised mechanism names.
Trait Implementations§
Source§impl<'a> Clone for SmtpAuthCapability<'a>
impl<'a> Clone for SmtpAuthCapability<'a>
Source§fn clone(&self) -> SmtpAuthCapability<'a>
fn clone(&self) -> SmtpAuthCapability<'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 SmtpAuthCapability<'a>
impl<'a> Debug for SmtpAuthCapability<'a>
impl<'a> Eq for SmtpAuthCapability<'a>
Source§impl<'a> PartialEq for SmtpAuthCapability<'a>
impl<'a> PartialEq for SmtpAuthCapability<'a>
impl<'a> StructuralPartialEq for SmtpAuthCapability<'a>
Auto Trait Implementations§
impl<'a> Freeze for SmtpAuthCapability<'a>
impl<'a> RefUnwindSafe for SmtpAuthCapability<'a>
impl<'a> Send for SmtpAuthCapability<'a>
impl<'a> Sync for SmtpAuthCapability<'a>
impl<'a> Unpin for SmtpAuthCapability<'a>
impl<'a> UnsafeUnpin for SmtpAuthCapability<'a>
impl<'a> UnwindSafe for SmtpAuthCapability<'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.