pub struct ReliabilityConfig {
pub retry: Option<RetryConfig>,
pub circuit_breaker: Option<CircuitBreakerConfig>,
pub backpressure: Option<BackpressureConfig>,
}Expand description
Reliability stack configuration: which layers to apply around backend ops.
The Default enables all layers with production defaults. Disable a
layer by setting its field to None:
use cachekit::reliability::ReliabilityConfig;
let retry_only = ReliabilityConfig {
circuit_breaker: None,
backpressure: None,
..ReliabilityConfig::default()
};
assert!(retry_only.retry.is_some());Fields§
§retry: Option<RetryConfig>Retry policy, or None to propagate every error on first failure.
circuit_breaker: Option<CircuitBreakerConfig>Circuit breaker, or None to never fail fast.
backpressure: Option<BackpressureConfig>Concurrency limiter, or None for unbounded backend concurrency.
Implementations§
Source§impl ReliabilityConfig
impl ReliabilityConfig
Sourcepub fn disabled() -> Self
pub fn disabled() -> Self
A config with every layer off — the documented preset opt-out.
Prefer this over spelling out a struct literal with all-None
fields: a literal breaks downstream code every time the stack gains
a layer (it has, twice).
use cachekit::reliability::ReliabilityConfig;
assert!(ReliabilityConfig::disabled().is_disabled());
assert!(!ReliabilityConfig::default().is_disabled());Sourcepub fn is_disabled(&self) -> bool
pub fn is_disabled(&self) -> bool
true when no layer is enabled — the builder skips the (no-op)
ReliableBackend decorator entirely. Lives here, next to the fields,
so adding a layer cannot silently miss the builder gate again.
Trait Implementations§
Source§impl Clone for ReliabilityConfig
impl Clone for ReliabilityConfig
Source§impl Debug for ReliabilityConfig
impl Debug for ReliabilityConfig
Source§impl Default for ReliabilityConfig
impl Default for ReliabilityConfig
Source§impl PartialEq for ReliabilityConfig
impl PartialEq for ReliabilityConfig
impl StructuralPartialEq for ReliabilityConfig
Auto Trait Implementations§
impl Freeze for ReliabilityConfig
impl RefUnwindSafe for ReliabilityConfig
impl Send for ReliabilityConfig
impl Sync for ReliabilityConfig
impl Unpin for ReliabilityConfig
impl UnsafeUnpin for ReliabilityConfig
impl UnwindSafe for ReliabilityConfig
Blanket Implementations§
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§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