INNER CODE UNIT · Rust

run

rustic-rs/rustic · src/commands.rs:192

    fn run(&self) {
        // Set up panic hook for better error messages and logs
        setup_panic!();

        // Set up Ctrl-C handler
        let (tx, rx) = channel();

        ctrlc::set_handler(move || tx.send(()).expect("Could not send signal on channel."))
            .expect("Error setting Ctrl-C handler");

        _ = std::thread::spawn(move || {
            // Wait for Ctrl-C
            rx.recv().expect("Could not receive from channel.");
            info!("Ctrl-C received, shutting down...");
            RUSTIC_APP.shutdown(Shutdown::Graceful)
        });

        // Run the subcommand

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…