[][src]Struct bastion::supervisor::RestartStrategy

pub struct RestartStrategy { /* fields omitted */ }

The strategy for a supervisor which is used for restoring failed actors. It it fails after N attempts, the supervisor will remove an actor.

The default strategy used is ActorRestartStrategy::Immediate with the RestartPolicy::Always restart policy.

Methods

impl RestartStrategy[src]

pub fn new(
    restart_policy: RestartPolicy,
    strategy: ActorRestartStrategy
) -> Self
[src]

Creates a new instance of RestartStrategy.

Arguments

Example

pub fn restart_policy(&self) -> RestartPolicy[src]

Returns the acceptable count of retries for the failed actor. The None value means the amount of attempts is unlimited.

pub fn strategy(&self) -> ActorRestartStrategy[src]

Returns the current strategy for restarting failed actors.

pub fn with_restart_policy(self, restart_policy: RestartPolicy) -> Self[src]

Sets the limit of attempts for restoring failed actors.

pub fn with_actor_restart_strategy(self, strategy: ActorRestartStrategy) -> Self[src]

Sets the actor restart strategy the supervisor should use of its supervised children groups or supervisors dies to restore in the correct state.

Trait Implementations

impl Clone for RestartStrategy[src]

impl Debug for RestartStrategy[src]

impl Default for RestartStrategy[src]

impl Eq for RestartStrategy[src]

impl PartialEq<RestartStrategy> for RestartStrategy[src]

impl StructuralEq for RestartStrategy[src]

impl StructuralPartialEq for RestartStrategy[src]

Auto Trait Implementations

Blanket Implementations

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

impl<T> AsAny for T where
    T: Any
[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> Message for T where
    T: Any + Send + Sync + Debug
[src]

impl<T> State for T where
    T: Send + Sync + 'static, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

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.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,