pub struct Builder<E = TokioExecutor> { /* private fields */ }Expand description
A builder for creating connections which automatically detect the HTTP protocol version.
This builder also requires that the server support upgrades from HTTP/1 to HTTP/2.
Implementations§
Source§impl<E> Builder<E>
impl<E> Builder<E>
Sourcepub fn serve_connection_with_upgrades<I, S, B>(
&self,
io: I,
service: S,
) -> UpgradableConnection<'_, I, S, E> ⓘ
pub fn serve_connection_with_upgrades<I, S, B>( &self, io: I, service: S, ) -> UpgradableConnection<'_, I, S, E> ⓘ
Serve a connection with automatic protocol detection.
Trait Implementations§
Source§impl<S, IO, BIn, BOut, E> Protocol<S, IO, Request<BIn>> for Builder<E>where
S: Service<Request<BIn>, Response = Response<BOut>> + Clone + Send + 'static,
S::Future: Send + 'static,
S::Error: Into<Box<dyn Error + Send + Sync>>,
BIn: Body + From<Incoming> + 'static,
BOut: Body + Send + 'static,
BOut::Data: Send + 'static,
BOut::Error: Into<Box<dyn Error + Send + Sync>>,
IO: AsyncRead + AsyncWrite + Send + Unpin + 'static,
E: Http2ServerConnExec<<TowerHyperService<IncomingRequestService<S, BIn, BOut>> as HttpService<Incoming>>::Future, BOut> + Clone + Send + Sync + 'static,
impl<S, IO, BIn, BOut, E> Protocol<S, IO, Request<BIn>> for Builder<E>where
S: Service<Request<BIn>, Response = Response<BOut>> + Clone + Send + 'static,
S::Future: Send + 'static,
S::Error: Into<Box<dyn Error + Send + Sync>>,
BIn: Body + From<Incoming> + 'static,
BOut: Body + Send + 'static,
BOut::Data: Send + 'static,
BOut::Error: Into<Box<dyn Error + Send + Sync>>,
IO: AsyncRead + AsyncWrite + Send + Unpin + 'static,
E: Http2ServerConnExec<<TowerHyperService<IncomingRequestService<S, BIn, BOut>> as HttpService<Incoming>>::Future, BOut> + Clone + Send + Sync + 'static,
Source§type Connection = Connecting<S, IO, BIn, BOut, E>
type Connection = Connecting<S, IO, BIn, BOut, E>
The connection future, used to drive a connection IO to completion.
Source§type Error = ConnectionError
type Error = ConnectionError
The error when a connection has a problem.
Source§fn serve_connection(&self, stream: IO, service: S) -> Self::Connection
fn serve_connection(&self, stream: IO, service: S) -> Self::Connection
Serve a connection with possible upgrades. Read more
Auto Trait Implementations§
impl<E> Freeze for Builder<E>where
E: Freeze,
impl<E = TokioExecutor> !RefUnwindSafe for Builder<E>
impl<E> Send for Builder<E>where
E: Send,
impl<E> Sync for Builder<E>where
E: Sync,
impl<E> Unpin for Builder<E>where
E: Unpin,
impl<E = TokioExecutor> !UnwindSafe for Builder<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<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<R> FirstAddrExt for R
impl<R> FirstAddrExt for R
Source§fn first_addr(self) -> FirstAddrResolver<Self>where
Self: Sized,
fn first_addr(self) -> FirstAddrResolver<Self>where
Self: Sized,
Convert this resolver into a
FirstAddrResolver. Read more