pub struct MediaType(/* private fields */);Expand description
Parsed, concrete MIME type for immutable artifact plaintext.
Implementations§
Source§impl MediaType
impl MediaType
Sourcepub fn parse(value: &str) -> Result<MediaType, ContentValueError>
pub fn parse(value: &str) -> Result<MediaType, ContentValueError>
Parse a MIME value and reject wildcard media ranges.
Sourcepub fn essence_str(&self) -> &str
pub fn essence_str(&self) -> &str
Return the MIME type and subtype without parameters.
Sourcepub fn is_utf8_text(&self) -> bool
pub fn is_utf8_text(&self) -> bool
Return whether this media type conventionally carries UTF-8 model-facing text.
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
impl Eq for MediaType
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
impl StructuralPartialEq for MediaType
Auto Trait Implementations§
impl Freeze for MediaType
impl RefUnwindSafe for MediaType
impl Send for MediaType
impl Sync for MediaType
impl Unpin for MediaType
impl UnsafeUnpin 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