Struct libpart::gpt::GPTTable
[−]
[src]
pub struct GPTTable { /* fields omitted */ }
Methods
impl GPTTable
[src]
fn exists<T: Read + Seek>(
read: &mut T,
options: &GPTOptions
) -> Result<bool, IOError>
read: &mut T,
options: &GPTOptions
) -> Result<bool, IOError>
fn load<T: Read + Seek>(
read: &mut T,
options: &GPTOptions
) -> Result<GPTTable, GPTError>
read: &mut T,
options: &GPTOptions
) -> Result<GPTTable, GPTError>
Load a GPT from file or stream
fn write<W: Write + Seek>(
&self,
write: &mut W,
options: &GPTOptions
) -> Result<(), GPTError>
&self,
write: &mut W,
options: &GPTOptions
) -> Result<(), GPTError>
Write a GPT to file. will write both primary and backup
fn part_count(&self) -> u64
Gets the amount of partitions that are in use.
Please note that if there is an empty part inbetween, it is not counted. So say you have /dev/sda1, /dev/sda2 and /dev/sda4, but no /dev/sda3, this would still return 3
fn partitions(&self) -> &[Option<PartitionEntry>]
Gives you readonly access to all partitions
fn next_id(&self) -> Option<u64>
Get the first free partition ID
Returns Some(id) if there is still space
Returns None if all partition slots are occupied
fn set_partition(
&mut self,
id: u64,
part: PartitionEntry
) -> Result<(), GPTError>
&mut self,
id: u64,
part: PartitionEntry
) -> Result<(), GPTError>
Set a partition entry to whatever you specified
fn delete_partition(&mut self, id: u64) -> Result<(), GPTError>
Mark a partition slot as empty