#[non_exhaustive]pub enum Body {
Text(String),
Html(String),
TextAndHtml {
text: String,
html: String,
},
Mime(MimePart),
}Expand description
Message body payload.
§Untrusted-deserialize caveat
The Body::Mime(MimePart) variant carries a recursive
MimePart::Multipart { parts: Vec<Self> } tree.
Callers deserializing a Body (or a Message containing one)
from untrusted input must pre-bound the input length and recursion
depth: serde_json defaults to a 128-frame recursion limit which
is safe, but other formats (e.g. serde_yaml, bincode,
rmp-serde, serde_cbor) may not. The wire renderer
(email_message_wire::render_rfc822) enforces a
MAX_MULTIPART_DEPTH cap on outbound trees, including up to two
frames of attachment-wrapping when inline and/or regular
attachments are present, as a defensive backstop; other consumers
(caller code that walks the tree itself) must defend themselves.
See MimePart for the matching caveat on the
leaf type.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Implementations§
Trait Implementations§
Source§impl<'arbitrary> Arbitrary<'arbitrary> for Body
impl<'arbitrary> Arbitrary<'arbitrary> for Body
Source§fn arbitrary(u: &mut Unstructured<'arbitrary>) -> Result<Self>
fn arbitrary(u: &mut Unstructured<'arbitrary>) -> Result<Self>
Self from the given unstructured data. Read moreSource§fn arbitrary_take_rest(u: Unstructured<'arbitrary>) -> Result<Self>
fn arbitrary_take_rest(u: Unstructured<'arbitrary>) -> Result<Self>
Self from the entirety of the given
unstructured data. Read moreSource§fn size_hint(depth: usize) -> (usize, Option<usize>)
fn size_hint(depth: usize) -> (usize, Option<usize>)
Unstructured this type
needs to construct itself. Read moreSource§fn try_size_hint(
depth: usize,
) -> Result<(usize, Option<usize>), MaxRecursionReached>
fn try_size_hint( depth: usize, ) -> Result<(usize, Option<usize>), MaxRecursionReached>
Unstructured this type
needs to construct itself. Read moreSource§impl<'de> Deserialize<'de> for Body
impl<'de> Deserialize<'de> for Body
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl JsonSchema for Body
impl JsonSchema for Body
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
$ref keyword. Read more