Rust doesn't have a proper and idiomatic and safe way to lydiate with OS signals but there are some crates that provide signal handling but they are highly experimental and unsafe so be careful when using them.
However there is a discussion in the rust-lang/rfcs repository about implementing native signal handling for rust.
RFCs discussion: https://github.com/rust-lang/rfcs/issues/1368