Work on more Rust-side bindings

This commit is contained in:
Lucy 2022-01-11 16:02:29 -05:00
parent 91a7fc6da1
commit da5c6ed172
No known key found for this signature in database
GPG key ID: EBC517FAD666BBF1
7 changed files with 116 additions and 2 deletions

View file

@ -25,4 +25,17 @@ impl<'a> NetworkManager<'a> {
}
Ok(out)
}
pub async fn all_devices(&self) -> Result<Vec<Device<'a>>> {
let devices = self.0.get_all_devices().await?;
let mut out = Vec::with_capacity(devices.len());
for device in devices {
let device = DeviceProxy::builder(self.0.connection())
.path(device)?
.build()
.await?;
out.push(device.into());
}
Ok(out)
}
}