#port #kill #process #port-killer

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

#1048 in Unix APIs

Download history 37/week @ 2024-12-17 4/week @ 2024-12-24 50/week @ 2024-12-31 103/week @ 2025-01-07 34/week @ 2025-01-14 37/week @ 2025-01-21 40/week @ 2025-01-28 65/week @ 2025-02-04 62/week @ 2025-02-11 85/week @ 2025-02-18 50/week @ 2025-02-25 52/week @ 2025-03-04 34/week @ 2025-03-11 76/week @ 2025-03-18 47/week @ 2025-03-25 69/week @ 2025-04-01

237 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