pub struct AcceptHeader {
pub preferred: OutputFormat,
pub media_types: Vec<MediaTypeEntry>,
}Expand description
Parsed Accept header with quality values
Parses Accept headers like:
application/jsonapplication/toonapplication/json, application/toon;q=0.9*/*
Fields§
§preferred: OutputFormatPreferred format based on Accept header parsing
media_types: Vec<MediaTypeEntry>Raw media types with quality values (sorted by quality, descending)
Implementations§
Source§impl AcceptHeader
impl AcceptHeader
Sourcepub fn accepts_toon(&self) -> bool
pub fn accepts_toon(&self) -> bool
Check if TOON format is acceptable
Sourcepub fn accepts_json(&self) -> bool
pub fn accepts_json(&self) -> bool
Check if JSON format is acceptable
Trait Implementations§
Source§impl Clone for AcceptHeader
impl Clone for AcceptHeader
Source§fn clone(&self) -> AcceptHeader
fn clone(&self) -> AcceptHeader
Returns a duplicate 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 AcceptHeader
impl Debug for AcceptHeader
Source§impl Default for AcceptHeader
impl Default for AcceptHeader
Source§impl FromRequestParts for AcceptHeader
impl FromRequestParts for AcceptHeader
Source§fn from_request_parts(req: &Request) -> Result<Self>
fn from_request_parts(req: &Request) -> Result<Self>
Extract from request parts
Source§impl OperationModifier for AcceptHeader
impl OperationModifier for AcceptHeader
Source§fn update_operation(_op: &mut Operation)
fn update_operation(_op: &mut Operation)
Update the operation
Auto Trait Implementations§
impl Freeze for AcceptHeader
impl RefUnwindSafe for AcceptHeader
impl Send for AcceptHeader
impl Sync for AcceptHeader
impl Unpin for AcceptHeader
impl UnwindSafe for AcceptHeader
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> FromRequest for Twhere
T: FromRequestParts,
impl<T> FromRequest for Twhere
T: FromRequestParts,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more