#[non_exhaustive]pub enum BodyStructure {
Basic {
media_type: String,
media_subtype: String,
params: Vec<(String, String)>,
id: Option<String>,
description: Option<String>,
encoding: String,
size: u64,
md5: Option<String>,
disposition: Option<ContentDisposition>,
language: Option<Vec<String>>,
location: Option<String>,
},
Text {
media_subtype: String,
params: Vec<(String, String)>,
id: Option<String>,
description: Option<String>,
encoding: String,
size: u64,
lines: u64,
md5: Option<String>,
disposition: Option<ContentDisposition>,
language: Option<Vec<String>>,
location: Option<String>,
},
Message {Show 13 fields
media_subtype: String,
params: Vec<(String, String)>,
id: Option<String>,
description: Option<String>,
encoding: String,
size: u64,
envelope: Box<Envelope>,
body: Box<Self>,
lines: u64,
md5: Option<String>,
disposition: Option<ContentDisposition>,
language: Option<Vec<String>>,
location: Option<String>,
},
Multipart {
media_subtype: String,
bodies: Vec<Self>,
params: Vec<(String, String)>,
disposition: Option<ContentDisposition>,
language: Option<Vec<String>>,
location: Option<String>,
},
}Expand description
Parsed IMAP BODYSTRUCTURE (RFC 3501 Section 7.4.2 / RFC 9051 Section 7.5.2).
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Basic
A single non-text, non-message part (e.g. image/png, application/pdf) (RFC 3501 Section 7.4.2 / RFC 9051 Section 7.5.2).
Fields
size: u64Body size in octets (RFC 3501 Section 7.4.2 / RFC 9051 Section 7.5.2).
RFC 3501 and RFC 9051 both define body-fld-octets as number (u32),
but stored as u64 for Postel’s-law leniency with servers that send
larger values.
disposition: Option<ContentDisposition>Content-Disposition (RFC 2183 / RFC 3501 Section 7.4.2 extension data).
Text
A text/* part (RFC 3501 Section 7.4.2 / RFC 9051 Section 7.5.2).
Fields
size: u64Body size in octets (RFC 3501 Section 7.4.2 / RFC 9051 Section 7.5.2).
RFC 3501 and RFC 9051 both define body-fld-octets as number (u32),
but stored as u64 for Postel’s-law leniency with servers that send
larger values.
lines: u64Number of lines in the text body (RFC 3501 Section 7.4.2 / RFC 9051 Section 7.5.2).
RFC 9051 widens body-fld-lines from number to number64.
disposition: Option<ContentDisposition>Content-Disposition (RFC 2183 / RFC 3501 Section 7.4.2 extension data).
Message
A message/rfc822 or message/global part — embedded message
(RFC 3501 Section 7.4.2 / RFC 9051 Section 7.5.2).
Fields
size: u64Body size in octets (RFC 3501 Section 7.4.2 / RFC 9051 Section 7.5.2).
RFC 3501 and RFC 9051 both define body-fld-octets as number (u32),
but stored as u64 for Postel’s-law leniency with servers that send
larger values.
lines: u64Number of lines in the embedded message (RFC 3501 Section 7.4.2 / RFC 9051 Section 7.5.2).
RFC 9051 widens body-fld-lines from number to number64.
disposition: Option<ContentDisposition>Content-Disposition (RFC 2183 / RFC 3501 Section 7.4.2 extension data).
Multipart
A multipart/* container (RFC 2046 Section 5 / RFC 3501 Section 7.4.2).
Fields
disposition: Option<ContentDisposition>Content-Disposition (RFC 2183 / RFC 3501 Section 7.4.2 extension data).
Trait Implementations§
Source§impl Clone for BodyStructure
impl Clone for BodyStructure
Source§fn clone(&self) -> BodyStructure
fn clone(&self) -> BodyStructure
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more