Enum mail_parser::HeaderValue
source · pub enum HeaderValue<'x> {
Address(Addr<'x>),
AddressList(Vec<Addr<'x>>),
Group(Group<'x>),
GroupList(Vec<Group<'x>>),
Text(Cow<'x, str>),
TextList(Vec<Cow<'x, str>>),
DateTime(DateTime),
ContentType(ContentType<'x>),
Empty,
}
Expand description
Parsed header value.
Variants§
Address(Addr<'x>)
Single address
AddressList(Vec<Addr<'x>>)
Address list
Group(Group<'x>)
Group of addresses
GroupList(Vec<Group<'x>>)
List containing two or more address groups
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
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_datetime(self) -> DateTime
pub fn unwrap_content_type(self) -> ContentType<'x>
pub fn as_text_ref(&self) -> Option<&str>
pub fn as_text_list(&self) -> Option<Vec<&str>>
pub fn content_type(&self) -> &ContentType<'x>
pub fn as_content_type_ref(&self) -> Option<&ContentType<'_>>
pub fn as_datetime_ref(&self) -> Option<&DateTime>
pub fn into_owned<'y>(self) -> HeaderValue<'y>
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 more