pub struct RestartConfig {
pub enabled: bool,
pub coordination_socket_path: PathBuf,
pub environment: Vec<(OsString, OsString)>,
pub lifecycle_handler: Box<dyn LifecycleHandler>,
pub exit_on_error: bool,
}Expand description
Settings for graceful restarts
Fields§
§enabled: boolEnables the restart coordination socket for graceful restarts as an alternative to the SIGUSR1 signal.
coordination_socket_path: PathBufSocket path
environment: Vec<(OsString, OsString)>Sets environment variables on the newly-started process
lifecycle_handler: Box<dyn LifecycleHandler>Receive fine-grained events on the lifecycle of the new process and support data transfer.
exit_on_error: boolExits early when child process fail to start
Implementations§
Source§impl RestartConfig
impl RestartConfig
Sourcepub fn try_into_restart_task(
self,
) -> Result<impl Future<Output = RestartResult<Child>> + Send>
pub fn try_into_restart_task( self, ) -> Result<impl Future<Output = RestartResult<Child>> + Send>
Prepare the current process to handle restarts, if enabled.
Sourcepub async fn request_restart(self) -> RestartResult<u32>
pub async fn request_restart(self) -> RestartResult<u32>
Request an already-running service to restart.
Sourcepub fn request_restart_sync(self) -> RestartResult<u32>
pub fn request_restart_sync(self) -> RestartResult<u32>
Request an already-running service to restart. Does not require the tokio runtime to be started yet.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for RestartConfig
impl !RefUnwindSafe for RestartConfig
impl Send for RestartConfig
impl !Sync for RestartConfig
impl Unpin for RestartConfig
impl !UnwindSafe for RestartConfig
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