Struct Builder
pub struct Builder { /* private fields */ }http-backend and http and std only.Expand description
Http1 or Http2 connection builder.
Implementations§
§impl Builder
impl Builder
pub fn maybe_with_header_read_timeout(
self,
timeout: Option<HeaderReadTimeout>,
) -> Builder
pub fn maybe_with_header_read_timeout( self, timeout: Option<HeaderReadTimeout>, ) -> Builder
Set the request-head deadline of both protocols.
Protocol detection follows the HTTP/1 deadline, as HTTP/1 serves a
connection that did not send the HTTP/2 preface in time.
Defaults to HeaderReadTimeout::DEFAULT; None disables it.
pub fn maybe_set_header_read_timeout(
&mut self,
timeout: Option<HeaderReadTimeout>,
) -> &mut Builder
pub fn maybe_set_header_read_timeout( &mut self, timeout: Option<HeaderReadTimeout>, ) -> &mut Builder
Set the request-head deadline of both protocols.
Protocol detection follows the HTTP/1 deadline, as HTTP/1 serves a
connection that did not send the HTTP/2 preface in time.
Defaults to HeaderReadTimeout::DEFAULT; None disables it.
pub fn with_header_read_timeout(self, timeout: HeaderReadTimeout) -> Builder
pub fn with_header_read_timeout(self, timeout: HeaderReadTimeout) -> Builder
Set the request-head deadline of both protocols.
Protocol detection follows the HTTP/1 deadline, as HTTP/1 serves a
connection that did not send the HTTP/2 preface in time.
Defaults to HeaderReadTimeout::DEFAULT; None disables it.
pub fn set_header_read_timeout(
&mut self,
timeout: HeaderReadTimeout,
) -> &mut Builder
pub fn set_header_read_timeout( &mut self, timeout: HeaderReadTimeout, ) -> &mut Builder
Set the request-head deadline of both protocols.
Protocol detection follows the HTTP/1 deadline, as HTTP/1 serves a
connection that did not send the HTTP/2 preface in time.
Defaults to HeaderReadTimeout::DEFAULT; None disables it.
pub fn without_header_read_timeout(self) -> Builder
pub fn without_header_read_timeout(self) -> Builder
Set the request-head deadline of both protocols.
Protocol detection follows the HTTP/1 deadline, as HTTP/1 serves a
connection that did not send the HTTP/2 preface in time.
Defaults to HeaderReadTimeout::DEFAULT; None disables it.
pub fn unset_header_read_timeout(&mut self) -> &mut Builder
pub fn unset_header_read_timeout(&mut self) -> &mut Builder
Set the request-head deadline of both protocols.
Protocol detection follows the HTTP/1 deadline, as HTTP/1 serves a
connection that did not send the HTTP/2 preface in time.
Defaults to HeaderReadTimeout::DEFAULT; None disables it.
pub fn maybe_with_idle_timeout(self, timeout: Option<IdleTimeout>) -> Builder
pub fn maybe_with_idle_timeout(self, timeout: Option<IdleTimeout>) -> Builder
Set the idle budget of both protocols.
Protocol detection follows the HTTP/1 budget, and the detected
protocol continues the window it started.
Defaults to IdleTimeout::DEFAULT; None disables it.
pub fn maybe_set_idle_timeout(
&mut self,
timeout: Option<IdleTimeout>,
) -> &mut Builder
pub fn maybe_set_idle_timeout( &mut self, timeout: Option<IdleTimeout>, ) -> &mut Builder
Set the idle budget of both protocols.
Protocol detection follows the HTTP/1 budget, and the detected
protocol continues the window it started.
Defaults to IdleTimeout::DEFAULT; None disables it.
pub fn with_idle_timeout(self, timeout: IdleTimeout) -> Builder
pub fn with_idle_timeout(self, timeout: IdleTimeout) -> Builder
Set the idle budget of both protocols.
Protocol detection follows the HTTP/1 budget, and the detected
protocol continues the window it started.
Defaults to IdleTimeout::DEFAULT; None disables it.
pub fn set_idle_timeout(&mut self, timeout: IdleTimeout) -> &mut Builder
pub fn set_idle_timeout(&mut self, timeout: IdleTimeout) -> &mut Builder
Set the idle budget of both protocols.
Protocol detection follows the HTTP/1 budget, and the detected
protocol continues the window it started.
Defaults to IdleTimeout::DEFAULT; None disables it.
pub fn without_idle_timeout(self) -> Builder
pub fn without_idle_timeout(self) -> Builder
Set the idle budget of both protocols.
Protocol detection follows the HTTP/1 budget, and the detected
protocol continues the window it started.
Defaults to IdleTimeout::DEFAULT; None disables it.
pub fn unset_idle_timeout(&mut self) -> &mut Builder
pub fn unset_idle_timeout(&mut self) -> &mut Builder
Set the idle budget of both protocols.
Protocol detection follows the HTTP/1 budget, and the detected
protocol continues the window it started.
Defaults to IdleTimeout::DEFAULT; None disables it.
pub fn h2_only(self) -> Builder
pub fn h2_only(self) -> Builder
Only accepts HTTP/2
Does not do anything if used with serve_connection_with_upgrades
pub fn http1_only(self) -> Builder
pub fn http1_only(self) -> Builder
Only accepts HTTP/1
Does not do anything if used with serve_connection_with_upgrades
pub 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.
pub 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.
pub fn max_concurrent_streams(&self) -> u32
pub fn max_concurrent_streams(&self) -> u32
Gets the SETTINGS_MAX_CONCURRENT_STREAMS option used
for HTTP2 connections.
pub fn serve_connection<I, S>(&self, io: I, service: S) -> Connection<'_, I, S> ⓘ
pub fn serve_connection<I, S>(&self, io: I, service: S) -> Connection<'_, I, S> ⓘ
Bind a connection together with a Service.
pub fn serve_connection_with_upgrades<I, S>(
&self,
io: I,
service: S,
) -> UpgradeableConnection<'_, I, S> ⓘ
pub fn serve_connection_with_upgrades<I, S>( &self, io: I, service: S, ) -> UpgradeableConnection<'_, I, S> ⓘ
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 Freeze for Builder
impl RefUnwindSafe for Builder
impl Send for Builder
impl Sync for Builder
impl Unpin for Builder
impl UnsafeUnpin for Builder
impl UnwindSafe for Builder
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> FutureExt for T
impl<T> FutureExt for T
§fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
§fn with_current_context(self) -> WithContext<Self> ⓘ
fn with_current_context(self) -> WithContext<Self> ⓘ
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
§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 more§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a rama_grpc::Request§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
§fn and<P, B, E>(self, other: P) -> And<T, P>
fn and<P, B, E>(self, other: P) -> And<T, P>
Policy that returns Action::Follow only if self and other return
Action::Follow. Read more