Struct HttpServiceConnector
pub struct HttpServiceConnector<S> { /* private fields */ }http and std only.Expand description
Discover and select an HTTP service before invoking an inner route connector.
The inner connector honors TargetHttpVersion or rejects unsupported
protocols and routes before network I/O with ConnectionErrorDomain::Local
and ConnectionErrorKind::Unavailable. Such refusals leave cached endpoint
health and the network-attempt budget unchanged; no capability list is needed.
Implementations§
§impl<S> HttpServiceConnector<S>
impl<S> HttpServiceConnector<S>
pub fn new(inner: S) -> HttpServiceConnector<S>
pub fn into_inner(self) -> S
pub fn into_inner(self) -> S
Consumes self, returning the underlying service.
pub fn maybe_with_cache(
self,
cache: Option<AltSvcCache>,
) -> HttpServiceConnector<S>
pub fn maybe_with_cache( self, cache: Option<AltSvcCache>, ) -> HttpServiceConnector<S>
Share cached candidates and HTTP/2 frame learning; None disables both.
Response observation is composed separately with AltSvcLayer.
pub fn maybe_set_cache(
&mut self,
cache: Option<AltSvcCache>,
) -> &mut HttpServiceConnector<S>
pub fn maybe_set_cache( &mut self, cache: Option<AltSvcCache>, ) -> &mut HttpServiceConnector<S>
Share cached candidates and HTTP/2 frame learning; None disables both.
Response observation is composed separately with AltSvcLayer.
pub fn with_cache(self, cache: AltSvcCache) -> HttpServiceConnector<S>
pub fn with_cache(self, cache: AltSvcCache) -> HttpServiceConnector<S>
Share cached candidates and HTTP/2 frame learning; None disables both.
Response observation is composed separately with AltSvcLayer.
pub fn set_cache(&mut self, cache: AltSvcCache) -> &mut HttpServiceConnector<S>
pub fn set_cache(&mut self, cache: AltSvcCache) -> &mut HttpServiceConnector<S>
Share cached candidates and HTTP/2 frame learning; None disables both.
Response observation is composed separately with AltSvcLayer.
pub fn without_cache(self) -> HttpServiceConnector<S>
pub fn without_cache(self) -> HttpServiceConnector<S>
Share cached candidates and HTTP/2 frame learning; None disables both.
Response observation is composed separately with AltSvcLayer.
pub fn unset_cache(&mut self) -> &mut HttpServiceConnector<S>
pub fn unset_cache(&mut self) -> &mut HttpServiceConnector<S>
Share cached candidates and HTTP/2 frame learning; None disables both.
Response observation is composed separately with AltSvcLayer.
pub fn with_attempt_timeout(self, timeout: Duration) -> HttpServiceConnector<S>
pub fn with_attempt_timeout(self, timeout: Duration) -> HttpServiceConnector<S>
Bound one alternative connection attempt, including DNS and handshakes.
Defaults to 300 ms to bound sequential speculation before origin fallback. Increase this for high-latency paths; this connector does not race the origin.
pub fn set_attempt_timeout(
&mut self,
timeout: Duration,
) -> &mut HttpServiceConnector<S>
pub fn set_attempt_timeout( &mut self, timeout: Duration, ) -> &mut HttpServiceConnector<S>
Bound one alternative connection attempt, including DNS and handshakes.
Defaults to 300 ms to bound sequential speculation before origin fallback. Increase this for high-latency paths; this connector does not race the origin.
pub fn maybe_with_timeout(
self,
timeout: Option<Duration>,
) -> HttpServiceConnector<S>
pub fn maybe_with_timeout( self, timeout: Option<Duration>, ) -> HttpServiceConnector<S>
Bound the complete selection operation, including origin fallback. Disabled by default; the caller’s transport deadlines remain authoritative.
pub fn maybe_set_timeout(
&mut self,
timeout: Option<Duration>,
) -> &mut HttpServiceConnector<S>
pub fn maybe_set_timeout( &mut self, timeout: Option<Duration>, ) -> &mut HttpServiceConnector<S>
Bound the complete selection operation, including origin fallback. Disabled by default; the caller’s transport deadlines remain authoritative.
pub fn with_timeout(self, timeout: Duration) -> HttpServiceConnector<S>
pub fn with_timeout(self, timeout: Duration) -> HttpServiceConnector<S>
Bound the complete selection operation, including origin fallback. Disabled by default; the caller’s transport deadlines remain authoritative.
pub fn set_timeout(&mut self, timeout: Duration) -> &mut HttpServiceConnector<S>
pub fn set_timeout(&mut self, timeout: Duration) -> &mut HttpServiceConnector<S>
Bound the complete selection operation, including origin fallback. Disabled by default; the caller’s transport deadlines remain authoritative.
pub fn without_timeout(self) -> HttpServiceConnector<S>
pub fn without_timeout(self) -> HttpServiceConnector<S>
Bound the complete selection operation, including origin fallback. Disabled by default; the caller’s transport deadlines remain authoritative.
pub fn unset_timeout(&mut self) -> &mut HttpServiceConnector<S>
pub fn unset_timeout(&mut self) -> &mut HttpServiceConnector<S>
Bound the complete selection operation, including origin fallback. Disabled by default; the caller’s transport deadlines remain authoritative.
pub fn with_max_candidates(self, count: usize) -> HttpServiceConnector<S>
pub fn with_max_candidates(self, count: usize) -> HttpServiceConnector<S>
Bound inspected candidates, including unknown or unsupported protocols.
Defaults to 16, matching the cache’s default advertisement capacity.
Zero bypasses alternatives. Local capability refusals do not consume
max_attempts, so this separately bounds caller-supplied candidate lists.
pub fn set_max_candidates(
&mut self,
count: usize,
) -> &mut HttpServiceConnector<S>
pub fn set_max_candidates( &mut self, count: usize, ) -> &mut HttpServiceConnector<S>
Bound inspected candidates, including unknown or unsupported protocols.
Defaults to 16, matching the cache’s default advertisement capacity.
Zero bypasses alternatives. Local capability refusals do not consume
max_attempts, so this separately bounds caller-supplied candidate lists.
pub fn with_max_attempts(self, count: usize) -> HttpServiceConnector<S>
pub fn with_max_attempts(self, count: usize) -> HttpServiceConnector<S>
Bound attempts, including the reserved origin fallback attempt.
pub fn set_max_attempts(&mut self, count: usize) -> &mut HttpServiceConnector<S>
pub fn set_max_attempts(&mut self, count: usize) -> &mut HttpServiceConnector<S>
Bound attempts, including the reserved origin fallback attempt.
Trait Implementations§
§impl<S> Clone for HttpServiceConnector<S>where
S: Clone,
impl<S> Clone for HttpServiceConnector<S>where
S: Clone,
§fn clone(&self) -> HttpServiceConnector<S>
fn clone(&self) -> HttpServiceConnector<S>
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more§impl<S> Debug for HttpServiceConnector<S>where
S: Debug,
impl<S> Debug for HttpServiceConnector<S>where
S: Debug,
§impl<S> Service<ConnectRequest> for HttpServiceConnector<S>where
S: ConnectorService<ConnectRequest>,
<S as ConnectorService<ConnectRequest>>::Connection: ExtensionsRef,
impl<S> Service<ConnectRequest> for HttpServiceConnector<S>where
S: ConnectorService<ConnectRequest>,
<S as ConnectorService<ConnectRequest>>::Connection: ExtensionsRef,
§type Output = EstablishedClientConnection<<S as ConnectorService<ConnectRequest>>::Connection, ConnectRequest>
type Output = EstablishedClientConnection<<S as ConnectorService<ConnectRequest>>::Connection, ConnectRequest>
§type Error = ConnectionError
type Error = ConnectionError
§async fn serve(
&self,
input: ConnectRequest,
) -> Result<<HttpServiceConnector<S> as Service<ConnectRequest>>::Output, <HttpServiceConnector<S> as Service<ConnectRequest>>::Error>
async fn serve( &self, input: ConnectRequest, ) -> Result<<HttpServiceConnector<S> as Service<ConnectRequest>>::Output, <HttpServiceConnector<S> as Service<ConnectRequest>>::Error>
§fn boxed(self) -> BoxService<Input, Self::Output, Self::Error>
fn boxed(self) -> BoxService<Input, Self::Output, Self::Error>
Auto Trait Implementations§
impl<S> !RefUnwindSafe for HttpServiceConnector<S>
impl<S> !UnwindSafe for HttpServiceConnector<S>
impl<S> Freeze for HttpServiceConnector<S>where
S: Freeze,
impl<S> Send for HttpServiceConnector<S>where
S: Send,
impl<S> Sync for HttpServiceConnector<S>where
S: Sync,
impl<S> Unpin for HttpServiceConnector<S>where
S: Unpin,
impl<S> UnsafeUnpin for HttpServiceConnector<S>where
S: UnsafeUnpin,
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<S, Input, Connection> ConnectorService<Input> for Swhere
S: Service<Input, Output = EstablishedClientConnection<Connection, Input>>,
<S as Service<Input>>::Error: Into<ConnectionError>,
Connection: Send + ExtensionsRef,
impl<S, Input, Connection> ConnectorService<Input> for Swhere
S: Service<Input, Output = EstablishedClientConnection<Connection, Input>>,
<S as Service<Input>>::Error: Into<ConnectionError>,
Connection: Send + ExtensionsRef,
§type Connection = Connection
type Connection = Connection
ConnectorService§fn connect(
&self,
input: Input,
) -> impl Future<Output = Result<EstablishedClientConnection<<S as ConnectorService<Input>>::Connection, Input>, ConnectionError>> + Send
fn connect( &self, input: Input, ) -> impl Future<Output = Result<EstablishedClientConnection<<S as ConnectorService<Input>>::Connection, Input>, ConnectionError>> + Send
§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