Enum mail_parser::HeaderValue
source · pub enum HeaderValue<'x> {
Address(Address<'x>),
Text(Cow<'x, str>),
TextList(Vec<Cow<'x, str>>),
DateTime(DateTime),
ContentType(ContentType<'x>),
Received(Box<Received<'x>>),
Empty,
}
Expand description
Parsed header value.
Variants§
Address(Address<'x>)
Address list or group
Text(Cow<'x, str>)
String
TextList(Vec<Cow<'x, str>>)
List of strings
DateTime(DateTime)
Datetime
ContentType(ContentType<'x>)
Content-Type or Content-Disposition header
Received(Box<Received<'x>>)
Received header
Empty
Implementations§
source§impl<'x> HeaderValue<'x>
impl<'x> HeaderValue<'x>
pub fn is_empty(&self) -> bool
pub fn unwrap_text(self) -> Cow<'x, str>
pub fn unwrap_text_list(self) -> Vec<Cow<'x, str>>
pub fn unwrap_datetime(self) -> DateTime
pub fn unwrap_address(self) -> Address<'x>
pub fn unwrap_content_type(self) -> ContentType<'x>
pub fn unwrap_received(self) -> Received<'x>
pub fn into_text(self) -> Option<Cow<'x, str>>
pub fn into_text_list(self) -> Option<Vec<Cow<'x, str>>>
pub fn into_address(self) -> Option<Address<'x>>
pub fn into_datetime(self) -> Option<DateTime>
pub fn into_content_type(self) -> Option<ContentType<'x>>
pub fn into_received(self) -> Option<Received<'x>>
pub fn as_text(&self) -> Option<&str>
pub fn as_text_list(&self) -> Option<Vec<&str>>
pub fn as_address(&self) -> Option<&Address<'x>>
pub fn as_received(&self) -> Option<&Received<'_>>
pub fn as_content_type(&self) -> Option<&ContentType<'_>>
pub fn as_datetime(&self) -> Option<&DateTime>
pub fn into_owned(self) -> HeaderValue<'static>
pub fn len(&self) -> usize
Trait Implementations§
source§impl<'x> Clone for HeaderValue<'x>
impl<'x> Clone for HeaderValue<'x>
source§fn clone(&self) -> HeaderValue<'x>
fn clone(&self) -> HeaderValue<'x>
Returns a copy 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<'x> Debug for HeaderValue<'x>
impl<'x> Debug for HeaderValue<'x>
source§impl<'x> Default for HeaderValue<'x>
impl<'x> Default for HeaderValue<'x>
source§fn default() -> HeaderValue<'x>
fn default() -> HeaderValue<'x>
Returns the “default value” for a type. Read more
source§impl<'x> PartialEq for HeaderValue<'x>
impl<'x> PartialEq for HeaderValue<'x>
source§fn eq(&self, other: &HeaderValue<'x>) -> bool
fn eq(&self, other: &HeaderValue<'x>) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.impl<'x> Eq for HeaderValue<'x>
impl<'x> StructuralPartialEq for HeaderValue<'x>
Auto Trait Implementations§
impl<'x> Freeze for HeaderValue<'x>
impl<'x> RefUnwindSafe for HeaderValue<'x>
impl<'x> Send for HeaderValue<'x>
impl<'x> Sync for HeaderValue<'x>
impl<'x> Unpin for HeaderValue<'x>
impl<'x> UnwindSafe for HeaderValue<'x>
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