| Crates.io | gscan |
| lib.rs | gscan |
| version | 0.1.8 |
| created_at | 2026-01-08 13:01:13.465689+00 |
| updated_at | 2026-01-09 23:35:32.336456+00 |
| description | High-performance async network scanning library |
| homepage | |
| repository | https://github.com/evengarli/gscan |
| max_upload_size | |
| id | 2030171 |
| size | 13,997 |
gscan is a lightweight, async-powered network port scanning library written in Rust.
It uses an internal asynchronous engine (powered by Tokio) to perform fast TCP port scans, while exposing a simple, blocking API suitable for small tools, scripts, and experiments.
async, await, or #[tokio::main] required by the callerAdd this to your Cargo.toml:
[dependencies]
gscan = "0.1.5"
The library exposes a single public scanning function:
pub fn scan(ip: &str, port_start: u16, port_end: u16) -> ScanResult
ScanResult Structure
pub struct ScanResult {
pub ip: IpAddr,
pub ports: Vec<u16>,
}
Example: Scanning a Local Port Range
use gscan;
fn main() {
println!("Starting scan...");
let result = gscan::scan("127.0.0.1", 1, 1000);
println!("Scan complete for IP: {}", result.ip);
println!("Open ports found: {:?}", result.ports);
}
Distributed under the MIT License.