pub struct MediaType { /* private fields */ }
Implementations§
Source§impl MediaType
impl MediaType
pub fn parse(media_type: &str) -> Result<MediaType, ComponentCreationError>
pub fn new<T, ST>( type_: T, subtype: ST, ) -> Result<MediaType, ComponentCreationError>
pub fn new_with_params<T, ST, I, IV, IN>( type_: T, subtype: ST, params: I, ) -> Result<MediaType, ComponentCreationError>
pub fn remove_param<N>(&mut self, name: N) -> bool
pub fn set_param<N, V>(&mut self, name: N, value: V)
Methods from Deref<Target = AnyMediaType>§
pub fn type_(&self) -> Name<'_>
pub fn subtype(&self) -> Name<'_>
pub fn full_type(&self) -> Name<'_>
pub fn get_param<'a, N>(&'a self, attr: N) -> Option<Value<'a>>
pub fn params(&self) -> Params<'_>
pub fn as_str_repr(&self) -> &str
pub fn has_utf8_charset(&self) -> bool
pub fn is_multipart(&self) -> bool
Trait Implementations§
Source§impl<'de> Deserialize<'de> for MediaType
impl<'de> Deserialize<'de> for MediaType
Source§fn deserialize<D>(
deserializer: D,
) -> Result<MediaType, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
fn deserialize<D>(
deserializer: D,
) -> Result<MediaType, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl EncodableInHeader for MediaType
impl EncodableInHeader for MediaType
fn encode(&self, handle: &mut EncodingWriter<'_>) -> Result<(), EncodingError>
fn boxed_clone(&self) -> Box<dyn EncodableInHeader>
Source§impl<'a> HeaderTryFrom<&'a str> for MediaType
impl<'a> HeaderTryFrom<&'a str> for MediaType
Source§impl HeaderTryFrom<MediaType<MimeSpec<Internationalized, Modern>>> for MediaType
impl HeaderTryFrom<MediaType<MimeSpec<Internationalized, Modern>>> for MediaType
fn try_from( mime: MediaType<MimeSpec<Internationalized, Modern>>, ) -> Result<MediaType, ComponentCreationError>
Source§impl Into<AnyMediaType> for MediaType
impl Into<AnyMediaType> for MediaType
Source§fn into(self) -> AnyMediaType
fn into(self) -> AnyMediaType
Converts this type into the (usually inferred) input type.
Source§impl Serialize for MediaType
impl Serialize for MediaType
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
Auto Trait Implementations§
impl Freeze for MediaType
impl RefUnwindSafe for MediaType
impl Send for MediaType
impl Sync for MediaType
impl Unpin for MediaType
impl UnwindSafe for MediaType
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