[−][src]Function tokio::signal::windows::ctrl_break
pub fn ctrl_break() -> Result<CtrlBreak>
This is supported on
feature="signal"
only.Creates a new stream which receives "ctrl-break" notifications sent to the process.
Examples
use tokio::signal::windows::ctrl_break; #[tokio::main] async fn main() -> Result<(), Box<dyn std::error::Error>> { // An infinite stream of CTRL-BREAK events. let mut stream = ctrl_break()?; // Print whenever a CTRL-BREAK event is received loop { stream.recv().await; println!("got signal CTRL-BREAK"); } }