File: bug.rs

package info (click to toggle)
rust-udisks2 0.3.1-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 604 kB
  • sloc: xml: 511; makefile: 2
file content (18 lines) | stat: -rw-r--r-- 545 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#[tokio::main]
async fn main() -> udisks2::Result<()> {
    let client = udisks2::Client::new().await.unwrap();
    let block = client
        .object("/org/freedesktop/UDisks2/block_devices/loop0") // has no Drive (the Drive property is '/')
        .unwrap()
        .block()
        .await
        .expect("can not create BlockProxy for loop0 block");

    assert!(block.drive().await.unwrap().as_ref() == "/");

    client
        .drive_for_block(&block)
        .await
        .expect("can not create Drive for loop0 block");
    Ok(())
}