pub trait PartitionTableReadExt: Sized {
// Required method
fn read_from<R: Read + Seek>(
reader: &mut R,
block_size: u32,
) -> Result<Self>;
}Available on crate features
alloc and read only.Expand description
Extension trait for reading PartitionTable from I/O sources.
Required Methods§
Sourcefn read_from<R: Read + Seek>(reader: &mut R, block_size: u32) -> Result<Self>
fn read_from<R: Read + Seek>(reader: &mut R, block_size: u32) -> Result<Self>
Detects and reads a partition scheme from a disk image.
This method:
- Reads the MBR at LBA 0
- Detects if it’s a protective MBR (GPT) or hybrid MBR
- If protective/hybrid, reads the GPT structure
- Returns the appropriate partition scheme
§Arguments
reader- The reader to read from (should be positioned at LBA 0)block_size- The logical block size in bytes (typically 512)
§Errors
Returns an error if reading fails or if the partition structure is invalid.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".
Implementors§
impl PartitionTableReadExt for PartitionTable
Available on crate feature
sync only.