RestartConfig

Struct RestartConfig 

Source
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: bool

Enables the restart coordination socket for graceful restarts as an alternative to the SIGUSR1 signal.

§coordination_socket_path: PathBuf

Socket 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: bool

Exits early when child process fail to start

Implementations§

Source§

impl RestartConfig

Source

pub fn try_into_restart_task( self, ) -> Result<impl Future<Output = RestartResult<Child>> + Send>

Prepare the current process to handle restarts, if enabled.

Source

pub async fn request_restart(self) -> RestartResult<u32>

Request an already-running service to restart.

Source

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§

Source§

impl Default for RestartConfig

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.