Crates.io | passcod-networkmanager |
lib.rs | passcod-networkmanager |
version | 0.7.0-pre.1 |
source | src |
created_at | 2024-01-28 07:40:13.183832 |
updated_at | 2024-01-28 16:31:02.059571 |
description | Bindings for the Linux NetworkManager (fork) |
homepage | |
repository | https://github.com/passcod/networkmanager |
max_upload_size | |
id | 1117381 |
size | 377,845 |
Fork by @passcod to rewrite a few APIs to be more ergonomic.
NetworkManager bindings for Rust using the D-Bus message bus system
This project is still under development. Currently implemented parts can be found in the docs.
Add networkmanager to your Cargo.toml
with:
[dependencies]
networkmanager = { package = "passcod-networkmanager", version = "=0.7.0-pre.1" }
tokio = { version = "1", features = ["full"] }
use networkmanager::{Error, NetworkManager};
#[tokio::main]
async fn main() -> Result<(), Error> {
let nm = NetworkManager::new().await?;
for dev in nm.get_devices().await? {
if let Some(wifi) = dev.to_wireless().await? {
println!("Bitrate: {:?}", wifi.bitrate().await?);
wifi.request_scan().await?;
for ap in wifi.get_all_access_points().await? {
let raw = ap.ssid().await?;
println!("SSID: {} {raw:02x?}", String::from_utf8_lossy(&raw));
}
}
}
Ok(())
}
Licensed under either of
at your option.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.