#[repr(C, packed(1))]pub struct GptPartitionEntry {
pub partition_type_guid: GptPartitionType,
pub unique_partition_guid: Guid,
pub starting_lba: LbaLe,
pub ending_lba: LbaLe,
pub attributes: GptPartitionAttributes,
pub name: GptPartitionName,
}
Expand description
An entry within the GPT partition array.
Fields§
§partition_type_guid: GptPartitionType
Unique ID representing the partition’s type. If the type is
GptPartitionType::UNUSED
, this entry in the partition array
is not in use.
unique_partition_guid: Guid
GUID that is unique for every partition entry.
starting_lba: LbaLe
LBA of the partition’s first block.
ending_lba: LbaLe
LBA of the partition’s last block.
attributes: GptPartitionAttributes
Attribute bit flags.
name: GptPartitionName
Human readable partition label encoded as a null-terminated UCS-2 string.
Implementations§
Source§impl GptPartitionEntry
impl GptPartitionEntry
Sourcepub fn lba_range(&self) -> Option<LbaRangeInclusive>
pub fn lba_range(&self) -> Option<LbaRangeInclusive>
Get the range of blocks covered by this partition. Returns
None
if the ending_lba
is less than the starting_lba
.
Sourcepub fn is_used(&self) -> bool
pub fn is_used(&self) -> bool
Check if the entry is in use. If the partition_type_guid
is
GptPartitionType::UNUSED
, the entry is considered unused,
which means there is no partition data associated with the entry.
Trait Implementations§
Source§impl Clone for GptPartitionEntry
impl Clone for GptPartitionEntry
Source§fn clone(&self) -> GptPartitionEntry
fn clone(&self) -> GptPartitionEntry
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for GptPartitionEntry
impl Debug for GptPartitionEntry
Source§impl Default for GptPartitionEntry
impl Default for GptPartitionEntry
Source§fn default() -> GptPartitionEntry
fn default() -> GptPartitionEntry
Returns the “default value” for a type. Read more
Source§impl Display for GptPartitionEntry
impl Display for GptPartitionEntry
Source§impl Hash for GptPartitionEntry
impl Hash for GptPartitionEntry
Source§impl Ord for GptPartitionEntry
impl Ord for GptPartitionEntry
Source§fn cmp(&self, other: &GptPartitionEntry) -> Ordering
fn cmp(&self, other: &GptPartitionEntry) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialEq for GptPartitionEntry
impl PartialEq for GptPartitionEntry
Source§impl PartialOrd for GptPartitionEntry
impl PartialOrd for GptPartitionEntry
impl Copy for GptPartitionEntry
impl Eq for GptPartitionEntry
impl Pod for GptPartitionEntry
impl StructuralPartialEq for GptPartitionEntry
Auto Trait Implementations§
impl Freeze for GptPartitionEntry
impl RefUnwindSafe for GptPartitionEntry
impl Send for GptPartitionEntry
impl Sync for GptPartitionEntry
impl Unpin for GptPartitionEntry
impl UnwindSafe for GptPartitionEntry
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
Source§impl<T> CheckedBitPattern for Twhere
T: AnyBitPattern,
impl<T> CheckedBitPattern for Twhere
T: AnyBitPattern,
Source§type Bits = T
type Bits = T
Self
must have the same layout as the specified Bits
except for
the possible invalid bit patterns being checked during
is_valid_bit_pattern
.Source§fn is_valid_bit_pattern(_bits: &T) -> bool
fn is_valid_bit_pattern(_bits: &T) -> bool
If this function returns true, then it must be valid to reinterpret
bits
as &Self
.