Expand description

Read basic MBR and GPT partition tables from a reader.

Examples

Load MBR or GPT partitions from a reader:

use std::io;
use bootsector::{list_partitions, open_partition, Options, Attributes};

// let reader = ...;
let partitions = list_partitions(&mut reader, &Options::default())?;
let part = &partitions[0];

// See what type of partition this is
match part.attributes {
    Attributes::GPT {
        type_uuid,
        ..
    } => println!("gpt: {:?}", type_uuid),
    Attributes::MBR {
        type_code,
        ..
    } => println!("mbr: {:x}", type_code),
}

let part_reader = open_partition(reader, part);
// part_reader.read_exact(...

Re-exports

pub use positioned_io2 as pio;

Structs

Configuration for listing partitions.

An entry in the partition table.

Enums

Table-specific information about a partition.

What type of GPT partition tables should we attempt to read?

What type of MBR partition tables should we attempt to read?

Settings for handling sector size

Functions

Read the list of partitions.

Open the contents of a partition for reading.