Struct NativeTrustPolicy
#[non_exhaustive]pub struct NativeTrustPolicy { /* private fields */ }tls only.Expand description
Settings for the native root store used by ServerTrustSource::Native.
The default uses a static snapshot. With the native-certs feature,
this policy supports refresh triggers and an age limit.
Configure this policy once and clone it so callers share its reload state and can reuse pooled connections. Refreshes apply to new handshakes. Established pooled connections can continue serving requests until they close. Rama’s rustls and BoringSSL connectors, including their QUIC providers, apply this policy. A custom verifier controls its own trust decisions.
Implementations§
§impl NativeTrustPolicy
impl NativeTrustPolicy
pub fn with_reload_trigger<T>(
self,
trigger: impl IntoNativeTrustReloadTrigger<T>,
) -> NativeTrustPolicy
Available on crate feature boring only.
pub fn with_reload_trigger<T>( self, trigger: impl IntoNativeTrustReloadTrigger<T>, ) -> NativeTrustPolicy
boring only.Refresh native roots when the trigger fires.
Pass a stream of unit events or a tuple of streams. A handshake processes pending events and pins one trust generation.
pub fn set_reload_trigger<T>(
&mut self,
trigger: impl IntoNativeTrustReloadTrigger<T>,
) -> &mut NativeTrustPolicy
Available on crate feature boring only.
pub fn set_reload_trigger<T>( &mut self, trigger: impl IntoNativeTrustReloadTrigger<T>, ) -> &mut NativeTrustPolicy
boring only.Refresh native roots when the trigger fires.
Pass a stream of unit events or a tuple of streams. A handshake processes pending events and pins one trust generation.
pub fn maybe_with_max_age(self, max_age: Option<Duration>) -> NativeTrustPolicy
Available on crate feature boring only.
pub fn maybe_with_max_age(self, max_age: Option<Duration>) -> NativeTrustPolicy
boring only.Limit how long a handshake may rely on its native trust snapshot.
At the age limit, a fresh read is required even if no trigger has fired. If the read fails, the handshake fails. A limit of zero requires a successful read for every handshake.
pub fn maybe_set_max_age(
&mut self,
max_age: Option<Duration>,
) -> &mut NativeTrustPolicy
Available on crate feature boring only.
pub fn maybe_set_max_age( &mut self, max_age: Option<Duration>, ) -> &mut NativeTrustPolicy
boring only.Limit how long a handshake may rely on its native trust snapshot.
At the age limit, a fresh read is required even if no trigger has fired. If the read fails, the handshake fails. A limit of zero requires a successful read for every handshake.
pub fn with_max_age(self, max_age: Duration) -> NativeTrustPolicy
Available on crate feature boring only.
pub fn with_max_age(self, max_age: Duration) -> NativeTrustPolicy
boring only.Limit how long a handshake may rely on its native trust snapshot.
At the age limit, a fresh read is required even if no trigger has fired. If the read fails, the handshake fails. A limit of zero requires a successful read for every handshake.
pub fn set_max_age(&mut self, max_age: Duration) -> &mut NativeTrustPolicy
Available on crate feature boring only.
pub fn set_max_age(&mut self, max_age: Duration) -> &mut NativeTrustPolicy
boring only.Limit how long a handshake may rely on its native trust snapshot.
At the age limit, a fresh read is required even if no trigger has fired. If the read fails, the handshake fails. A limit of zero requires a successful read for every handshake.
pub fn without_max_age(self) -> NativeTrustPolicy
Available on crate feature boring only.
pub fn without_max_age(self) -> NativeTrustPolicy
boring only.Limit how long a handshake may rely on its native trust snapshot.
At the age limit, a fresh read is required even if no trigger has fired. If the read fails, the handshake fails. A limit of zero requires a successful read for every handshake.
pub fn unset_max_age(&mut self) -> &mut NativeTrustPolicy
Available on crate feature boring only.
pub fn unset_max_age(&mut self) -> &mut NativeTrustPolicy
boring only.Limit how long a handshake may rely on its native trust snapshot.
At the age limit, a fresh read is required even if no trigger has fired. If the read fails, the handshake fails. A limit of zero requires a successful read for every handshake.
§impl NativeTrustPolicy
impl NativeTrustPolicy
pub const fn new() -> NativeTrustPolicy
Available on crate feature boring only.
pub const fn new() -> NativeTrustPolicy
boring only.Use a static snapshot of native roots.
Trait Implementations§
§impl Clone for NativeTrustPolicy
impl Clone for NativeTrustPolicy
§fn clone(&self) -> NativeTrustPolicy
fn clone(&self) -> NativeTrustPolicy
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more§impl Debug for NativeTrustPolicy
impl Debug for NativeTrustPolicy
§impl Default for NativeTrustPolicy
impl Default for NativeTrustPolicy
§fn default() -> NativeTrustPolicy
fn default() -> NativeTrustPolicy
impl Eq for NativeTrustPolicy
§impl From<NativeTrustPolicy> for TlsServerTrust
impl From<NativeTrustPolicy> for TlsServerTrust
§fn from(policy: NativeTrustPolicy) -> TlsServerTrust
fn from(policy: NativeTrustPolicy) -> TlsServerTrust
§impl Hash for NativeTrustPolicy
impl Hash for NativeTrustPolicy
§impl PartialEq for NativeTrustPolicy
impl PartialEq for NativeTrustPolicy
impl StructuralPartialEq for NativeTrustPolicy
Auto Trait Implementations§
impl !RefUnwindSafe for NativeTrustPolicy
impl !UnwindSafe for NativeTrustPolicy
impl Forget for NativeTrustPolicy
impl Freeze for NativeTrustPolicy
impl Move for NativeTrustPolicy
impl Send for NativeTrustPolicy
impl Sync for NativeTrustPolicy
impl Unpin for NativeTrustPolicy
impl UnsafeUnpin for NativeTrustPolicy
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§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