pub struct Flag { /* private fields */ }Expand description
A flag attached to an envelope or message.
Constructed via Flag::from_raw (wire spelling in, IANA lookup
derived) or Flag::from_iana (IANA tag in, canonical wire
spelling synthesised). The constructor is named from_iana rather
than iana to leave Flag::iana free as the accessor that
returns the optional classification.
Implementations§
Source§impl Flag
impl Flag
Sourcepub fn from_raw(raw: impl Into<String>) -> Self
pub fn from_raw(raw: impl Into<String>) -> Self
Builds a Flag from a wire spelling. The raw string is kept
verbatim; the IANA classification is derived by
classify_iana.
Sourcepub fn raw(&self) -> &str
pub fn raw(&self) -> &str
Original wire spelling as observed on the backend (or the
canonical spelling when built from an IanaFlag).
Sourcepub fn iana(&self) -> Option<IanaFlag>
pub fn iana(&self) -> Option<IanaFlag>
IANA classification when the raw spelling matched a registered
keyword; None for user-defined custom keywords.
pub fn is_seen(&self) -> bool
pub fn is_answered(&self) -> bool
pub fn is_flagged(&self) -> bool
pub fn is_draft(&self) -> bool
pub fn is_deleted(&self) -> bool
pub fn is_forwarded(&self) -> bool
pub fn is_junk(&self) -> bool
pub fn is_notjunk(&self) -> bool
pub fn is_phishing(&self) -> bool
pub fn is_important(&self) -> bool
pub fn is_mdnsent(&self) -> bool
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Flag
impl<'de> Deserialize<'de> for Flag
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl Eq for Flag
Source§impl Hash for Flag
impl Hash for Flag
Source§impl Ord for Flag
impl Ord for Flag
Source§fn cmp(&self, other: &Self) -> Ordering
fn cmp(&self, other: &Self) -> Ordering
IANA-tagged flags sort before custom keywords (IANA-first
canonical ordering). Within each group, IANA flags use the
derived enum order and custom keywords compare on their
lowercase raw text so that "Foo" and "foo" order
consistently with equality.
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Auto Trait Implementations§
impl Freeze for Flag
impl RefUnwindSafe for Flag
impl Send for Flag
impl Sync for Flag
impl Unpin for Flag
impl UnsafeUnpin for Flag
impl UnwindSafe for Flag
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
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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.