Skip to main content

GptDiskReadExt

Trait GptDiskReadExt 

Source
pub trait GptDiskReadExt: 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 GptDisk from I/O sources.

Required Methods§

Source

fn read_from<R: Read + Seek>(reader: &mut R, block_size: u32) -> Result<Self>

Reads a GPT disk structure from a reader.

Reads the primary GPT header at LBA 1 and the partition entry array. The reader should be positioned at the beginning of the disk (LBA 0).

§Arguments
  • reader - The reader to read from
  • block_size - The logical block size in bytes (typically 512)
§Errors

Returns an error if reading fails or if the GPT structure is invalid.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl GptDiskReadExt for GptDisk

Available on crate feature sync only.