glib::source

Function unix_signal_source_new

Source
pub fn unix_signal_source_new<F>(
    signum: i32,
    name: Option<&str>,
    priority: Priority,
    func: F,
) -> Source
where F: FnMut() -> ControlFlow + Send + 'static,
Available on Unix only.
Expand description

Adds a closure to be called by the main loop the returned Source is attached to whenever a UNIX signal is raised.

func will be called repeatedly every time signum is raised until it returns ControlFlow::Break.