Struct webmachine::content_negotiation::MediaLanguage
source · [−]Expand description
Struct to represent a media language
Fields
main: String
Main type of the media language
sub: String
Sub type of the media language
weight: f32
Weight associated with the media language
Implementations
sourceimpl MediaLanguage
impl MediaLanguage
sourcepub fn parse_string(language: &str) -> MediaLanguage
pub fn parse_string(language: &str) -> MediaLanguage
Parse a string into a MediaLanguage struct
sourcepub fn with_weight(&self, weight: &str) -> MediaLanguage
pub fn with_weight(&self, weight: &str) -> MediaLanguage
Adds a quality weight to the media language
sourcepub fn matches(&self, other: &MediaLanguage) -> bool
pub fn matches(&self, other: &MediaLanguage) -> bool
If this media language matches the other media language
Trait Implementations
sourceimpl Clone for MediaLanguage
impl Clone for MediaLanguage
sourcefn clone(&self) -> MediaLanguage
fn clone(&self) -> MediaLanguage
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for MediaLanguage
impl Debug for MediaLanguage
sourceimpl PartialEq<MediaLanguage> for MediaLanguage
impl PartialEq<MediaLanguage> for MediaLanguage
sourcefn eq(&self, other: &MediaLanguage) -> bool
fn eq(&self, other: &MediaLanguage) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
sourcefn ne(&self, other: &MediaLanguage) -> bool
fn ne(&self, other: &MediaLanguage) -> bool
This method tests for !=
.
impl StructuralPartialEq for MediaLanguage
Auto Trait Implementations
impl RefUnwindSafe for MediaLanguage
impl Send for MediaLanguage
impl Sync for MediaLanguage
impl Unpin for MediaLanguage
impl UnwindSafe for MediaLanguage
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more