gpt

Build Status crates.io minimum rust 1.31 Documentation

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

gpt provides support for manipulating (R/W) GPT headers and partition tables. It supports raw disk devices as well as disk images.

Example

```rust extern crate gpt; use gpt::header::{Header, readheader}; use gpt::partition::{Partition, readpartitions};

fn inspectdisk() { let lbsize = gpt::disk::DEFAULTSECTORSIZE; let diskpath = std::path::Path::new("/dev/sdz");

let hdr = header::read_header(diskpath, lb_size).unwrap();
println!("Disk header: {:#?}", h);

let pp = read_partitions(diskpath, &hdr, lb_size).unwrap();
println!("Partition layout: {:#?}", pp);

} ```