Struct spring_mail::header::ContentType
source · pub struct ContentType(/* private fields */);
Expand description
Content-Type
of the body
This struct can represent any valid MIME type, which can be parsed via
ContentType::parse
. Constants are provided for the most-used mime-types.
Defined in RFC2045
Implementations§
source§impl ContentType
impl ContentType
sourcepub const TEXT_PLAIN: ContentType = _
pub const TEXT_PLAIN: ContentType = _
A ContentType
of type text/plain; charset=utf-8
Indicates that the body is in utf-8 encoded plain text.
sourcepub const TEXT_HTML: ContentType = _
pub const TEXT_HTML: ContentType = _
A ContentType
of type text/html; charset=utf-8
Indicates that the body is in utf-8 encoded html.
sourcepub fn parse(s: &str) -> Result<ContentType, ContentTypeErr>
pub fn parse(s: &str) -> Result<ContentType, ContentTypeErr>
Parse s
into ContentType
Trait Implementations§
source§impl Clone for ContentType
impl Clone for ContentType
source§fn clone(&self) -> ContentType
fn clone(&self) -> ContentType
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 Debug for ContentType
impl Debug for ContentType
source§impl<'de> Deserialize<'de> for ContentType
impl<'de> Deserialize<'de> for ContentType
source§fn deserialize<D>(
deserializer: D,
) -> Result<ContentType, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
fn deserialize<D>(
deserializer: D,
) -> Result<ContentType, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl FromStr for ContentType
impl FromStr for ContentType
§type Err = ContentTypeErr
type Err = ContentTypeErr
The associated error which can be returned from parsing.
source§fn from_str(s: &str) -> Result<ContentType, <ContentType as FromStr>::Err>
fn from_str(s: &str) -> Result<ContentType, <ContentType as FromStr>::Err>
Parses a string
s
to return a value of this type. Read moresource§impl Header for ContentType
impl Header for ContentType
source§impl PartialEq for ContentType
impl PartialEq for ContentType
source§impl Serialize for ContentType
impl Serialize for ContentType
source§fn serialize<S>(
&self,
serializer: S,
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where
S: Serializer,
fn serialize<S>(
&self,
serializer: S,
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where
S: Serializer,
Serialize this value into the given Serde serializer. Read more
impl Eq for ContentType
impl StructuralPartialEq for ContentType
Auto Trait Implementations§
impl Freeze for ContentType
impl RefUnwindSafe for ContentType
impl Send for ContentType
impl Sync for ContentType
impl Unpin for ContentType
impl UnwindSafe for ContentType
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
)source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.