Enum Flag

Source
pub enum Flag<'a> {
    Answered,
    Deleted,
    Draft,
    Flagged,
    Seen,
    Extension(FlagExtension<'a>),
    Keyword(Atom<'a>),
}
Expand description

There are two types of flags in IMAP4rev1: System and keyword flags.

A system flag is a flag name that is pre-defined in RFC3501. All system flags begin with “\” and certain system flags (\Deleted and \Seen) have special semantics. Flags that begin with “\” but are not pre-defined system flags, are extension flags. Clients MUST accept them and servers MUST NOT send them except when defined by future standard or standards-track revisions.

A keyword is defined by the server implementation. Keywords do not begin with “\” and servers may permit the client to define new ones in the mailbox by sending the \* flag (FlagPerm::Asterisk) in the PERMANENTFLAGS response..

Note that a flag of either type can be permanent or session-only.

Variants§

§

Answered

Message has been answered (\Answered).

§

Deleted

Message is “deleted” for removal by later EXPUNGE (\Deleted).

§

Draft

Message has not completed composition (marked as a draft) (\Draft).

§

Flagged

Message is “flagged” for urgent/special attention (\Flagged).

§

Seen

Message has been read (\Seen).

§

Extension(FlagExtension<'a>)

A future expansion of a system flag.

§

Keyword(Atom<'a>)

A keyword.

Implementations§

Source§

impl<'a> Flag<'a>

Source

pub fn system(atom: Atom<'a>) -> Self

Source

pub fn keyword(atom: Atom<'a>) -> Self

Trait Implementations§

Source§

impl<'a> Arbitrary<'a> for Flag<'a>

Source§

fn arbitrary(u: &mut Unstructured<'a>) -> Result<Self>

Generate an arbitrary value of Self from the given unstructured data. Read more
Source§

fn arbitrary_take_rest(u: Unstructured<'a>) -> Result<Self, Error>

Generate an arbitrary value of Self from the entirety of the given unstructured data. Read more
Source§

fn size_hint(depth: usize) -> (usize, Option<usize>)

Get a size hint for how many bytes out of an Unstructured this type needs to construct itself. Read more
Source§

fn try_size_hint( depth: usize, ) -> Result<(usize, Option<usize>), MaxRecursionReached>

Get a size hint for how many bytes out of an Unstructured this type needs to construct itself. Read more
Source§

impl<'a> Clone for Flag<'a>

Source§

fn clone(&self) -> Flag<'a>

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<'a> Debug for Flag<'a>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de, 'a> Deserialize<'de> for Flag<'a>

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl<'a> Display for Flag<'a>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'a> Hash for Flag<'a>

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl<'a> IntoBoundedStatic for Flag<'a>

Source§

type Static = Flag<'static>

The target type is bounded by the 'static lifetime.
Source§

fn into_static(self) -> Self::Static

Convert an owned T into an owned T such that T: 'static.
Source§

impl<'a> PartialEq for Flag<'a>

Source§

fn eq(&self, other: &Flag<'a>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<'a> Serialize for Flag<'a>

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl<'a> ToBoundedStatic for Flag<'a>

Source§

type Static = Flag<'static>

The target type is bounded by the 'static lifetime.
Source§

fn to_static(&self) -> Self::Static

Convert an &T to an owned T such that T: 'static.
Source§

impl<'a> TryFrom<&'a str> for Flag<'a>

Source§

type Error = ValidationError

The type returned in the event of a conversion error.
Source§

fn try_from(value: &'a str) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl<'a> Eq for Flag<'a>

Source§

impl<'a> StructuralPartialEq for Flag<'a>

Auto Trait Implementations§

§

impl<'a> Freeze for Flag<'a>

§

impl<'a> RefUnwindSafe for Flag<'a>

§

impl<'a> Send for Flag<'a>

§

impl<'a> Sync for Flag<'a>

§

impl<'a> Unpin for Flag<'a>

§

impl<'a> UnwindSafe for Flag<'a>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,