Struct async_imap::types::Fetch

source ·
pub struct Fetch {
    pub message: Seq,
    pub uid: Option<Uid>,
    pub size: Option<u32>,
    pub modseq: Option<u64>,
    /* 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.

§modseq: Option<u64>

A number expressing the RFC-7162 mod-sequence of the message.

Implementations§

source§

impl Fetch

source

pub fn flags(&self) -> impl Iterator<Item = Flag<'_>>

A list of flags that are set for this message.

source

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.

source

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.

source

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.

source

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.

source

pub fn section(&self, path: &SectionPath) -> Option<&[u8]>

Extract the bytes that makes up the given BOD[<section>] of a FETCH response.

See section 7.4.2 of RFC 3501 for details.

source

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.

source

pub fn bodystructure(&self) -> Option<&BodyStructure<'_>>

Extract the BODYSTRUCTURE of a FETCH response

See section 2.3.6 of RFC 3501 for details.

Trait Implementations§

source§

impl Debug for Fetch

source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl RefUnwindSafe for Fetch

§

impl Send for Fetch

§

impl Sync for Fetch

§

impl Unpin for Fetch

§

impl UnwindSafe for Fetch

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> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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, U> TryFrom<U> for T
where 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 T
where 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.
§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more