#[repr(u8)]pub enum PartitionType {
PartTab = 0,
Boot = 1,
Sys = 2,
Cal = 3,
User = 4,
Fw1 = 5,
Fw2 = 6,
Var = 7,
MP = 8,
Rdp = 9,
Unknown = 10,
}
Expand description
Enum representing all different types of partitions. (as per _convert_pt_type)
§Variants
-
PartTab
: Partition table (0). -
Boot
: Boot partition (1). -
Sys
: System partition (2). -
Fw1
: Firmware partition 1. -
Fw2
: Firmware partition 2. -
Cal
: Calibration partition (5). -
User
: User data partition (6). -
Var
: Variable partition (7). -
MP
: Main partition (8). -
Rdp
: Reserved partition (9).
§Example
use amebazii::types::enums::PartitionType;
let part = PartitionType::try_from(1).unwrap();
assert_eq!(part, PartitionType::Boot); // Successfully converts to Boot partition.
Variants§
PartTab = 0
Partition table (0).
Boot = 1
Boot partition (1).
Sys = 2
System partition (4).
Cal = 3
Calibration partition (5).
User = 4
User data partition (6).
Fw1 = 5
Firmware partition 1 (2).
Fw2 = 6
Firmware partition 2 (3).
Var = 7
Variable partition (7).
MP = 8
Main partition (8).
Rdp = 9
Reserved partition (9).
Unknown = 10
Trait Implementations§
Source§impl Clone for PartitionType
impl Clone for PartitionType
Source§fn clone(&self) -> PartitionType
fn clone(&self) -> PartitionType
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for PartitionType
impl Debug for PartitionType
Source§impl<'de> Deserialize<'de> for PartitionType
impl<'de> Deserialize<'de> for PartitionType
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl Hash for PartitionType
impl Hash for PartitionType
Source§impl Ord for PartitionType
impl Ord for PartitionType
Source§fn cmp(&self, other: &PartitionType) -> Ordering
fn cmp(&self, other: &PartitionType) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl PartialEq for PartitionType
impl PartialEq for PartitionType
Source§impl PartialOrd for PartitionType
impl PartialOrd for PartitionType
Source§impl Serialize for PartitionType
impl Serialize for PartitionType
Source§impl TryFrom<u8> for PartitionType
impl TryFrom<u8> for PartitionType
Source§fn try_from(value: u8) -> Result<Self, Self::Error>
fn try_from(value: u8) -> Result<Self, Self::Error>
Attempts to convert a u8
value to the corresponding PartitionType
variant.
This method maps a u8
value to the appropriate PartitionType
variant.
If the value is not valid, it returns an error indicating that the partition type
is invalid.
§Parameters
value
: Theu8
value representing the partition type.
§Returns
Ok(PartitionType)
: The correspondingPartitionType
variant if the value matches.Err(Error::InvalidEnumValue)
: An error if the value doesn’t match a valid partition type.