Struct QuicConnector
pub struct QuicConnector<E> { /* private fields */ }quic and std only.Expand description
Establishes authenticated QUIC connections from the endpoints its endpoint connector E
hands out (ClientEndpoint).
The TLS defaults can be overridden per request. A non-empty default ALPN offer is what the
connections serve: a request offer sharing none of it is replaced by it, and the protocol
negotiated must be one of it. Otherwise an offered protocol must be negotiated unless the
AlpnPolicy agrees it out of band (RFC 9001 §8.1). A
QuicProfile on the request applies to the client and transport. The origin hostname remains the TLS verification target even when routing
selects a different physical address.
Direct targets are raced over their addresses: an IP target directly, a name through the
candidates of an outer DNS connector, each attempt on its own endpoint from E with that
address as its ConnectorTarget. A request on a proxy route is not resolved here: E
must establish the route (publishing EstablishedProxyRoute) or the request is refused
before any attempt, so an explicit proxy is never bypassed. A request addressed to its own
MASQUE proxy (ProxyRoute::addresses_proxy) goes straight to the proxy and is published
as EstablishedProxyRoute::Forward.
Implementations§
§impl<E> QuicConnector<E>
impl<E> QuicConnector<E>
pub fn new(
endpoints: E,
tls: TlsClientConfig,
provider: Arc<dyn QuicClientConfigProvider>,
) -> QuicConnector<E>
pub fn new( endpoints: E, tls: TlsClientConfig, provider: Arc<dyn QuicClientConfigProvider>, ) -> QuicConnector<E>
Connections from the endpoints of endpoints, with tls defaults configured by
provider.
pub fn with_transport(self, transport: Arc<TransportConfig>) -> QuicConnector<E>
pub fn with_transport(self, transport: Arc<TransportConfig>) -> QuicConnector<E>
The transport connections start from; a request’s QuicProfile replaces it.
pub fn set_transport(
&mut self,
transport: Arc<TransportConfig>,
) -> &mut QuicConnector<E>
pub fn set_transport( &mut self, transport: Arc<TransportConfig>, ) -> &mut QuicConnector<E>
The transport connections start from; a request’s QuicProfile replaces it.
pub fn with_tls_config(self, tls: TlsClientConfig) -> QuicConnector<E>
pub fn with_tls_config(self, tls: TlsClientConfig) -> QuicConnector<E>
The TLS defaults; client configurations built from the previous ones are dropped.
pub fn set_tls_config(&mut self, tls: TlsClientConfig) -> &mut QuicConnector<E>
pub fn set_tls_config(&mut self, tls: TlsClientConfig) -> &mut QuicConnector<E>
The TLS defaults; client configurations built from the previous ones are dropped.
pub fn tls_config(&self) -> &TlsClientConfig
pub fn tls_config(&self) -> &TlsClientConfig
The fixed TLS defaults. Rebuild the pool when these defaults or behavior captured by native TLS hooks change.
pub fn tls_provider(&self) -> &Arc<dyn QuicClientConfigProvider> ⓘ
pub fn tls_provider(&self) -> &Arc<dyn QuicClientConfigProvider> ⓘ
Provider selection used for establishment and TLS pool identity.
pub fn transport(&self) -> &Arc<TransportConfig> ⓘ
pub fn transport(&self) -> &Arc<TransportConfig> ⓘ
The transport connections start from without a QuicProfile.
pub fn tls_config_for(&self, input: &ConnectRequest) -> TlsClientConfig
pub fn tls_config_for(&self, input: &ConnectRequest) -> TlsClientConfig
The TLS configuration a connection for input is established with: the defaults with
the request’s overrides, its ALPN offer kept within what the connections serve.
Trait Implementations§
§impl<E> Clone for QuicConnector<E>where
E: Clone,
impl<E> Clone for QuicConnector<E>where
E: Clone,
§fn clone(&self) -> QuicConnector<E>
fn clone(&self) -> QuicConnector<E>
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more§impl<E> Debug for QuicConnector<E>where
E: Debug,
impl<E> Debug for QuicConnector<E>where
E: Debug,
§impl<E> Service<ConnectRequest> for QuicConnector<E>
impl<E> Service<ConnectRequest> for QuicConnector<E>
§type Output = EstablishedClientConnection<Connection, ConnectRequest>
type Output = EstablishedClientConnection<Connection, ConnectRequest>
§type Error = ConnectionError
type Error = ConnectionError
§async fn serve(
&self,
input: ConnectRequest,
) -> Result<<QuicConnector<E> as Service<ConnectRequest>>::Output, <QuicConnector<E> as Service<ConnectRequest>>::Error>
async fn serve( &self, input: ConnectRequest, ) -> Result<<QuicConnector<E> as Service<ConnectRequest>>::Output, <QuicConnector<E> 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<E> !RefUnwindSafe for QuicConnector<E>
impl<E> !UnwindSafe for QuicConnector<E>
impl<E> Freeze for QuicConnector<E>where
E: Freeze,
impl<E> Send for QuicConnector<E>where
E: Send,
impl<E> Sync for QuicConnector<E>where
E: Sync,
impl<E> Unpin for QuicConnector<E>where
E: Unpin,
impl<E> UnsafeUnpin for QuicConnector<E>where
E: 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