[−][src]Struct http_types::content::MediaTypeProposal
A proposed Media Type for the Accept
header.
Implementations
impl MediaTypeProposal
[src]
pub fn new(media_type: impl Into<Mime>, weight: Option<f32>) -> Result<Self>
[src]
Create a new instance of MediaTypeProposal
.
pub fn media_type(&self) -> &Mime
[src]
Get the proposed media_type.
pub fn weight(&self) -> Option<f32>
[src]
Get the weight of the proposal.
Methods from Deref<Target = Mime>
pub fn basetype(&self) -> &str
[src]
Access the Mime's type
value.
According to the spec this method should be named type
, but that's a reserved keyword in
Rust so hence prefix with base
instead.
pub fn subtype(&self) -> &str
[src]
Access the Mime's subtype
value.
pub fn essence(&self) -> &str
[src]
Access the Mime's essence
value.
pub fn param(&self, name: impl Into<ParamName>) -> Option<&ParamValue>
[src]
Get a reference to a param.
pub fn remove_param(&mut self, name: impl Into<ParamName>) -> Option<ParamValue>
[src]
Remove a param from the set. Returns the ParamValue
if it was contained within the set.
Trait Implementations
impl Clone for MediaTypeProposal
[src]
pub fn clone(&self) -> MediaTypeProposal
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Debug for MediaTypeProposal
[src]
impl Deref for MediaTypeProposal
[src]
impl DerefMut for MediaTypeProposal
[src]
impl From<MediaTypeProposal> for Mime
[src]
pub fn from(accept: MediaTypeProposal) -> Self
[src]
impl From<MediaTypeProposal> for HeaderValue
[src]
pub fn from(entry: MediaTypeProposal) -> HeaderValue
[src]
impl From<Mime> for MediaTypeProposal
[src]
impl PartialEq<MediaTypeProposal> for MediaTypeProposal
[src]
pub fn eq(&self, other: &MediaTypeProposal) -> bool
[src]
pub fn ne(&self, other: &MediaTypeProposal) -> bool
[src]
impl PartialEq<Mime> for MediaTypeProposal
[src]
pub fn eq(&self, other: &Mime) -> bool
[src]
#[must_use]pub fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
impl PartialEq<Mime> for &MediaTypeProposal
[src]
pub fn eq(&self, other: &Mime) -> bool
[src]
#[must_use]pub fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
impl PartialOrd<MediaTypeProposal> for MediaTypeProposal
[src]
pub fn partial_cmp(&self, other: &Self) -> Option<Ordering>
[src]
#[must_use]pub fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
impl StructuralPartialEq for MediaTypeProposal
[src]
Auto Trait Implementations
impl RefUnwindSafe for MediaTypeProposal
[src]
impl Send for MediaTypeProposal
[src]
impl Sync for MediaTypeProposal
[src]
impl Unpin for MediaTypeProposal
[src]
impl UnwindSafe for MediaTypeProposal
[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,