#[non_exhaustive]pub enum HeaderValueTyped {
Raw(String),
Text(String),
Addresses(Vec<EmailAddress>),
GroupedAddresses(Vec<AddressGroup>),
MessageIds(Vec<String>),
DateTime(Option<HeaderDateTime>),
URLs(Vec<String>),
}Expand description
A header field value rendered in one of the RFC 8621 parsed forms.
§Serde wire format
HeaderValueTyped and HeaderForm use serde’s default
representation: externally-tagged for the enum, capitalised Rust
variant names. Examples:
{"Addresses": [{"name": "Alice", "address": "alice@example.com"}]}
{"DateTime": null}
{"Raw": "Subject line"}
"Addresses" // serialized HeaderFormThis is a deliberate choice for in-crate serialization (between
services, into databases). It is not the RFC 8621 wire format
used over JMAP HTTP/JSON. RFC 8621 §4.1.2 uses property-selector
strings such as header:Subject:asAddresses rather than serializing
the form name as an enum tag. Callers exposing parsed headers to a
JMAP client SHOULD map between this representation and the JMAP
wire format at the API boundary; relying on the in-crate serde
shape as the wire format will produce a non-conformant JMAP
response.
Pre-1.0, this representation is subject to change. From 1.0 onward the in-crate serde format will be a stability surface and will be changed only with a major version bump.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Raw(String)
Result of HeaderForm::Raw: the trimmed UTF-8 string.
Text(String)
Result of HeaderForm::Text: whitespace-unfolded, RFC 2047
decoded, NFC-normalised UTF-8 string.
Addresses(Vec<EmailAddress>)
Result of HeaderForm::Addresses.
GroupedAddresses(Vec<AddressGroup>)
Result of HeaderForm::GroupedAddresses.
MessageIds(Vec<String>)
Result of HeaderForm::MessageIds: bare msg-id strings with no
angle brackets.
DateTime(Option<HeaderDateTime>)
Result of HeaderForm::Date, or None if the header value did
not parse as a date-time.
URLs(Vec<String>)
Result of HeaderForm::URLs: bare URL strings with no angle
brackets.
Trait Implementations§
Source§impl Clone for HeaderValueTyped
impl Clone for HeaderValueTyped
Source§fn clone(&self) -> HeaderValueTyped
fn clone(&self) -> HeaderValueTyped
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for HeaderValueTyped
impl Debug for HeaderValueTyped
Source§impl<'de> Deserialize<'de> for HeaderValueTyped
impl<'de> Deserialize<'de> for HeaderValueTyped
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>,
impl Eq for HeaderValueTyped
Source§impl Hash for HeaderValueTyped
impl Hash for HeaderValueTyped
Source§impl PartialEq for HeaderValueTyped
impl PartialEq for HeaderValueTyped
Source§fn eq(&self, other: &HeaderValueTyped) -> bool
fn eq(&self, other: &HeaderValueTyped) -> bool
self and other values to be equal, and is used by ==.