pub enum ParsedHeader {
MailboxList(MailboxList),
Mailbox(Mailbox),
AddressList(AddressList),
MessageId(MessageID),
MessageIdList(Vec<MessageID>),
MimeParameters(MimeParameters),
Date(DateTime<FixedOffset>),
AuthenticationResults(AuthenticationResults),
Unstructured(BString),
}Expand description
The parsed, typed value of a header, as distinct from the raw wire form
held by Header. A header’s name determines the grammar its bytes are
parsed with (see ParsedHeader::structured), so callers reach a value
of the correct type without choosing a parser themselves.
Variants§
MailboxList(MailboxList)
Mailbox(Mailbox)
AddressList(AddressList)
MessageId(MessageID)
MessageIdList(Vec<MessageID>)
MimeParameters(MimeParameters)
Date(DateTime<FixedOffset>)
AuthenticationResults(AuthenticationResults)
Unstructured(BString)
Implementations§
Source§impl ParsedHeader
impl ParsedHeader
Sourcepub fn structured(name: &[u8], value: &[u8]) -> Result<Self>
pub fn structured(name: &[u8], value: &[u8]) -> Result<Self>
Parse value as the header named by name, selecting the grammar
from the name. An unrecognized name is treated as unstructured.
Trait Implementations§
Source§impl Clone for ParsedHeader
impl Clone for ParsedHeader
Source§fn clone(&self) -> ParsedHeader
fn clone(&self) -> ParsedHeader
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ParsedHeader
impl Debug for ParsedHeader
Source§impl EncodeHeaderValue for ParsedHeader
impl EncodeHeaderValue for ParsedHeader
fn encode_value(&self) -> SharedString<'static>
fn as_header(&self, _name: &[u8]) -> Option<Header<'static>>
Source§impl PartialEq for ParsedHeader
impl PartialEq for ParsedHeader
impl Eq for ParsedHeader
impl StructuralPartialEq for ParsedHeader
Auto Trait Implementations§
impl Freeze for ParsedHeader
impl RefUnwindSafe for ParsedHeader
impl Send for ParsedHeader
impl Sync for ParsedHeader
impl Unpin for ParsedHeader
impl UnwindSafe for ParsedHeader
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more