Struct mail_builder::headers::content_type::ContentType
source · pub struct ContentType<'x> {
pub c_type: Cow<'x, str>,
pub attributes: Vec<(Cow<'x, str>, Cow<'x, str>)>,
}Expand description
MIME Content-Type or Content-Disposition header
Fields§
§c_type: Cow<'x, str>§attributes: Vec<(Cow<'x, str>, Cow<'x, str>)>Implementations§
source§impl<'x> ContentType<'x>
impl<'x> ContentType<'x>
sourcepub fn new(c_type: impl Into<Cow<'x, str>>) -> Self
pub fn new(c_type: impl Into<Cow<'x, str>>) -> Self
Create a new Content-Type or Content-Disposition header
sourcepub fn attribute(
self,
key: impl Into<Cow<'x, str>>,
value: impl Into<Cow<'x, str>>
) -> Self
pub fn attribute(
self,
key: impl Into<Cow<'x, str>>,
value: impl Into<Cow<'x, str>>
) -> Self
Set a Content-Type / Content-Disposition attribute
sourcepub fn is_attachment(&self) -> bool
pub fn is_attachment(&self) -> bool
Returns true when the part is an attachment
Trait Implementations§
source§impl<'x> Clone for ContentType<'x>
impl<'x> Clone for ContentType<'x>
source§fn clone(&self) -> ContentType<'x>
fn clone(&self) -> ContentType<'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 ContentType<'x>
impl<'x> Debug for ContentType<'x>
source§impl<'x> From<ContentType<'x>> for HeaderType<'x>
impl<'x> From<ContentType<'x>> for HeaderType<'x>
source§fn from(value: ContentType<'x>) -> Self
fn from(value: ContentType<'x>) -> Self
Converts to this type from the input type.
source§impl<'x> Header for ContentType<'x>
impl<'x> Header for ContentType<'x>
source§impl<'x> Ord for ContentType<'x>
impl<'x> Ord for ContentType<'x>
source§fn cmp(&self, other: &ContentType<'x>) -> Ordering
fn cmp(&self, other: &ContentType<'x>) -> Ordering
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
source§impl<'x> PartialEq<ContentType<'x>> for ContentType<'x>
impl<'x> PartialEq<ContentType<'x>> for ContentType<'x>
source§fn eq(&self, other: &ContentType<'x>) -> bool
fn eq(&self, other: &ContentType<'x>) -> bool
This method tests for
self and other values to be equal, and is used
by ==.source§impl<'x> PartialOrd<ContentType<'x>> for ContentType<'x>
impl<'x> PartialOrd<ContentType<'x>> for ContentType<'x>
source§fn partial_cmp(&self, other: &ContentType<'x>) -> Option<Ordering>
fn partial_cmp(&self, other: &ContentType<'x>) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self and other) and is used by the <=
operator. Read more