pub struct Html<T>(pub T);
Expand description
An HTML response.
Will automatically get Content-Type: text/html
.
Tuple Fieldsยง
ยง0: T
Trait Implementationsยง
Sourceยงimpl<T> IntoResponse for Html<T>
impl<T> IntoResponse for Html<T>
Sourceยงfn into_response(self) -> Response<UnsyncBoxBody<Bytes, Error>>
fn into_response(self) -> Response<UnsyncBoxBody<Bytes, Error>>
Create a response.
impl<T> Copy for Html<T>where
T: Copy,
Auto Trait Implementationsยง
impl<T> Freeze for Html<T>where
T: Freeze,
impl<T> RefUnwindSafe for Html<T>where
T: RefUnwindSafe,
impl<T> Send for Html<T>where
T: Send,
impl<T> Sync for Html<T>where
T: Sync,
impl<T> Unpin for Html<T>where
T: Unpin,
impl<T> UnwindSafe for Html<T>where
T: 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
Sourceยงimpl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Sourceยงimpl<T, S, B> Handler<IntoResponseHandler, S, B> for T
impl<T, S, B> Handler<IntoResponseHandler, S, B> for T
Sourceยงtype Future = Ready<Response<UnsyncBoxBody<Bytes, Error>>>
type Future = Ready<Response<UnsyncBoxBody<Bytes, Error>>>
The type of future calling this handler returns.
Sourceยงfn call(
self,
_req: Request<B>,
_state: S,
) -> <T as Handler<IntoResponseHandler, S, B>>::Future
fn call( self, _req: Request<B>, _state: S, ) -> <T as Handler<IntoResponseHandler, S, B>>::Future
Call the handler with the given request.
Sourceยงfn layer<L, NewReqBody>(self, layer: L) -> Layered<L, Self, T, S, B, NewReqBody>where
L: Layer<HandlerService<Self, T, S, B>> + Clone,
<L as Layer<HandlerService<Self, T, S, B>>>::Service: Service<Request<NewReqBody>>,
fn layer<L, NewReqBody>(self, layer: L) -> Layered<L, Self, T, S, B, NewReqBody>where
L: Layer<HandlerService<Self, T, S, B>> + Clone,
<L as Layer<HandlerService<Self, T, S, B>>>::Service: Service<Request<NewReqBody>>,
Apply a
tower::Layer
to the handler. Read moreSourceยงfn with_state(self, state: S) -> HandlerService<Self, T, S, B>
fn with_state(self, state: S) -> HandlerService<Self, T, S, B>
Convert the handler into a
Service
by providing the stateSourceยงimpl<H, T, B> HandlerWithoutStateExt<T, B> for H
impl<H, T, B> HandlerWithoutStateExt<T, B> for H
Sourceยงfn into_service(self) -> HandlerService<H, T, (), B>
fn into_service(self) -> HandlerService<H, T, (), B>
Convert the handler into a
Service
and no state.Sourceยงfn into_make_service(self) -> IntoMakeService<HandlerService<H, T, (), B>>
fn into_make_service(self) -> IntoMakeService<HandlerService<H, T, (), B>>
Convert the handler into a
MakeService
and no state. Read moreSourceยงfn into_make_service_with_connect_info<C>(
self,
) -> IntoMakeServiceWithConnectInfo<HandlerService<H, T, (), B>, C>
fn into_make_service_with_connect_info<C>( self, ) -> IntoMakeServiceWithConnectInfo<HandlerService<H, T, (), B>, C>
Convert the handler into a
MakeService
which stores information
about the incoming connection and has no state. Read more