pub struct Fetch<'a> {
pub message: Seq,
pub uid: Option<Uid>,
pub size: Option<u32>,
/* private fields */
}
Expand description
An IMAP FETCH
response that contains
data about a particular message. This response occurs as the result of a FETCH
or STORE
command, as well as by unilateral server decision (e.g., flag updates).
Fields
message: Seq
The ordinal number of this message in its containing mailbox.
uid: Option<Uid>
A number expressing the unique identifier of the message.
Only present if UID
was specified in the query argument to FETCH
and the server
supports UIDs.
size: Option<u32>
A number expressing the RFC-2822 size of the message.
Only present if RFC822.SIZE
was specified in the query argument to FETCH
.
Implementations
sourceimpl<'a> Fetch<'a>
impl<'a> Fetch<'a>
sourcepub fn header(&self) -> Option<&[u8]>
pub fn header(&self) -> Option<&[u8]>
The bytes that make up the header of this message, if BODY[HEADER]
, BODY.PEEK[HEADER]
,
or RFC822.HEADER
was included in the query
argument to FETCH
.
sourcepub fn body(&self) -> Option<&[u8]>
pub fn body(&self) -> Option<&[u8]>
The bytes that make up this message, included if BODY[]
or RFC822
was included in the
query
argument to FETCH
. The bytes SHOULD be interpreted by the client according to the
content transfer encoding, body type, and subtype.
sourcepub fn text(&self) -> Option<&[u8]>
pub fn text(&self) -> Option<&[u8]>
The bytes that make up the text of this message, included if BODY[TEXT]
, RFC822.TEXT
,
or BODY.PEEK[TEXT]
was included in the query
argument to FETCH
. The bytes SHOULD be
interpreted by the client according to the content transfer encoding, body type, and
subtype.
sourcepub fn envelope(&self) -> Option<&Envelope<'_>>
pub fn envelope(&self) -> Option<&Envelope<'_>>
The envelope of this message, if ENVELOPE
was included in the query
argument to
FETCH
. This is computed by the server by parsing the
RFC-2822 header into the component parts, defaulting
various fields as necessary.
The full description of the format of the envelope is given in RFC 3501 section 7.4.2.
sourcepub fn section(&self, path: &SectionPath) -> Option<&[u8]>
pub fn section(&self, path: &SectionPath) -> Option<&[u8]>
Extract the bytes that makes up the given BODY[<section>]
of a FETCH
response.
See section 7.4.2 of RFC 3501 for details.
sourcepub fn internal_date(&self) -> Option<DateTime<FixedOffset>>
pub fn internal_date(&self) -> Option<DateTime<FixedOffset>>
Extract the INTERNALDATE
of a FETCH
response
See section 2.3.3 of RFC 3501 for details.
sourcepub fn bodystructure(&self) -> Option<&BodyStructure<'a>>
pub fn bodystructure(&self) -> Option<&BodyStructure<'a>>
Extract the BODYSTRUCTURE
of a FETCH
response
See section 2.3.6 of RFC 3501 for details.
sourcepub fn gmail_labels(&'a self) -> Option<impl Iterator<Item = &'a str>>
pub fn gmail_labels(&'a self) -> Option<impl Iterator<Item = &'a str>>
Extract the X-GM-LABELS
of a FETCH
response
This is a Gmail-specific extension. See their developer’s page for details.
sourcepub fn into_owned(self) -> Fetch<'static>
pub fn into_owned(self) -> Fetch<'static>
Get an owned copy of the Fetch
.
Trait Implementations
impl<'a> Eq for Fetch<'a>
impl<'a> StructuralEq for Fetch<'a>
impl<'a> StructuralPartialEq for Fetch<'a>
Auto Trait Implementations
impl<'a> RefUnwindSafe for Fetch<'a>
impl<'a> Send for Fetch<'a>
impl<'a> Sync for Fetch<'a>
impl<'a> Unpin for Fetch<'a>
impl<'a> UnwindSafe for Fetch<'a>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more