pub struct H3UpstreamHandle { /* private fields */ }Expand description
Per-upstream H3 transport handle: a QuicStreamPool plus the
per-upstream timeouts and shared stats. Stored on
super::upstream::UpstreamHandle for the H3 transport;
the LB, breaker, retry, and health layers are shared with the TCP/TLS
path (they operate on endpoint addresses, not the transport).
Implementations§
Source§impl H3UpstreamHandle
impl H3UpstreamHandle
Sourcepub fn new(
name: String,
roots: RootCertStore,
connect_timeout: Duration,
connection_cap: u32,
read_timeout: Option<Duration>,
stats: Arc<UpstreamStats>,
) -> Result<Self, H3Error>
pub fn new( name: String, roots: RootCertStore, connect_timeout: Duration, connection_cap: u32, read_timeout: Option<Duration>, stats: Arc<UpstreamStats>, ) -> Result<Self, H3Error>
Build an H3 handle for one upstream. roots is the trust store
(webpki default or the upstream’s trusted_ca_file bundle);
connection_cap bounds QUIC connections per endpoint; the sweep
task reaps idle connections every idle_timeout / 2.
Sourcepub fn tls_config(&self) -> &Arc<ClientConfig>
pub fn tls_config(&self) -> &Arc<ClientConfig>
The shared rustls client config (trust roots + h3 ALPN); the QUIC active health probe reuses it so a probe and a proxied request trust the same roots.
Sourcepub fn live_count(&self, addr: SocketAddr) -> usize
pub fn live_count(&self, addr: SocketAddr) -> usize
Live pooled QUIC connection count for addr (observability/tests).
Sourcepub async fn send(
&self,
address: &str,
port: u16,
server_name: &str,
req: Request<Bytes>,
) -> Result<Response<Bytes>, UpstreamError>
pub async fn send( &self, address: &str, port: u16, server_name: &str, req: Request<Bytes>, ) -> Result<Response<Bytes>, UpstreamError>
Send an H3 request to the picked endpoint (address:port),
verifying the upstream’s server certificate against server_name
(the endpoint address by default; works for hostname endpoints and
IP endpoints with IP-SAN certificates). address is resolved to a
SocketAddr via getaddrinfo on the blocking pool (IP literals
short-circuit); the first resolved address dials — happy-eyeballs
racing across QUIC addresses is a follow-up. The per-attempt
read_timeout bounds the whole exchange (resolve + QUIC dial +
request write + response headers + body), mirroring the TCP/TLS
path’s per-attempt deadline. The shared stats count the request;
the pool counts new connections.
Trait Implementations§
Source§impl Debug for H3UpstreamHandle
impl Debug for H3UpstreamHandle
Auto Trait Implementations§
impl !Freeze for H3UpstreamHandle
impl !RefUnwindSafe for H3UpstreamHandle
impl Send for H3UpstreamHandle
impl Sync for H3UpstreamHandle
impl Unpin for H3UpstreamHandle
impl !UnwindSafe for H3UpstreamHandle
Blanket Implementations§
§impl<T> AnyExt for T
impl<T> AnyExt for T
§fn downcast_ref<T>(this: &Self) -> Option<&T>where
T: Any,
fn downcast_ref<T>(this: &Self) -> Option<&T>where
T: Any,
T behind reference§fn downcast_mut<T>(this: &mut Self) -> Option<&mut T>where
T: Any,
fn downcast_mut<T>(this: &mut Self) -> Option<&mut T>where
T: Any,
T behind mutable reference§fn downcast_rc<T>(this: Rc<Self>) -> Result<Rc<T>, Rc<Self>>where
T: Any,
fn downcast_rc<T>(this: Rc<Self>) -> Result<Rc<T>, Rc<Self>>where
T: Any,
T behind Rc pointer§fn downcast_arc<T>(this: Arc<Self>) -> Result<Arc<T>, Arc<Self>>where
T: Any,
fn downcast_arc<T>(this: Arc<Self>) -> Result<Arc<T>, Arc<Self>>where
T: Any,
T behind Arc pointer§fn downcast_box<T>(this: Box<Self>) -> Result<Box<T>, Box<Self>>where
T: Any,
fn downcast_box<T>(this: Box<Self>) -> Result<Box<T>, Box<Self>>where
T: Any,
T behind Box pointer§fn downcast_move<T>(this: Self) -> Option<T>
fn downcast_move<T>(this: Self) -> Option<T>
Self to T,
useful only in generic context as a workaround for specializationSource§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<T, X> CoerceTo<T> for Xwhere
T: CoerceFrom<X> + ?Sized,
impl<T, X> CoerceTo<T> for Xwhere
T: CoerceFrom<X> + ?Sized,
fn coerce_rc_to(self: Rc<X>) -> Rc<T>
fn coerce_box_to(self: Box<X>) -> Box<T>
fn coerce_ref_to(&self) -> &T
fn coerce_mut_to(&mut self) -> &mut T
§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