Struct libparted::Partition[][src]

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

Implementations

Create a new Partition on disk.

Note:

The constructed partition is not added to disk’s partition table. Use Disk::add_partition() to do this.

Throws:

Throws PED_EXCEPTION_ERROR if type is EXTENDED or LOGICAL but the label does not support this concept.

Get the state of a flag on the disk.

Return a path that can be used to address the partition in the operating system.

Returns whether or not the partition is active.

A partition is active if the type is neither PED_PARTITION_METADATA nor PED_PARTITION_FREE.

Check whether a partition is mounted or busy in some other way.

Note:

An extended partition is busy if any logical partitions are mounted.

Check whether a given flag is available on a disk.

Returns the name of a partition part. This will only work if the disk label supports it.

Set the state of a flag on a partition.

Flags are disk label specific, although they have a global namespace: the flag PED_PARTITION_BOOT, for example, roughly means “this partition is bootable”. But this means different things on different disk labels (and may not be defined on some disk labels). For example, on MS-DOS disk labels, there can only be one boot partition, and this refers to the partition that will be booted from on startup. On PC98 disk labels, the user can choose from any bootable partition on startup.

Note:

It is an error to call this on an unavailable flag – use Partition::is_flag_available() to determine which flags are available for a given disk label.

Throws:

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

Sets the name of a partition.

Note:

This will only work if the disk label supports it.

You can use

DiskType::check_feature(DiskTypeFeature::PED_DISK_TYPE_PARTITION_NAME);

to check whether this feature is enabled for a label.

Additional Note:

name will not be modified by libparted. It can be freed by the caller immediately after Partition::set_name() is called.

Sets the system type on the partition to fs_type.

Note:

The file system may be opened, to get more information about the file system, such as to determine if it is FAT16 or FAT32.

Returns a name that seems mildly appropriate for a partition type type.

Trait Implementations

Executes the destructor for this type. Read more

Performs the conversion.

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

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

Performs the conversion.

Performs the conversion.

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.