Command

Type Alias Command 

Source
pub type Command<I, O, E> = Command<I, O, E, CommandFn<I, O, E>, FallbackFn<O, E>>;
Expand description

A Command is a runnable circuit breaker. It can be constructed either with or without a fallback method that can provide alternative values if the contained calls fail or if the breaker is open.

§Type parameters:

  • I: Input type to the breaker’s function.
  • O: Output type of the breaker’s function.
  • E: Error type returned by the breaker’s function. This type must implement From<CriusError> to propagate internal circuit breaker errors.

Aliased Type§

pub struct Command<I, O, E> {
    pub cmd: fn(I) -> Result<O, E>,
    pub fallback: Option<fn(E) -> O>,
    /* private fields */
}

Fields§

§cmd: fn(I) -> Result<O, E>§fallback: Option<fn(E) -> O>