Struct shuttle_next::body::Empty
source · pub struct Empty<D> { /* private fields */ }
Expand description
A body that is always empty.
Implementations§
Trait Implementations§
source§impl<D> Body for Empty<D>where
D: Buf,
impl<D> Body for Empty<D>where
D: Buf,
§type Error = Infallible
type Error = Infallible
The error type this
Body
might generate.source§fn poll_data(
self: Pin<&mut Empty<D>>,
_cx: &mut Context<'_>
) -> Poll<Option<Result<<Empty<D> as Body>::Data, <Empty<D> as Body>::Error>>>
fn poll_data( self: Pin<&mut Empty<D>>, _cx: &mut Context<'_> ) -> Poll<Option<Result<<Empty<D> as Body>::Data, <Empty<D> as Body>::Error>>>
Attempt to pull out the next data buffer of this stream.
source§fn poll_trailers(
self: Pin<&mut Empty<D>>,
_cx: &mut Context<'_>
) -> Poll<Result<Option<HeaderMap>, <Empty<D> as Body>::Error>>
fn poll_trailers( self: Pin<&mut Empty<D>>, _cx: &mut Context<'_> ) -> Poll<Result<Option<HeaderMap>, <Empty<D> as Body>::Error>>
Poll for an optional single
HeaderMap
of trailers. Read moresource§fn is_end_stream(&self) -> bool
fn is_end_stream(&self) -> bool
Returns
true
when the end of stream has been reached. Read moresource§fn size_hint(&self) -> SizeHint
fn size_hint(&self) -> SizeHint
Returns the bounds on the remaining length of the stream. Read more
source§fn trailers(&mut self) -> Trailers<'_, Self>
fn trailers(&mut self) -> Trailers<'_, Self>
Returns future that resolves to trailers, if any.
source§fn map_data<F, B>(self, f: F) -> MapData<Self, F>
fn map_data<F, B>(self, f: F) -> MapData<Self, F>
Maps this body’s data value to a different value.
source§fn map_err<F, E>(self, f: F) -> MapErr<Self, F>
fn map_err<F, E>(self, f: F) -> MapErr<Self, F>
Maps this body’s error value to a different value.
source§fn collect(self) -> Collect<Self>where
Self: Sized,
fn collect(self) -> Collect<Self>where
Self: Sized,
Turn this body into
Collected
body which will collect all the DATA frames
and trailers.source§fn boxed_unsync(self) -> UnsyncBoxBody<Self::Data, Self::Error>
fn boxed_unsync(self) -> UnsyncBoxBody<Self::Data, Self::Error>
Turn this body into a boxed trait object that is !Sync.
source§impl IntoResponse for Empty<Bytes>
impl IntoResponse for Empty<Bytes>
source§fn into_response(self) -> Response<UnsyncBoxBody<Bytes, Error>>
fn into_response(self) -> Response<UnsyncBoxBody<Bytes, Error>>
Create a response.
impl<D> Copy for Empty<D>
Auto Trait Implementations§
impl<D> RefUnwindSafe for Empty<D>
impl<D> Send for Empty<D>
impl<D> Sync for Empty<D>
impl<D> Unpin for Empty<D>
impl<D> UnwindSafe for Empty<D>
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, S, B> Handler<IntoResponseHandler, S, B> for T
impl<T, S, B> Handler<IntoResponseHandler, S, B> for T
§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 more