/// Creates a new instance of RestartStrategy.
///
/// # Arguments
///
/// * `restart_policy` - Defines a restart policy to use for failed actor:
///     - [`RestartPolicy::Always`] would restart the
///         failed actor each time as it fails.
///     - [`RestartPolicy::Never`] would not restart the
///         failed actor and remove it from tracking.
///     - [`RestartPolicy::Tries`] would restart the
///         failed actor a limited amount of times. If can't be started,
///         then will remove it from tracking.   
///
/// * `strategy` - The strategy to use:
///     - [`ActorRestartStrategy::Immediate`] would restart the
///         failed actor as soon as possible.
///     - [`ActorRestartStrategy::LinearBackOff`] would restart the
///         failed actor with the delay increasing linearly.
///     - [`ActorRestartStrategy::ExponentialBackOff`] would restart the
///         failed actor with the delay, multiplied by given coefficient.
///
/// # Example
///
/// ```rust
/// # use std::time::Duration;
/// # use bastion::prelude::*;
/// #
/// let actor_restart_strategy = ActorRestartStrategy::LinearBackOff {
///     timeout: Duration::from_secs(5)
/// };
/// let restart_strategy = RestartStrategy::default()
///     .with_actor_restart_strategy(actor_restart_strategy);
/// ```
Creates a new instance of RestartStrategy.
Creates a new instance of RestartStrategy .
pub fn new(restart_policy: RestartPolicy, strategy: ActorRestartStrategy) -> Self {
        RestartStrategy {
            restart_policy,
            strategy,
        }
    }
pub fn new ( restart_policy : RestartPolicy , strategy : ActorRestartStrategy ) -> Self { RestartStrategy { restart_policy , strategy , } }
Creates a new instance of RestartStrategy.
Creates a new instance of RestartStrategy .
restart_policy
RestartPolicy
strategy
ActorRestartStrategy
example
None
use std::time::duration;
None
use bastion::prelude::*;
let actor_restart_strategy = ActorRestartStrategy::LinearBackOff {
timeout: Duration::from_secs(5)
};
let restart_strategy = RestartStrategy::default()
.with_actor_restart_strategy(actor_restart_strategy);
```
let actor_restart_strategy = ActorRestartStrategy :: LinearBackOff { timeout : Duration :: from_secs ( 5 ) } ; let restart_strategy = RestartStrategy :: default () . with_actor_restart_strategy ( actor_restart_strategy ) ; ` ` `