pub struct RestartPolicy {
pub condition: Option<RestartPolicyCondition>,
pub delay: Option<String>,
pub max_attempts: Option<i64>,
pub window: Option<String>,
}Expand description
Configures if and how to restart containers when they exit. If restart_policy is not set, Compose considers the restart field set by the service configuration.
See more: https://docs.docker.com/reference/compose-file/deploy/#restart_policy
Fields§
§condition: Option<RestartPolicyCondition>The condition that should trigger a restart.
delay: Option<String>How long to wait between restart attempts, specified as a duration. The default is 0, meaning restart attempts can occur immediately.
max_attempts: Option<i64>The maximum number of failed restart attempts allowed before giving up. (Default: unlimited retries.) A failed attempt only counts toward max_attempts if the container does not successfully restart within the time defined by window. For example, if max_attempts is set to 2 and the container fails to restart within the window on the first try, Compose continues retrying until two such failed attempts occur, even if that means trying more than twice.
window: Option<String>The amount of time to wait after a restart to determine whether it was successful, specified as a duration (default: the result is evaluated immediately after the restart).
Trait Implementations§
Source§impl Clone for RestartPolicy
impl Clone for RestartPolicy
Source§fn clone(&self) -> RestartPolicy
fn clone(&self) -> RestartPolicy
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for RestartPolicy
impl Debug for RestartPolicy
Source§impl Default for RestartPolicy
impl Default for RestartPolicy
Source§fn default() -> RestartPolicy
fn default() -> RestartPolicy
Source§impl<'de> Deserialize<'de> for RestartPolicywhere
RestartPolicy: Default,
impl<'de> Deserialize<'de> for RestartPolicywhere
RestartPolicy: Default,
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl PartialEq for RestartPolicy
impl PartialEq for RestartPolicy
Source§impl Serialize for RestartPolicy
impl Serialize for RestartPolicy
impl Eq for RestartPolicy
impl StructuralPartialEq for RestartPolicy
Auto Trait Implementations§
impl Freeze for RestartPolicy
impl RefUnwindSafe for RestartPolicy
impl Send for RestartPolicy
impl Sync for RestartPolicy
impl Unpin for RestartPolicy
impl UnsafeUnpin for RestartPolicy
impl UnwindSafe for RestartPolicy
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.