logo
pub enum MainSignal {
    Hangup,
    Interrupt,
    Quit,
    Terminate,
    User1,
    User2,
}
Expand description

A notification sent to the main (watchexec) process.

On Windows, only Interrupt and Terminate will be produced: they are respectively Ctrl-C (SIGINT) and Ctrl-Break (SIGBREAK). Ctrl-Close (the equivalent of SIGHUP on Unix, without the semantics of configuration reload) is not supported, and on console close the process will be terminated by the OS.

Variants

Hangup

Received when the terminal is disconnected.

On Unix, this is SIGHUP. On Windows, it is not produced.

This signal is available because it is a common signal used to reload configuration files, and it is reasonable that either watchexec could make use of it, or that it should be passed on to a sub process.

Interrupt

Received to indicate that the process should stop.

On Unix, this is SIGINT. On Windows, this is Ctrl+C.

This signal is generally produced by the user, so it may be handled differently than a termination.

Quit

Received to cause the process to stop and the kernel to dump its core.

On Unix, this is SIGQUIT. On Windows, it is not produced.

This signal is available because it is reasonable that it could be passed on to a sub process, rather than terminate watchexec itself.

Terminate

Received to indicate that the process should stop.

On Unix, this is SIGTERM. On Windows, this is Ctrl+Break.

This signal is available for cleanup, but will generally not be passed on to a sub process with no other consequence: it is expected the main process should terminate.

User1

Received for a user or application defined purpose.

On Unix, this is SIGUSR1. On Windows, it is not produced.

This signal is available because it is expected that it most likely should be passed on to a sub process or trigger a particular action within watchexec.

User2

Received for a user or application defined purpose.

On Unix, this is SIGUSR2. On Windows, it is not produced.

This signal is available because it is expected that it most likely should be passed on to a sub process or trigger a particular action within watchexec.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Performs the conversion.

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Performs the conversion.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more