pub struct Connection<'a, I, S, E>where
S: HttpService<Incoming>,{ /* private fields */ }
Expand description
A Future
representing an HTTP/1 connection, returned from
Builder::serve_connection
.
To drive HTTP on this connection this future must be polled, typically with
.await
. If it isn’t polled, no progress will be made on this connection.
Implementations§
Source§impl<I, S, E, B> Connection<'_, I, S, E>
impl<I, S, E, B> Connection<'_, I, S, E>
Sourcepub fn graceful_shutdown(self: Pin<&mut Self>)
pub fn graceful_shutdown(self: Pin<&mut Self>)
Start a graceful shutdown process for this connection.
This Connection
should continue to be polled until shutdown can finish.
§Note
This should only be called while the Connection
future is still pending. If called after
Connection::poll
has resolved, this does nothing.
Sourcepub fn into_owned(self) -> Connection<'static, I, S, E> ⓘ
pub fn into_owned(self) -> Connection<'static, I, S, E> ⓘ
Make this Connection static, instead of borrowing from Builder.
Trait Implementations§
Source§impl<I, S, E, B> Future for Connection<'_, I, S, E>
impl<I, S, E, B> Future for Connection<'_, I, S, E>
impl<'__pin, 'a, I, S, E> Unpin for Connection<'a, I, S, E>
Auto Trait Implementations§
impl<'a, I, S, E> !Freeze for Connection<'a, I, S, E>
impl<'a, I, S, E> !RefUnwindSafe for Connection<'a, I, S, E>
impl<'a, I, S, E> Send for Connection<'a, I, S, E>
impl<'a, I, S, E> Sync for Connection<'a, I, S, E>
impl<'a, I, S, E> !UnwindSafe for Connection<'a, I, S, E>
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<F> IntoFuture for Fwhere
F: Future,
impl<F> IntoFuture for Fwhere
F: Future,
Source§type IntoFuture = F
type IntoFuture = F
Which kind of future are we turning this into?
Source§fn into_future(self) -> <F as IntoFuture>::IntoFuture
fn into_future(self) -> <F as IntoFuture>::IntoFuture
Creates a future from a value. Read more