1 unstable release

0.1.0 Feb 15, 2024

#644 in Unix APIs

Download history 3/week @ 2024-07-28 4/week @ 2024-08-04 28/week @ 2024-08-11 7/week @ 2024-09-08 34/week @ 2024-09-15 20/week @ 2024-09-22 80/week @ 2024-09-29 19/week @ 2024-10-06 43/week @ 2024-10-13 28/week @ 2024-10-20 204/week @ 2024-10-27 128/week @ 2024-11-03

403 downloads per month

LGPL-2.1

185KB
4.5K SLoC

Udisks

An unofficial Rust client crate for udisks2. Udisks allows accessing and manipulating disks, storages devices and similar technologies.

[!WARNING] This project is very early in it's development cycle and far from being finished. Issues and API breaks should be expected.

Example

// we use tokio in this example, but you can use any runtime
#[tokio::main]
async fn main() -> zbus::Result<()> {
    let client = udisks2::Client::new().await?;
    let object = client
        .object("/org/freedesktop/UDisks2/block_devices/sda")
        .expect("No sda device found");
    let block = object.block().await?;
    let drive = client.drive_for_block(&block).await?;
    println!(
        "Size: {}",
        client.size_for_display(drive.size().await?, true, true)
    );
    Ok(())
}

Documentation

While this crate provides documentation for the handwritten code, the generated types may be lacking. In this case it is recommended to use the official documentation.

Dependencies

~8–18MB
~270K SLoC