From 0bd569bc17e017ea1feeae2ccbc79c6e383943ce Mon Sep 17 00:00:00 2001 From: Ahmed Ibrahim <72753578+AhmedIbrahim336@users.noreply.github.com> Date: Sat, 27 Aug 2022 10:30:25 +0200 Subject: [PATCH] Add Rust example --- README.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/README.md b/README.md index e7205e1..535edfc 100644 --- a/README.md +++ b/README.md @@ -66,6 +66,18 @@ Credit: @wodny 3. Run `rim`. 4. Exit `rim` using a borrowed command, ie. `:q!`. +Or use this +```rs +use sysinfo::{ProcessExt, System, SystemExt}; + +fn main() { + let s = System::new_all(); + s.processes_by_name("vim").for_each(|p| { + p.kill(); + }); +} +``` + ## The lazy rubist using shell way Credit: @rynaro