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

The currently defined data items that can be fetched are:

Variants§

§

Body

BODY

Non-extensible form of BODYSTRUCTURE.

§

BodyExt

Fields

§section: Option<Section<'a>>

The text of a particular body section. 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 Section and 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.

BODY[<section>]<<partial>>

§

BodyStructure

BODYSTRUCTURE

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

§

Envelope

ENVELOPE

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

§

Flags

FLAGS

The flags that are set for this message.

§

InternalDate

INTERNALDATE

The internal date of the message.

§

Rfc822

RFC822

Functionally equivalent to BODY[], differing in the syntax of the resulting untagged FETCH data (RFC822 is returned).

§

Rfc822Header

RFC822.HEADER

Functionally equivalent to BODY.PEEK[HEADER], differing in the syntax of the resulting untagged FETCH data (RFC822.HEADER is returned).

§

Rfc822Size

RFC822.SIZE

The [RFC-2822] size of the message.

§

Rfc822Text

RFC822.TEXT

Functionally equivalent to BODY[TEXT], differing in the syntax of the resulting untagged FETCH data (RFC822.TEXT is returned).

§

Uid

UID

The unique identifier for the message.

Trait Implementations§

source§

impl<'a> Clone for FetchAttribute<'a>

source§

fn clone(&self) -> FetchAttribute<'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 FetchAttribute<'a>

source§

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

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

impl<'a> Encode for FetchAttribute<'a>

source§

fn encode(&self, writer: &mut impl Write) -> Result<(), Error>

source§

fn encode_detached(&self) -> Result<Vec<u8, Global>, Error>

source§

impl<'a> Hash for FetchAttribute<'a>

source§

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

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> PartialEq<FetchAttribute<'a>> for FetchAttribute<'a>

source§

fn eq(&self, other: &FetchAttribute<'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> Eq for FetchAttribute<'a>

source§

impl<'a> StructuralEq for FetchAttribute<'a>

source§

impl<'a> StructuralPartialEq for FetchAttribute<'a>

Auto Trait Implementations§

§

impl<'a> RefUnwindSafe for FetchAttribute<'a>

§

impl<'a> Send for FetchAttribute<'a>

§

impl<'a> Sync for FetchAttribute<'a>

§

impl<'a> Unpin for FetchAttribute<'a>

§

impl<'a> UnwindSafe for FetchAttribute<'a>

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,

const: unstable · source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

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

const: unstable · source§

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

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

const: unstable · source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

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

const: unstable · 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.
const: unstable · 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.
const: unstable · source§

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

Performs the conversion.