Struct HttpsServiceLayer
pub struct HttpsServiceLayer<R = GlobalDnsResolver> { /* private fields */ }dns and http and std only.Expand description
Reusable HTTPS discovery configuration, independent of an easy client.
Implementations§
§impl HttpsServiceLayer
impl HttpsServiceLayer
pub fn new() -> HttpsServiceLayer
pub fn new() -> HttpsServiceLayer
Use the global resolver. ECH capability must be declared by the stack.
§impl<R> HttpsServiceLayer<R>
impl<R> HttpsServiceLayer<R>
pub fn is_ech_capable(&self) -> bool
pub fn is_ech_capable(&self) -> bool
Whether this stack has declared a backend capable of real ECH.
pub fn with_enabled(self, enabled: bool) -> HttpsServiceLayer<R>
pub fn with_enabled(self, enabled: bool) -> HttpsServiceLayer<R>
Enable discovery (default true); disabled layers pass requests through.
pub fn set_enabled(&mut self, enabled: bool) -> &mut HttpsServiceLayer<R>
pub fn set_enabled(&mut self, enabled: bool) -> &mut HttpsServiceLayer<R>
Enable discovery (default true); disabled layers pass requests through.
pub fn with_fail_on_discovery_error(self, enabled: bool) -> HttpsServiceLayer<R>
pub fn with_fail_on_discovery_error(self, enabled: bool) -> HttpsServiceLayer<R>
Reject HTTPS resolver/record errors and discovery timeouts (default false). Applies to the origin and each consulted Alt-Svc authority. Successful empty or incompatible answers still permit ordinary optional fallback. Enable this when resolver failures must not permit DNS fallback; this setting does not infer whether a resolver authenticates its answers.
pub fn set_fail_on_discovery_error(
&mut self,
enabled: bool,
) -> &mut HttpsServiceLayer<R>
pub fn set_fail_on_discovery_error( &mut self, enabled: bool, ) -> &mut HttpsServiceLayer<R>
Reject HTTPS resolver/record errors and discovery timeouts (default false). Applies to the origin and each consulted Alt-Svc authority. Successful empty or incompatible answers still permit ordinary optional fallback. Enable this when resolver failures must not permit DNS fallback; this setting does not infer whether a resolver authenticates its answers.
pub fn with_resolver<T>(self, resolver: T) -> HttpsServiceLayer<T>
pub fn with_resolver<T>(self, resolver: T) -> HttpsServiceLayer<T>
Resolve both HTTPS and address records with this resolver.
pub fn maybe_with_cache(
self,
cache: Option<AltSvcCache>,
) -> HttpsServiceLayer<R>
pub fn maybe_with_cache( self, cache: Option<AltSvcCache>, ) -> HttpsServiceLayer<R>
Compose fresh Alt-Svc advertisements from the selector’s cache. Supply the same cache to both layers. When DNS supplies candidates, this layer owns composition; an unrelated inner cache is not merged.
pub fn maybe_set_cache(
&mut self,
cache: Option<AltSvcCache>,
) -> &mut HttpsServiceLayer<R>
pub fn maybe_set_cache( &mut self, cache: Option<AltSvcCache>, ) -> &mut HttpsServiceLayer<R>
Compose fresh Alt-Svc advertisements from the selector’s cache. Supply the same cache to both layers. When DNS supplies candidates, this layer owns composition; an unrelated inner cache is not merged.
pub fn with_cache(self, cache: AltSvcCache) -> HttpsServiceLayer<R>
pub fn with_cache(self, cache: AltSvcCache) -> HttpsServiceLayer<R>
Compose fresh Alt-Svc advertisements from the selector’s cache. Supply the same cache to both layers. When DNS supplies candidates, this layer owns composition; an unrelated inner cache is not merged.
pub fn set_cache(&mut self, cache: AltSvcCache) -> &mut HttpsServiceLayer<R>
pub fn set_cache(&mut self, cache: AltSvcCache) -> &mut HttpsServiceLayer<R>
Compose fresh Alt-Svc advertisements from the selector’s cache. Supply the same cache to both layers. When DNS supplies candidates, this layer owns composition; an unrelated inner cache is not merged.
pub fn without_cache(self) -> HttpsServiceLayer<R>
pub fn without_cache(self) -> HttpsServiceLayer<R>
Compose fresh Alt-Svc advertisements from the selector’s cache. Supply the same cache to both layers. When DNS supplies candidates, this layer owns composition; an unrelated inner cache is not merged.
pub fn unset_cache(&mut self) -> &mut HttpsServiceLayer<R>
pub fn unset_cache(&mut self) -> &mut HttpsServiceLayer<R>
Compose fresh Alt-Svc advertisements from the selector’s cache. Supply the same cache to both layers. When DNS supplies candidates, this layer owns composition; an unrelated inner cache is not merged.
pub fn with_tls(self, tls: TlsClientConfig) -> HttpsServiceLayer<R>
pub fn with_tls(self, tls: TlsClientConfig) -> HttpsServiceLayer<R>
Connector defaults used to compute effective ECH intent. Keep these identical to the TLS connector’s defaults.
pub fn set_tls(&mut self, tls: TlsClientConfig) -> &mut HttpsServiceLayer<R>
pub fn set_tls(&mut self, tls: TlsClientConfig) -> &mut HttpsServiceLayer<R>
Connector defaults used to compute effective ECH intent. Keep these identical to the TLS connector’s defaults.
pub fn with_protocols(
self,
protocols: Vec<ApplicationProtocol>,
) -> HttpsServiceLayer<R>
pub fn with_protocols( self, protocols: Vec<ApplicationProtocol>, ) -> HttpsServiceLayer<R>
Supported HTTP ALPNs, in preference order.
pub fn set_protocols(
&mut self,
protocols: Vec<ApplicationProtocol>,
) -> &mut HttpsServiceLayer<R>
pub fn set_protocols( &mut self, protocols: Vec<ApplicationProtocol>, ) -> &mut HttpsServiceLayer<R>
Supported HTTP ALPNs, in preference order.
pub fn with_ech_capable(self, supported: bool) -> HttpsServiceLayer<R>
pub fn with_ech_capable(self, supported: bool) -> HttpsServiceLayer<R>
Whether the selected TLS backend supports real ECH (default false).
pub fn set_ech_capable(&mut self, supported: bool) -> &mut HttpsServiceLayer<R>
pub fn set_ech_capable(&mut self, supported: bool) -> &mut HttpsServiceLayer<R>
Whether the selected TLS backend supports real ECH (default false).
pub fn with_proxy_discovery(self, allowed: bool) -> HttpsServiceLayer<R>
pub fn with_proxy_discovery(self, allowed: bool) -> HttpsServiceLayer<R>
Authorize HTTPS queries through this resolver for named proxy routes.
pub fn set_proxy_discovery(
&mut self,
allowed: bool,
) -> &mut HttpsServiceLayer<R>
pub fn set_proxy_discovery( &mut self, allowed: bool, ) -> &mut HttpsServiceLayer<R>
Authorize HTTPS queries through this resolver for named proxy routes.
pub fn with_timeout(self, timeout: Duration) -> HttpsServiceLayer<R>
pub fn with_timeout(self, timeout: Duration) -> HttpsServiceLayer<R>
Bound the complete discovery operation, including Alt-Svc authorities.
pub fn set_timeout(&mut self, timeout: Duration) -> &mut HttpsServiceLayer<R>
pub fn set_timeout(&mut self, timeout: Duration) -> &mut HttpsServiceLayer<R>
Bound the complete discovery operation, including Alt-Svc authorities.
pub fn with_max_candidates(self, limit: usize) -> HttpsServiceLayer<R>
pub fn with_max_candidates(self, limit: usize) -> HttpsServiceLayer<R>
Bound produced candidates and consulted advertisements (default 64).
pub fn set_max_candidates(&mut self, limit: usize) -> &mut HttpsServiceLayer<R>
pub fn set_max_candidates(&mut self, limit: usize) -> &mut HttpsServiceLayer<R>
Bound produced candidates and consulted advertisements (default 64).
Trait Implementations§
§impl<R> Clone for HttpsServiceLayer<R>where
R: Clone,
impl<R> Clone for HttpsServiceLayer<R>where
R: Clone,
§fn clone(&self) -> HttpsServiceLayer<R>
fn clone(&self) -> HttpsServiceLayer<R>
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more§impl<R> Debug for HttpsServiceLayer<R>where
R: Debug,
impl<R> Debug for HttpsServiceLayer<R>where
R: Debug,
§impl Default for HttpsServiceLayer
impl Default for HttpsServiceLayer
§fn default() -> HttpsServiceLayer
fn default() -> HttpsServiceLayer
§impl<S, R> Layer<S> for HttpsServiceLayer<R>where
R: Clone,
impl<S, R> Layer<S> for HttpsServiceLayer<R>where
R: Clone,
§type Service = HttpsService<S, R>
type Service = HttpsService<S, R>
§fn layer(&self, inner: S) -> <HttpsServiceLayer<R> as Layer<S>>::Service
fn layer(&self, inner: S) -> <HttpsServiceLayer<R> as Layer<S>>::Service
§fn into_layer(self, inner: S) -> Self::Service
fn into_layer(self, inner: S) -> Self::Service
layer but consuming self after the service was created. Read moreAuto Trait Implementations§
impl<R = GlobalDnsResolver> !RefUnwindSafe for HttpsServiceLayer<R>
impl<R = GlobalDnsResolver> !UnwindSafe for HttpsServiceLayer<R>
impl<R> Forget for HttpsServiceLayer<R>
impl<R> Freeze for HttpsServiceLayer<R>where
R: Freeze,
impl<R> Move for HttpsServiceLayer<R>
impl<R> Send for HttpsServiceLayer<R>where
R: Send,
impl<R> Sync for HttpsServiceLayer<R>where
R: Sync,
impl<R> Unpin for HttpsServiceLayer<R>where
R: Unpin,
impl<R> UnsafeUnpin for HttpsServiceLayer<R>where
R: 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<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