chore: cargo fmt & geoclue docs
This commit is contained in:
parent
c83767c7e5
commit
8b9767f6ce
7 changed files with 199 additions and 191 deletions
|
|
@ -7,19 +7,19 @@ use futures::stream::StreamExt;
|
|||
use upower_dbus::UPowerProxy;
|
||||
|
||||
fn main() -> zbus::Result<()> {
|
||||
futures::executor::block_on(async move {
|
||||
let connection = zbus::Connection::system().await?;
|
||||
futures::executor::block_on(async move {
|
||||
let connection = zbus::Connection::system().await?;
|
||||
|
||||
let upower = UPowerProxy::new(&connection).await?;
|
||||
let upower = UPowerProxy::new(&connection).await?;
|
||||
|
||||
println!("On Battery: {:?}", upower.on_battery().await);
|
||||
println!("On Battery: {:?}", upower.on_battery().await);
|
||||
|
||||
let mut stream = upower.receive_on_battery_changed().await;
|
||||
let mut stream = upower.receive_on_battery_changed().await;
|
||||
|
||||
while let Some(event) = stream.next().await {
|
||||
eprintln!("{:?}", event.get().await);
|
||||
}
|
||||
while let Some(event) = stream.next().await {
|
||||
eprintln!("{:?}", event.get().await);
|
||||
}
|
||||
|
||||
Ok(())
|
||||
})
|
||||
Ok(())
|
||||
})
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue