pub struct ContentType<C, E> { /* private fields */ }Expand description
An endpoint that enforces a specific request Content-Type.
Requests without the correct Content-Type header are rejected with 415 Unsupported Media Type before the handler is called.
ⓘ
type API = (
ContentType<JsonContent, PostEndpoint<UsersPath, CreateUser, User>>,
);Trait Implementations§
Source§impl<C: ContentTypeMarker, E: BindableEndpoint> BindableEndpoint for ContentType<C, E>
impl<C: ContentTypeMarker, E: BindableEndpoint> BindableEndpoint for ContentType<C, E>
impl<C: ContentTypeMarker, E: ApiSpec> ApiSpec for ContentType<C, E>
Auto Trait Implementations§
impl<C, E> Freeze for ContentType<C, E>
impl<C, E> RefUnwindSafe for ContentType<C, E>where
C: RefUnwindSafe,
E: RefUnwindSafe,
impl<C, E> Send for ContentType<C, E>
impl<C, E> Sync for ContentType<C, E>
impl<C, E> Unpin for ContentType<C, E>
impl<C, E> UnsafeUnpin for ContentType<C, E>
impl<C, E> UnwindSafe for ContentType<C, E>where
C: UnwindSafe,
E: UnwindSafe,
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