#[non_exhaustive]pub struct LifecycleConfig {
pub max_idle_ms: u64,
pub max_lifetime_ms: Option<u64>,
pub restart_on_crash: bool,
pub max_restarts: u32,
}Expand description
Lifecycle configuration for an agent container.
Controls idle timeouts, maximum lifetime, and crash recovery.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.max_idle_ms: u64Maximum idle time before auto-stop, in milliseconds. Defaults to 3600000 (1 hour).
max_lifetime_ms: Option<u64>Maximum total lifetime in milliseconds. None means unlimited.
restart_on_crash: boolWhether to restart the container on crash. Defaults to false.
max_restarts: u32Maximum restart attempts before giving up. Defaults to 3.
Implementations§
Source§impl LifecycleConfig
impl LifecycleConfig
Sourcepub fn new(max_idle_ms: u64) -> Self
pub fn new(max_idle_ms: u64) -> Self
Create a lifecycle config with the given idle timeout in milliseconds.
Sourcepub fn with_restart(self, max_restarts: u32) -> Self
pub fn with_restart(self, max_restarts: u32) -> Self
Enable crash restart with the given max attempts.
Sourcepub fn with_max_lifetime(self, ms: u64) -> Self
pub fn with_max_lifetime(self, ms: u64) -> Self
Set maximum total lifetime in milliseconds.
Trait Implementations§
Source§impl Clone for LifecycleConfig
impl Clone for LifecycleConfig
Source§fn clone(&self) -> LifecycleConfig
fn clone(&self) -> LifecycleConfig
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for LifecycleConfig
impl Debug for LifecycleConfig
Source§impl Default for LifecycleConfig
impl Default for LifecycleConfig
Source§impl<'de> Deserialize<'de> for LifecycleConfig
impl<'de> Deserialize<'de> for LifecycleConfig
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>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for LifecycleConfig
impl RefUnwindSafe for LifecycleConfig
impl Send for LifecycleConfig
impl Sync for LifecycleConfig
impl Unpin for LifecycleConfig
impl UnsafeUnpin for LifecycleConfig
impl UnwindSafe for LifecycleConfig
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
Mutably borrows from an owned value. Read more