nmrs
Rust bindings for NetworkManager via D-Bus.
Overview
nmrs provides a high-level, async API for managing Wi-Fi connections on Linux systems. It abstracts the complexity of D-Bus communication with NetworkManager, offering typed error handling and an ergonomic interface.
Features
- Network Operations: Connect to WPA-PSK, WPA-EAP, and open networks
- Discovery: Scan for and list available access points with signal strength
- Profile Management: Query, create, and delete saved connection profiles
- Status Queries: Get current connection state, SSID, and detailed network information
- Typed Errors: Structured error types mapping NetworkManager state reason codes
- Fully Async: Built on
tokiowithasync/awaitsupport
Installation
[]
= "0.4"
Quick Start
use ;
async
Error Handling
All operations return Result<T, ConnectionError> with specific error variants:
use ConnectionError;
match nm.connect.await
Logging
This crate uses the log facade. Enable logging with:
init;
Then run with RUST_LOG=nmrs=debug to see detailed logs.
Documentation
Full API documentation is available at docs.rs/nmrs.
Requirements
- Linux with NetworkManager
- D-Bus system bus access
License
MIT