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.
pub fn is_saved(&self) -> bool
Trait Implementations§
Auto Trait Implementations§
impl Freeze for SavedPartitions
impl RefUnwindSafe for SavedPartitions
impl Send for SavedPartitions
impl Sync for SavedPartitions
impl Unpin for SavedPartitions
impl UnwindSafe for SavedPartitions
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more