pub struct MiddlewareCircuitBreaker {
pub check_period: Option<IntOrString>,
pub expression: Option<String>,
pub fallback_duration: Option<IntOrString>,
pub recovery_duration: Option<IntOrString>,
pub response_code: Option<i64>,
}
Expand description
CircuitBreaker holds the circuit breaker configuration.
Fields§
§check_period: Option<IntOrString>
CheckPeriod is the interval between successive checks of the circuit breaker condition (when in standby state).
expression: Option<String>
Expression is the condition that triggers the tripped state.
fallback_duration: Option<IntOrString>
FallbackDuration is the duration for which the circuit breaker will wait before trying to recover (from a tripped state).
recovery_duration: Option<IntOrString>
RecoveryDuration is the duration for which the circuit breaker will try to recover (as soon as it is in recovering state).
response_code: Option<i64>
ResponseCode is the status code that the circuit breaker will return while it is in the open state.
Implementations§
Source§impl MiddlewareCircuitBreaker
impl MiddlewareCircuitBreaker
Sourcepub fn builder() -> MiddlewareCircuitBreakerBuilder<((), (), (), (), ())>
pub fn builder() -> MiddlewareCircuitBreakerBuilder<((), (), (), (), ())>
Create a builder for building MiddlewareCircuitBreaker
.
On the builder, call .check_period(...)
(optional), .expression(...)
(optional), .fallback_duration(...)
(optional), .recovery_duration(...)
(optional), .response_code(...)
(optional) to set the values of the fields.
Finally, call .build()
to create the instance of MiddlewareCircuitBreaker
.
Trait Implementations§
Source§impl Clone for MiddlewareCircuitBreaker
impl Clone for MiddlewareCircuitBreaker
Source§fn clone(&self) -> MiddlewareCircuitBreaker
fn clone(&self) -> MiddlewareCircuitBreaker
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for MiddlewareCircuitBreaker
impl Debug for MiddlewareCircuitBreaker
Source§impl Default for MiddlewareCircuitBreaker
impl Default for MiddlewareCircuitBreaker
Source§fn default() -> MiddlewareCircuitBreaker
fn default() -> MiddlewareCircuitBreaker
Source§impl<'de> Deserialize<'de> for MiddlewareCircuitBreaker
impl<'de> Deserialize<'de> for MiddlewareCircuitBreaker
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl JsonSchema for MiddlewareCircuitBreaker
impl JsonSchema for MiddlewareCircuitBreaker
Source§fn schema_name() -> String
fn schema_name() -> String
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn is_referenceable() -> bool
fn is_referenceable() -> bool
$ref
keyword. Read moreSource§impl PartialEq for MiddlewareCircuitBreaker
impl PartialEq for MiddlewareCircuitBreaker
Source§impl Serialize for MiddlewareCircuitBreaker
impl Serialize for MiddlewareCircuitBreaker
impl StructuralPartialEq for MiddlewareCircuitBreaker
Auto Trait Implementations§
impl Freeze for MiddlewareCircuitBreaker
impl RefUnwindSafe for MiddlewareCircuitBreaker
impl Send for MiddlewareCircuitBreaker
impl Sync for MiddlewareCircuitBreaker
impl Unpin for MiddlewareCircuitBreaker
impl UnwindSafe for MiddlewareCircuitBreaker
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