pub struct Builder<E> { /* private fields */ }
Expand description
Http1 or Http2 connection builder.
Implementations§
source§impl<E> Builder<E>
impl<E> Builder<E>
sourcepub fn http1(&mut self) -> Http1Builder<'_, E>
pub fn http1(&mut self) -> Http1Builder<'_, E>
Http1 configuration.
sourcepub fn http2(&mut self) -> Http2Builder<'_, E>
pub fn http2(&mut self) -> Http2Builder<'_, E>
Http2 configuration.
sourcepub async fn serve_connection<I, S, B>(
&self,
io: I,
service: S
) -> Result<(), Box<dyn Error + Send + Sync>>where
S: Service<Request<Incoming>, Response = Response<B>>,
S::Future: 'static,
S::Error: Into<Box<dyn StdError + Send + Sync>>,
B: Body + 'static,
B::Error: Into<Box<dyn StdError + Send + Sync>>,
I: Read + Write + Unpin + 'static,
E: Http2ServerConnExec<S::Future, B>,
pub async fn serve_connection<I, S, B>( &self, io: I, service: S ) -> Result<(), Box<dyn Error + Send + Sync>>where S: Service<Request<Incoming>, Response = Response<B>>, S::Future: 'static, S::Error: Into<Box<dyn StdError + Send + Sync>>, B: Body + 'static, B::Error: Into<Box<dyn StdError + Send + Sync>>, I: Read + Write + Unpin + 'static, E: Http2ServerConnExec<S::Future, B>,
Bind a connection together with a Service
.
sourcepub async fn serve_connection_with_upgrades<I, S, B>(
&self,
io: I,
service: S
) -> Result<(), Box<dyn Error + Send + Sync>>where
S: Service<Request<Incoming>, Response = Response<B>>,
S::Future: 'static,
S::Error: Into<Box<dyn StdError + Send + Sync>>,
B: Body + 'static,
B::Error: Into<Box<dyn StdError + Send + Sync>>,
I: Read + Write + Unpin + Send + 'static,
E: Http2ServerConnExec<S::Future, B>,
pub async fn serve_connection_with_upgrades<I, S, B>( &self, io: I, service: S ) -> Result<(), Box<dyn Error + Send + Sync>>where S: Service<Request<Incoming>, Response = Response<B>>, S::Future: 'static, S::Error: Into<Box<dyn StdError + Send + Sync>>, B: Body + 'static, B::Error: Into<Box<dyn StdError + Send + Sync>>, I: Read + Write + Unpin + Send + 'static, E: Http2ServerConnExec<S::Future, B>,
Bind a connection together with a Service
, with the ability to
handle HTTP upgrades. This requires that the IO object implements
Send
.
Auto Trait Implementations§
impl<E> !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> !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