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<&'x String> for ContentType<'x>
impl<'x> From<&'x String> for ContentType<'x>
source§impl<'x> From<&'x str> for ContentType<'x>
impl<'x> From<&'x str> 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> From<String> for ContentType<'x>
impl<'x> From<String> for ContentType<'x>
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 for ContentType<'x>
impl<'x> PartialEq 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 for ContentType<'x>
impl<'x> PartialOrd 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 moreimpl<'x> Eq for ContentType<'x>
impl<'x> StructuralPartialEq for ContentType<'x>
Auto Trait Implementations§
impl<'x> Freeze for ContentType<'x>
impl<'x> RefUnwindSafe for ContentType<'x>
impl<'x> Send for ContentType<'x>
impl<'x> Sync for ContentType<'x>
impl<'x> Unpin for ContentType<'x>
impl<'x> UnwindSafe for ContentType<'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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit)