[][src]Crate gpt

A pure-Rust library to work with GPT partition tables.

It provides support for manipulating (R/W) GPT headers and partition tables. Raw disk devices as well as disk images are supported.

extern crate gpt;

fn inspect_disk() {
    let diskpath = std::path::Path::new("/dev/sdz");
    let cfg = gpt::GptConfig::new().writable(false);

    let disk = cfg.open(diskpath).expect("failed to open disk");

    println!("Disk header: {:#?}", disk.primary_header());
    println!("Partition layout: {:#?}", disk.partitions());
}

Modules

disk

Disk-related types and helper functions.

header

GPT-header object and helper functions.

mbr

MBR-related types and helper functions.

partition

Partition-related types and helper functions.

partition_types

Parition type constants

Structs

GptConfig

Configuration options to open a GPT disk.

GptDisk

A file-backed GPT disk.