pub struct ContentNegotiationMiddleware { /* private fields */ }
Expand description
Middleware for HTTP content negotiation
Implementations§
Source§impl ContentNegotiationMiddleware
impl ContentNegotiationMiddleware
Sourcepub fn with_config(config: ContentNegotiationConfig) -> Self
pub fn with_config(config: ContentNegotiationConfig) -> Self
Create with custom configuration
Sourcepub fn default_type(self, content_type: ContentType) -> Self
pub fn default_type(self, content_type: ContentType) -> Self
Set default content type
Sourcepub fn support(self, content_type: ContentType) -> Self
pub fn support(self, content_type: ContentType) -> Self
Add supported content type
Sourcepub fn converter<F>(self, content_type: ContentType, converter: F) -> Self
pub fn converter<F>(self, content_type: ContentType, converter: F) -> Self
Add custom converter for content type
Sourcepub fn no_vary_header(self) -> Self
pub fn no_vary_header(self) -> Self
Disable Vary header
Trait Implementations§
Source§impl Debug for ContentNegotiationMiddleware
impl Debug for ContentNegotiationMiddleware
Source§impl Middleware for ContentNegotiationMiddleware
impl Middleware for ContentNegotiationMiddleware
Source§fn handle(&self, request: ElifRequest, next: Next) -> NextFuture<'static>
fn handle(&self, request: ElifRequest, next: Next) -> NextFuture<'static>
Handle the request and call the next middleware in the chain
Auto Trait Implementations§
impl Freeze for ContentNegotiationMiddleware
impl !RefUnwindSafe for ContentNegotiationMiddleware
impl Send for ContentNegotiationMiddleware
impl Sync for ContentNegotiationMiddleware
impl Unpin for ContentNegotiationMiddleware
impl !UnwindSafe for ContentNegotiationMiddleware
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