Struct libparted::Device [] [src]

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

Methods

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

[src]

Returns the first bad sector if a bad sector was found.

Binding Note

Not 100% sure if this is what this method does, as libparted's source code did not document the behavior of the function. Am basing this off the check() method that was documented for Geometry.

[src]

Return the type of partition table detected on dev

Important traits for DeviceIter<'a>
[src]

Attempts to detect all devices, constructing an Iterator which will contain a list of all of the devices. If you want to use a device that isn't on the list, use the new() method, or an OS-specific constructor such as new_from_store().

[src]

Obtains a handle to the device, but does not open it.

[src]

Attempts to open the device.

[src]

Attempts to get the device of the given path, then attempts to open that device.

[src]

[src]

[src]

Begins external access mode.

External access mode allows you to safely do I/O on the device. If a device is open, then you should not do any I/O on that device, such as by calling an external program like e2fsck, unless you put it in external access mode. You should not use any libparted commands that do I/O to a device while a device is in external access mode.

Note:

You should not close a device while it is in external access mode.

[src]

Flushes all write-behind caches that might be holding up writes.

It is slow because it guarantees cache coherency among all relevant caches.

[src]

Flushes all write-behind caches that might be holding writes.

It does not ensure cache coherency with other caches.

[src]

Indicates whether the device is busy.

[src]

Attempts to write the data within the buffer to the device, starting at the start_sector, and spanning across sectors.

[src]

Get a constraint that represents hardware requirements on geometry.

This function will return a constraint representing the limits imposed by the size of the disk. It will not provide any alignment constraints.

Alignment constraint may be desirable when using media that has a physical sector size that is a multiple of the logical sector size, as in this case proper partition alignment can benefit disk performance significantly.

Note:

When you want a constraint with alignment info, use the following methods:

  • Device::get_minimal_aligned_constraint()
  • Device::get_optimal_aligned_constraint()

[src]

Return a constraint that any region on the given device will satisfy.

[src]

[src]

Get a constraint that represents hardware requirements on geometry and alignment.

This function will return a constraint representing the limits imposed by the size of the disk and the minimal alignment requirements for proper performance of the disk.

[src]

Get a constraint that represents hardware requirements on geometry and alignment.

This function will return a constraint representing the limits imposed by the size of the disk and the alignment requirements for optimal performance of the disk.

[src]

Get an alignment that represents minimum hardware requirements on alignment.

When using media that has a physical sector size that is a multiple of the logical sector size, it is desirable to have disk accesses (and thus partitions) properly aligned. Having partitions not aligned to the minimum hardware requirements may lead to a performance penalty.

The returned alignment describes the alignment for the start sector of the partition. The end sector should be aligned too. To get the end sector alignment, decrease the returned alignment's offset by 1.

[src]

Get an alignment that represents the hardware requirements for optimal performance.

The returned alignment describes the alignment for the start sector of the partition. The end sector should be aligned too. To get the end alignment, decrease the returned alignment's offset by 1.

[src]

Remove all identifying signatures of a partition table.

[src]

[src]

[src]

[src]

[src]

[src]

[src]

[src]

[src]

[src]

[src]

[src]

[src]

[src]

[src]

Trait Implementations

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

[src]

Executes the destructor for this type. Read more

Auto Trait Implementations

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

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