Struct webmachine_rust::content_negotiation::MediaType
[−]
[src]
pub struct MediaType {
pub main: String,
pub sub: String,
pub weight: f32,
}Struct to represent a media type
Fields
main: String
Main type of the media type
sub: String
Sub type of the media type
weight: f32
Weight associated with the media type
Methods
impl MediaType[src]
fn parse_string(media_type: &String) -> MediaType
Parse a string into a MediaType struct
fn with_weight(&self, weight: &String) -> MediaType
Adds a quality weight to the media type
fn weight(&self) -> (f32, u8)
Returns a weighting for this media type
fn matches(&self, other: &MediaType) -> MediaTypeMatch
If this media type matches the other media type
fn to_string(&self) -> String
Converts this media type into a string
Trait Implementations
impl Debug for MediaType[src]
impl Clone for MediaType[src]
fn clone(&self) -> MediaType
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)1.0.0
Performs copy-assignment from source. Read more