pub struct MediaLanguage {
pub main: String,
pub sub: String,
pub weight: f32,
}Expand description
Struct to represent a media language
Fields§
§main: StringMain type of the media language
sub: StringSub type of the media language
weight: f32Weight associated with the media language
Implementations§
source§impl 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§
source§impl Clone for MediaLanguage
impl Clone for MediaLanguage
source§fn clone(&self) -> MediaLanguage
fn clone(&self) -> MediaLanguage
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moresource§impl Debug for MediaLanguage
impl Debug for MediaLanguage
source§impl PartialEq<MediaLanguage> for MediaLanguage
impl PartialEq<MediaLanguage> for MediaLanguage
source§fn 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 ==.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§
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