pub struct CircuitBreakerPolicy { /* private fields */ }Expand description
Circuit breaker policy for fault tolerance
Implementations§
Source§impl CircuitBreakerPolicy
impl CircuitBreakerPolicy
Sourcepub fn can_execute(&self) -> bool
pub fn can_execute(&self) -> bool
Check if the circuit breaker allows execution
Sourcepub fn record_success(&mut self)
pub fn record_success(&mut self)
Record a successful operation
Sourcepub fn record_failure(&mut self)
pub fn record_failure(&mut self)
Record a failed operation
Sourcepub fn get_status(&self) -> CircuitBreakerStatus
pub fn get_status(&self) -> CircuitBreakerStatus
Get the current status of the circuit breaker
Trait Implementations§
Source§impl Clone for CircuitBreakerPolicy
impl Clone for CircuitBreakerPolicy
Source§fn clone(&self) -> CircuitBreakerPolicy
fn clone(&self) -> CircuitBreakerPolicy
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for CircuitBreakerPolicy
impl Debug for CircuitBreakerPolicy
Source§impl<'de> Deserialize<'de> for CircuitBreakerPolicy
impl<'de> Deserialize<'de> for CircuitBreakerPolicy
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>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for CircuitBreakerPolicy
impl PartialEq for CircuitBreakerPolicy
Source§impl Serialize for CircuitBreakerPolicy
impl Serialize for CircuitBreakerPolicy
impl StructuralPartialEq for CircuitBreakerPolicy
Auto Trait Implementations§
impl Freeze for CircuitBreakerPolicy
impl RefUnwindSafe for CircuitBreakerPolicy
impl Send for CircuitBreakerPolicy
impl Sync for CircuitBreakerPolicy
impl Unpin for CircuitBreakerPolicy
impl UnwindSafe for CircuitBreakerPolicy
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
Mutably borrows from an owned value. Read more