Crates.io | min-tun |
lib.rs | min-tun |
version | 0.1.2 |
source | src |
created_at | 2023-08-28 10:18:20.084258 |
updated_at | 2023-08-28 10:28:26.987835 |
description | A Rust library for finding the minimum available TUN device on Linux systems. |
homepage | |
repository | https://github.com/inceabdullah/min-tun |
max_upload_size | |
id | 956815 |
size | 5,249 |
min-tun
is a Rust library for finding the minimum available TUN device on Linux systems. This crate provides a simple and reliable way to determine which TUN device names are available for use.
To build the crate, follow these steps:
Clone the repository:
git clone https://github.com/yourusername/min-tun.git
Replace yourusername
with your actual GitHub username and min-tun
with your repository name if different.
Navigate into the project directory:
cd min-tun
Build the crate:
cargo build
To use min-tun
in your Rust project, you need to include it as a dependency in your Cargo.toml
:
[dependencies]
min-tun = "0.1.0" # Replace with the actual version number if different
After adding the dependency, you can use the crate in your code. Here's a simple example:
// main.rs
fn main() {
match min_tun::find_min_available_tun() {
Some(tun_name) => println!("Minimum available tun device: {}", tun_name),
None => println!("Could not find an available tun device"),
}
}
To build and run your project, execute:
cargo build
cargo run
This project is licensed under the MIT License - see the LICENSE file for details.