file_system/mbr/partition/
kind.rs1#[derive(Debug, Clone, Copy, PartialEq, Eq, Default)]
5pub enum PartitionKind {
6 #[default]
8 Empty,
9 Xila,
11 Other(u8),
13}
14
15impl From<u8> for PartitionKind {
16 fn from(val: u8) -> Self {
17 match val {
18 0x00 => Self::Empty,
19 0xDA => Self::Xila,
20 other => Self::Other(other),
21 }
22 }
23}
24
25impl From<PartitionKind> for u8 {
26 fn from(kind: PartitionKind) -> Self {
27 match kind {
28 PartitionKind::Empty => 0x00,
29 PartitionKind::Xila => 0xDA,
30 PartitionKind::Other(val) => val,
31 }
32 }
33}