pub struct AuditingBreaker { /* private fields */ }Expand description
Wraps a CircuitBreaker with a name + audit-stream client so that
state transitions fan out as governance events.
The wrapper is cheap to clone — both the inner breaker and the reqwest client are reference-counted.
Implementations§
Source§impl AuditingBreaker
impl AuditingBreaker
Sourcepub fn new(
breaker: CircuitBreaker,
name: impl Into<String>,
client: Client,
) -> Self
pub fn new( breaker: CircuitBreaker, name: impl Into<String>, client: Client, ) -> Self
Wrap a breaker with a name (identifies which breaker in the audit
log — e.g. "downstream-billing") and an HTTP client.
Sourcepub fn inner(&self) -> &CircuitBreaker
pub fn inner(&self) -> &CircuitBreaker
The wrapped breaker. Use this for non-audited calls or to read state directly.
Sourcepub async fn call<F, T, E>(&self, fut: F) -> Result<Result<T, E>, ToolkitError>
pub async fn call<F, T, E>(&self, fut: F) -> Result<Result<T, E>, ToolkitError>
Execute fut through the breaker, firing transition events on
open/recover. Semantics match CircuitBreaker::call.
Trait Implementations§
Source§impl Clone for AuditingBreaker
impl Clone for AuditingBreaker
Source§fn clone(&self) -> AuditingBreaker
fn clone(&self) -> AuditingBreaker
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for AuditingBreaker
impl !RefUnwindSafe for AuditingBreaker
impl Send for AuditingBreaker
impl Sync for AuditingBreaker
impl Unpin for AuditingBreaker
impl UnsafeUnpin for AuditingBreaker
impl !UnwindSafe for AuditingBreaker
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