pub struct Builder<E> { /* private fields */ }
Available on crate feature
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 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
.
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
Mutably borrows from an owned value. Read more
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)