Function tokio::signal::unix::signal[][src]

pub fn signal(kind: SignalKind) -> Result<Signal>

Creates a new stream which will receive notifications when the current process receives the specified signal kind.

This function will create a new stream which binds to the default reactor. The Signal stream is an infinite stream which will receive notifications whenever a signal is received. More documentation can be found on Signal itself, but to reiterate:

A Signal stream can be created for a particular signal number multiple times. When a signal is received then all the associated channels will receive the signal notification.

Errors