Diffstat (limited to 'src/nm/client.rs')
1 file changed, 25 deletions(-)
@@ -1,25 +1,0 @@
use anyhow::Result;
use zbus::{Connection, Proxy};
pub struct NmClient {
pub connection: Connection,
pub proxy: Proxy<'static>,
}
impl NmClient {
pub async fn new() -> Result<Self> {
// Connect to system D-Bus
let connection = Connection::system().await?;
// Create NetworkManager proxy
let proxy = Proxy::new(
&connection,
"org.freedesktop.NetworkManager",
"/org/freedesktop/NetworkManager",
"org.freedesktop.NetworkManager",
)
.await?;
Ok(Self { connection, proxy })
}
}