#port #kill #process

port-killer

port-killer is a rust library that provides functions to clear port occupancy and kill processes

1 unstable release

0.1.0 May 13, 2022

#636 in Unix APIs

Download history 27/week @ 2024-07-24 25/week @ 2024-07-31 18/week @ 2024-08-07 13/week @ 2024-08-14 5/week @ 2024-08-21 9/week @ 2024-08-28 4/week @ 2024-09-04 4/week @ 2024-09-11 35/week @ 2024-09-18 56/week @ 2024-09-25 29/week @ 2024-10-02 58/week @ 2024-10-09 80/week @ 2024-10-16 50/week @ 2024-10-23 69/week @ 2024-10-30 41/week @ 2024-11-06

249 downloads per month

MIT license

10KB
193 lines

Language : 🇺🇸 English | 🇨🇳 简体中文

port-killer

Build Status Crates Downloads Last Commit

Docs GitHub Actions CI LICENSE

Overview

port-killer is a rust library that provides functions to clear port occupancy and kill processes.

Installation

  1. Get the latest version -> https://crates.io/crates/port-killer

  2. Add the dependent

[dependencies]
port-killer = "0.1.0"
  1. Usage
use port_killer::{kill, kill_by_pids};

fn main() {
    assert!(kill(5000).expect(""));
    assert!(kill_by_pids(&[56812]).expect(""));
}

Goods

fn -> kill · kill_by_pids

Documentation

kill

Clear port occupancy by port

pub fn kill(port: u16) -> Result<bool, Error>

kill_by_pids

Kill processes based on pids

pub fn kill_by_pids(pids: &[u32]) -> Result<bool, Error>

No runtime deps