Enum imap_types::command::fetch::FetchAttribute
source · 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.
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>
impl<'a> Clone for FetchAttribute<'a>
source§fn clone(&self) -> FetchAttribute<'a>
fn clone(&self) -> FetchAttribute<'a>
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moresource§impl<'a> Debug for FetchAttribute<'a>
impl<'a> Debug for FetchAttribute<'a>
source§impl<'a> Encode for FetchAttribute<'a>
impl<'a> Encode for FetchAttribute<'a>
source§impl<'a> Hash for FetchAttribute<'a>
impl<'a> Hash for FetchAttribute<'a>
source§impl<'a> PartialEq<FetchAttribute<'a>> for FetchAttribute<'a>
impl<'a> PartialEq<FetchAttribute<'a>> for FetchAttribute<'a>
source§fn eq(&self, other: &FetchAttribute<'a>) -> bool
fn eq(&self, other: &FetchAttribute<'a>) -> bool
self and other values to be equal, and is used
by ==.