Struct libparted::Disk [] [src]

pub struct Disk<'a> { /* fields omitted */ }

Methods

impl<'a> Disk<'a>
[src]

[src]

Read the partition table off a device (if one is found).

Warning: May modify the supplied device if the partition table indicates that the existing values are incorrect.

[src]

Creates a new partition table on device.

The new partition table is only created in-memory, and nothing is written to disk until disk.commit_to_dev() is called.

[src]

Obtains the inner device from the disk.

[src]

Obtains the inner device from the disk, with mutable access.

[src]

Obtains the constraint of the inner device.

[src]

[src]

[src]

[src]

Get the state of a set flag on a disk.

[src]

Check whether a given flag is available on a disk

[src]

Prints a summary of the disk's partitions. Useful for debugging.

Important traits for DiskPartIter<'a>
[src]

[src]

Adds the supplied part Partition to the disk.

Warning: The partition's geometry may be changed, subject to constraint. You could set constraint to constraint_exact(&part.geom), but many partition table schemes have special requirements on the start and end of partitions. Therefore, having an overly strict constraint will probably mean that this function will fail (in which case part will be left unmodified) part is assigned a number (part.num) in this process.

[src]

Get the highest available partition number on the disk.

[src]

Get the highest supported partition number on the disk.

[src]

Get the maximum number of (primary) partitions that the disk label supports.

[src]

Get the maximum geometry part can be grown to, subject to constraint.

[src]

Perform a sanity check on a partition table

NOTE: The check performed is generic (ie: it does not depend on the label type of the disk).

[src]

Remove all identifying signatures of a partition table.

[src]

Writes the in-memory changes to a partition table to disk and informs the operating system of the changes.

NOTE: Equivalent to calling disk.commit_to_dev(), followed by disk.commit_to_os().

[src]

Write the changes made to the in-memory description of a partition table to the device.

[src]

Tell the operating system kernel about the partition table layout of disk.

[src]

Removes and destroys all partitions on disk.

[src]

[src]

[src]

Get the alignment needed for partition boundaries on this disk.

The returned alignment describes the alignment for the start sector of the partition, for all disklabel types which require alignment, except Sun disklables, the end sector must be aligned too. To get the end sector alignment, decrease the Alignment offset by 1.

[src]

Returns the partition that contains sector. If sector lies within a logical partition, then the logical partition is returned (not the extended partition).

[src]

Similar to get_partition_by_sector, but returns a raw pointer instead.

[src]

Returns the partition numbered num.

[src]

Similar to get_partition, but returns a raw pointer instead.

[src]

Get the number of primary partitions.

[src]

Return the maximum representable length (in sectors) of a partition on the disk.

[src]

Return the maximum representable start sector of a partition on the disk.

[src]

Grow the supplied part to the maximimum size possible, subject to constraint. The new geometry will be a superset of the old geometry.

[src]

Reduce the size of the extended partition to a minimum while still wrapping its logical partitions. If there are no logical partitions, remove the extended partition.

[src]

Removes the part Partition from the disk.

If part is an extended partition, it must not contain any logical partitions.

[src]

Removes a partition from the disk by the partition number.

If that partition is an extended partition, it must not contain any logical partitions.

[src]

Removes a partition from the disk by the sector where that partition lies.alignment

If that partition is an extended partition, it must not contain any logical partitions.

[src]

Set the state of a flag on a disk.

Note

It is an error to call tis on an unavailable flag. Use disk.is_flag_available() to determine whhich flags are available for a given disk label.

Throws

Throws PED_EXCEPTION_ERROR if the requested flag is not available for this label.

[src]

Sets the geometry of part (IE: change a partition's location).

This can fail for many reasons, such as overlapping with other partitions. If it does fail, part will remain unchanged.

[src]

Trait Implementations

impl<'a> Drop for Disk<'a>
[src]

[src]

Executes the destructor for this type. Read more

Auto Trait Implementations

impl<'a> !Send for Disk<'a>

impl<'a> !Sync for Disk<'a>