tree: 7c190e4bb852581122f5a497d75ac1f55894773e [path history] [tgz]
  1. examples/
  2. src/
  3. tests/
  4. .cargo-checksum.json
  5. Cargo.lock
  6. Cargo.toml
  7. LICENSE
  8. README.md
third_party/rust_crates/vendor/gpt/README.md

gpt

Build Status crates.io minimum rust 1.34 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

extern crate gpt;
use gpt::header::{Header, read_header};
use gpt::partition::{Partition, read_partitions};

fn inspect_disk() {
    let lb_size = gpt::disk::DEFAULT_SECTOR_SIZE;
    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);
}