[][src]Struct recloser::Recloser

pub struct Recloser { /* fields omitted */ }

A concurrent cirbuit breaker based on RingBuffers that allows or rejects calls depending on the state it is in.

Implementations

impl Recloser[src]

pub fn custom() -> RecloserBuilder[src]

Returns a builder to create a customized Recloser.

pub fn call<F, T, E>(&self, f: F) -> Result<T, Error<E>> where
    F: FnOnce() -> Result<T, E>, 
[src]

Wraps a function that may fail, records the result as success or failure. Uses default AnyError predicate that considers any Err(_) as a failure. Based on the result, state transition may happen.

pub fn call_with<P, F, T, E>(&self, predicate: P, f: F) -> Result<T, Error<E>> where
    P: ErrorPredicate<E>,
    F: FnOnce() -> Result<T, E>, 
[src]

Wraps a function that may fail, the custom predicate will be used to determine whether the result was a success or failure. Based on the result, state transition may happen.

Trait Implementations

impl Debug for Recloser[src]

impl Default for Recloser[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.