pub enum MessageDataItemName<'a> {
    Body,
    BodyExt {
        section: Option<Section<'a>>,
        partial: Option<(u32, NonZeroU32)>,
        peek: bool,
    },
    BodyStructure,
    Envelope,
    Flags,
    InternalDate,
    Rfc822,
    Rfc822Header,
    Rfc822Size,
    Rfc822Text,
    Uid,
}
Expand description

Message data item name used to request a message data item.

Variants§

§

Body

Non-extensible form of BODYSTRUCTURE.

BODY
§

BodyExt

Fields

§section: Option<Section<'a>>

The section specification is a set of zero or more part specifiers delimited by periods.

An empty section specification refers to the entire message, including the header.

See crate::fetch::Section and crate::fetch::PartSpecifier.

Every message has at least one part number. Non-[MIME-IMB] messages, and non-multipart [MIME-IMB] messages with no encapsulated message, only have a part 1.

Multipart messages are assigned consecutive part numbers, as they occur in the message. If a particular part is of type message or multipart, its parts MUST be indicated by a period followed by the part number within that nested multipart part.

A part of type MESSAGE/RFC822 also has nested part numbers, referring to parts of the MESSAGE part’s body.

§partial: Option<(u32, NonZeroU32)>

It is possible to fetch a substring of the designated text. This is done by appending an open angle bracket (“<”), the octet position of the first desired octet, a period, the maximum number of octets desired, and a close angle bracket (“>”) to the part specifier. If the starting octet is beyond the end of the text, an empty string is returned.

Any partial fetch that attempts to read beyond the end of the text is truncated as appropriate. A partial fetch that starts at octet 0 is returned as a partial fetch, even if this truncation happened.

Note: This means that BODY[]<0.2048> of a 1500-octet message will return BODY[]<0> with a literal of size 1500, not BODY[].

Note: A substring fetch of a HEADER.FIELDS or HEADER.FIELDS.NOT part specifier is calculated after subsetting the header.

§peek: bool

Defines, wheather BODY or BODY.PEEK should be used.

BODY[...] implicitly sets the \Seen flag where BODY.PEEK[...] does not.

The text of a particular body section.

BODY[<section>]<<partial>>
§

BodyStructure

The [MIME-IMB] body structure of a message.

This is computed by the server by parsing the [MIME-IMB] header fields in the [RFC-2822] header and [MIME-IMB] headers.

BODYSTRUCTURE
§

Envelope

The envelope structure of a message.

This is computed by the server by parsing the [RFC-2822] header into the component parts, defaulting various fields as necessary.

ENVELOPE
§

Flags

The flags that are set for a message.

FLAGS
§

InternalDate

The internal date of a message.

INTERNALDATE
§

Rfc822

Functionally equivalent to BODY[].

Differs in the syntax of the resulting untagged FETCH data (RFC822 is returned).

RFC822

Note: BODY[] is constructed as …

MessageDataItemName::BodyExt {
    section: None,
    partial: None,
    peek: false,
};
§

Rfc822Header

Functionally equivalent to BODY.PEEK[HEADER].

Differs in the syntax of the resulting untagged FETCH data (RFC822.HEADER is returned).

RFC822.HEADER
§

Rfc822Size

The [RFC-2822] size of a message.

RFC822.SIZE
§

Rfc822Text

Functionally equivalent to BODY[TEXT].

Differs in the syntax of the resulting untagged FETCH data (RFC822.TEXT is returned).

RFC822.TEXT
§

Uid

The unique identifier for a message.

UID

Trait Implementations§

source§

impl<'a, 'arbitrary: 'a> Arbitrary<'arbitrary> for MessageDataItemName<'a>

source§

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

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

fn arbitrary_take_rest(u: Unstructured<'arbitrary>) -> Result<Self>

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§

impl<'a> Clone for MessageDataItemName<'a>

source§

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

Returns a copy 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 MessageDataItemName<'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 MessageDataItemName<'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> Hash for MessageDataItemName<'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 MessageDataItemName<'a>

§

type Static = MessageDataItemName<'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<MessageDataItemName<'a>> for MessageDataItemName<'a>

source§

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

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

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

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<'a> Serialize for MessageDataItemName<'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 MessageDataItemName<'a>

§

type Static = MessageDataItemName<'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> Eq for MessageDataItemName<'a>

source§

impl<'a> StructuralEq for MessageDataItemName<'a>

source§

impl<'a> StructuralPartialEq for MessageDataItemName<'a>

Auto Trait Implementations§

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

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

source§

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

Mutably borrows from an owned value. 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 Twhere 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 Twhere T: Clone,

§

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, U> TryFrom<U> for Twhere U: Into<T>,

§

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 Twhere U: TryFrom<T>,

§

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 Twhere T: for<'de> Deserialize<'de>,