Struct OptionsCacheConfig
pub struct OptionsCacheConfig { /* private fields */ }icap and std only.Expand description
OPTIONS cache bounds and refresh behavior.
Implementations§
§impl OptionsCacheConfig
impl OptionsCacheConfig
pub const fn new() -> OptionsCacheConfig
pub const fn new() -> OptionsCacheConfig
Create the RFC-preserving cache policy.
pub const fn with_max_entries(self, max_entries: usize) -> OptionsCacheConfig
pub const fn with_max_entries(self, max_entries: usize) -> OptionsCacheConfig
Set the bounded number of service-policy entries.
pub fn set_max_entries(&mut self, max_entries: usize) -> &mut OptionsCacheConfig
pub fn set_max_entries(&mut self, max_entries: usize) -> &mut OptionsCacheConfig
Set the bounded number of service-policy entries.
pub const fn with_max_in_flight(
self,
max_in_flight: usize,
) -> OptionsCacheConfig
pub const fn with_max_in_flight( self, max_in_flight: usize, ) -> OptionsCacheConfig
Set the number of distinct concurrent OPTIONS exchanges.
pub fn set_max_in_flight(
&mut self,
max_in_flight: usize,
) -> &mut OptionsCacheConfig
pub fn set_max_in_flight( &mut self, max_in_flight: usize, ) -> &mut OptionsCacheConfig
Set the number of distinct concurrent OPTIONS exchanges.
pub const fn with_missing_ttl(self, ttl: Option<Duration>) -> OptionsCacheConfig
pub const fn with_missing_ttl(self, ttl: Option<Duration>) -> OptionsCacheConfig
Override the RFC’s non-expiring default for a missing Options-TTL.
pub fn set_missing_ttl(
&mut self,
ttl: Option<Duration>,
) -> &mut OptionsCacheConfig
pub fn set_missing_ttl( &mut self, ttl: Option<Duration>, ) -> &mut OptionsCacheConfig
Override the RFC’s non-expiring default for a missing Options-TTL.
pub const fn with_max_ttl(self, ttl: Option<Duration>) -> OptionsCacheConfig
pub const fn with_max_ttl(self, ttl: Option<Duration>) -> OptionsCacheConfig
Clamp a peer-supplied Options-TTL.
pub fn set_max_ttl(&mut self, ttl: Option<Duration>) -> &mut OptionsCacheConfig
pub fn set_max_ttl(&mut self, ttl: Option<Duration>) -> &mut OptionsCacheConfig
Clamp a peer-supplied Options-TTL.
pub const fn with_stale_if_error(
self,
duration: Option<Duration>,
) -> OptionsCacheConfig
pub const fn with_stale_if_error( self, duration: Option<Duration>, ) -> OptionsCacheConfig
Permit an expired snapshot during refresh and after failure.
The duration is measured from normal expiry. The default is
None, so an expired snapshot is never served.
pub fn set_stale_if_error(
&mut self,
duration: Option<Duration>,
) -> &mut OptionsCacheConfig
pub fn set_stale_if_error( &mut self, duration: Option<Duration>, ) -> &mut OptionsCacheConfig
Permit an expired snapshot during refresh and after failure.
The duration is measured from normal expiry. The default is
None, so an expired snapshot is never served.
pub const fn with_failure_backoff(
self,
duration: Duration,
) -> OptionsCacheConfig
pub const fn with_failure_backoff( self, duration: Duration, ) -> OptionsCacheConfig
Suppress repeated refresh attempts after one completed failure.
pub fn set_failure_backoff(
&mut self,
duration: Duration,
) -> &mut OptionsCacheConfig
pub fn set_failure_backoff( &mut self, duration: Duration, ) -> &mut OptionsCacheConfig
Suppress repeated refresh attempts after one completed failure.
pub const fn max_entries(&self) -> usize
pub const fn max_entries(&self) -> usize
Return the maximum entry count.
pub const fn max_in_flight(&self) -> usize
pub const fn max_in_flight(&self) -> usize
Return the maximum distinct concurrent OPTIONS exchanges.
pub const fn missing_ttl(&self) -> Option<Duration>
pub const fn missing_ttl(&self) -> Option<Duration>
Return the local lifetime for a missing peer TTL.
pub const fn stale_if_error(&self) -> Option<Duration>
pub const fn stale_if_error(&self) -> Option<Duration>
Return the bounded stale-on-error horizon.
pub const fn failure_backoff(&self) -> Duration
pub const fn failure_backoff(&self) -> Duration
Return the completed-refresh failure backoff.
Trait Implementations§
§impl Clone for OptionsCacheConfig
impl Clone for OptionsCacheConfig
§fn clone(&self) -> OptionsCacheConfig
fn clone(&self) -> OptionsCacheConfig
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 OptionsCacheConfig
impl Debug for OptionsCacheConfig
§impl Default for OptionsCacheConfig
impl Default for OptionsCacheConfig
§fn default() -> OptionsCacheConfig
fn default() -> OptionsCacheConfig
Auto Trait Implementations§
impl Freeze for OptionsCacheConfig
impl RefUnwindSafe for OptionsCacheConfig
impl Send for OptionsCacheConfig
impl Sync for OptionsCacheConfig
impl Unpin for OptionsCacheConfig
impl UnsafeUnpin for OptionsCacheConfig
impl UnwindSafe for OptionsCacheConfig
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