Struct libcoreinst::blockdev::SavedPartitions
source · pub struct SavedPartitions { /* private fields */ }Implementations§
source§impl SavedPartitions
impl SavedPartitions
sourcepub fn new_from_disk(
disk: &mut File,
filters: &[PartitionFilter]
) -> Result<Self>
pub fn new_from_disk( disk: &mut File, filters: &[PartitionFilter] ) -> Result<Self>
Create a SavedPartitions for a block device with a sector size.
sourcepub fn overwrite(&self, disk: &mut File) -> Result<()>
pub fn overwrite(&self, disk: &mut File) -> Result<()>
Unconditionally write the saved partitions, and only the saved partitions, to the disk. Write a protective MBR and overwrite any MBR boot code. Updating the kernel partition table is the caller’s responsibility.
sourcepub fn merge(&self, source: &mut impl Read + Seek, disk: &mut File) -> Result<()>
pub fn merge(&self, source: &mut impl Read + Seek, disk: &mut File) -> Result<()>
If any partitions are saved, merge them into the GPT from source, which must be valid, and write a protective MBR with the correct protective partition size. Updating the kernel partition table is the caller’s responsibility.
sourcepub fn get_sector_size(&self) -> u64
pub fn get_sector_size(&self) -> u64
Get the sector size in use for this partition table.
sourcepub fn get_offset(&self) -> Result<Option<(u64, String)>>
pub fn get_offset(&self) -> Result<Option<(u64, String)>>
Get the byte offset of the first byte not to be overwritten, if any, plus a description of the partition at that offset.