pub struct Builder<E> { /* private fields */ }
server
and (crate features http1
or http2
) only.Expand description
Http1 or Http2 connection builder.
Implementations§
Source§impl<E> Builder<E>
impl<E> Builder<E>
Sourcepub fn http1(&mut self) -> Http1Builder<'_, E>
Available on crate feature http1
only.
pub fn http1(&mut self) -> Http1Builder<'_, E>
http1
only.Http1 configuration.
Sourcepub fn http2(&mut self) -> Http2Builder<'_, E>
Available on crate feature http2
only.
pub fn http2(&mut self) -> Http2Builder<'_, E>
http2
only.Http2 configuration.
Sourcepub fn http2_only(self) -> Self
Available on crate feature http2
only.
pub fn http2_only(self) -> Self
http2
only.Only accepts HTTP/2
Does not do anything if used with serve_connection_with_upgrades
Sourcepub fn http1_only(self) -> Self
Available on crate feature http1
only.
pub fn http1_only(self) -> Self
http1
only.Only accepts HTTP/1
Does not do anything if used with serve_connection_with_upgrades
Sourcepub fn is_http1_available(&self) -> bool
pub fn is_http1_available(&self) -> bool
Returns true
if this builder can serve an HTTP/1.1-based connection.
Sourcepub fn is_http2_available(&self) -> bool
pub fn is_http2_available(&self) -> bool
Returns true
if this builder can serve an HTTP/2-based connection.
Sourcepub fn serve_connection<I, S, B>(
&self,
io: I,
service: S,
) -> Connection<'_, I, S, E> ⓘ
pub fn serve_connection<I, S, B>( &self, io: I, service: S, ) -> Connection<'_, I, S, E> ⓘ
Bind a connection together with a Service
.
Sourcepub fn serve_connection_with_upgrades<I, S, B>(
&self,
io: I,
service: S,
) -> UpgradeableConnection<'_, I, S, E> ⓘ
pub fn serve_connection_with_upgrades<I, S, B>( &self, io: I, service: S, ) -> UpgradeableConnection<'_, I, S, E> ⓘ
Bind a connection together with a Service
, with the ability to
handle HTTP upgrades. This requires that the IO object implements
Send
.
Note that if you ever want to use hyper::upgrade::Upgraded::downcast
with this crate, you’ll need to use hyper_util::server::conn::auto::upgrade::downcast
instead. See the documentation of the latter to understand why.
Trait Implementations§
Auto Trait Implementations§
impl<E> Freeze for Builder<E>where
E: Freeze,
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> WithSubscriber for T
impl<T> WithSubscriber for T
Source§fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
Source§fn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Layout§
Note: Unable to compute type layout, possibly due to this type having generic parameters. Layout can only be computed for concrete, fully-instantiated types.