pub struct MediaType {
pub main: MediaTypeSegment,
pub subtype: MediaTypeSegment,
}
Expand description
Media type value in HTTP headers.
Fields§
§main: MediaTypeSegment
Main segment.
subtype: MediaTypeSegment
Subtype segment.
Implementations§
Source§impl MediaType
impl MediaType
Sourcepub const fn new(main: MediaTypeSegment, subtype: MediaTypeSegment) -> Self
pub const fn new(main: MediaTypeSegment, subtype: MediaTypeSegment) -> Self
Constructor.
Sourcepub const fn new_fostered(main: &'static str, subtype: &'static str) -> Self
pub const fn new_fostered(main: &'static str, subtype: &'static str) -> Self
Constructor.
Trait Implementations§
Source§impl CacheWeight for MediaType
impl CacheWeight for MediaType
Source§fn cache_weight(&self) -> usize
fn cache_weight(&self) -> usize
Cache weight as a byte count. Read more
Source§impl From<MediaType> for MediaTypeSelector
impl From<MediaType> for MediaTypeSelector
Source§impl Into<HeaderValue> for MediaType
impl Into<HeaderValue> for MediaType
Source§fn into(self) -> HeaderValue
fn into(self) -> HeaderValue
Converts this type into the (usually inferred) input type.
Source§impl PartialEq<MediaType> for MediaTypeSelector
impl PartialEq<MediaType> for MediaTypeSelector
impl Eq for MediaType
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 UnwindSafe for MediaType
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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§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.