Raw Module
The nmrs::raw module re-exports the D-Bus dependencies nmrs uses internally:
#![allow(unused)] fn main() { pub mod raw { pub use zbus; pub use zvariant; } }
Use it together with NetworkManager::dbus_connection()
when you need D-Bus methods that nmrs does not wrap yet. For builder output,
prefer add_connection
and add_and_activate_connection.
Why it exists
Builder methods such as WifiConnectionBuilder::build() return
HashMap<&str, HashMap<&str, zvariant::Value<'_>>>. Without nmrs::raw,
consumers would need to depend on their own zbus / zvariant versions and
hope they match the ones nmrs was built against.
Re-exporting them under nmrs::raw keeps those types compatible with builder
output and with the connection returned by dbus_connection().
Typical workflow
- Build settings with a builder (for example
WifiConnectionBuilder). - Obtain the shared system bus connection via
nm.dbus_connection(). - Create a zbus proxy on that connection using
nmrs::raw::zbus. - Call
AddConnectionorAddAndActivateConnectionon NetworkManager.
See Submitting Builder Output for the preferred high-level workflow and D-Bus Architecture for background on how nmrs talks to NetworkManager.
What is not exposed
nmrs::raw does not re-export nmrs's internal D-Bus proxy types from
nmrs::dbus. Those remain implementation details. Advanced callers define
their own minimal #[zbus::proxy] traits (or use call_method directly) on
top of dbus_connection() and nmrs::raw.
Full API Reference
See docs.rs/nmrs::raw.