pub struct MasterBootRecord { /* private fields */ }
Expand description

A struct representing an MBR partition table.

Implementations

Parses the MBR table from a raw byte buffer.

Throws an error in the following cases:

  • BufferWrongSizeError if bytes.len() is less than 512
  • InvalidMBRSuffix if the final 2 bytes in bytes are not [0x55, 0xaa]
  • UnsupportedPartitionError if the MBR contains a tag that the crate does not recognize

Serializes this MBR partition table to a raw byte buffer. Throws an error in the following cases:

  • BufferWrongSizeError if buffer.len() is less than 512

Note that it only affects the partition table itself, which only appears starting from byte 446 of the MBR; no bytes before this are affected, even though it is still necessary to pass a full 512 byte buffer.

Trait Implementations

The size of the partition table itself, in bytes.
The entries in this table.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.