Crates.io | guid-partition-types |
lib.rs | guid-partition-types |
version | 0.1.0 |
source | src |
created_at | 2019-02-25 03:08:58.688656 |
updated_at | 2019-02-25 03:08:58.688656 |
description | A small crate designed to work with parition types and their GUIDs |
homepage | |
repository | |
max_upload_size | |
id | 117045 |
size | 24,599 |
A small crate designed to work with parition types and their GUIDs
Because I was working with partition types and their GUIDs and I noticed there wasn't a crate for that. So I made one.
System
and PartitionType
enumsThis crate simply introduces two enums (System
& PartitionType
) and a struct (GUID
)
System
enum contains variants that are named after the supported OS types, e.g Windows, Linux, FreeBSD, Apple, ChromeOS
PartitionType
enum contains 127 variants of all documented partition type GUIDs following the format ($SYSTEMNAME)($PARTITIONTYPE)Partition
for instance LinuxRaidPartition
or CephDMCryptLUKSBlockWriteAhedLogPartition
GUID
struct simply binds a System
and a PartitionType
variant together with Debug
and Display
implemented.pub struct GUID {
string: &'static str,
system: Option<System>
}
that being said heres an example of printing out the EFI GUID struct.
extern crate guid_partition_types_rs;
use guid_partition_types_rs::{
GUID,
System,
GENERAL_PARTITION_TYPES
};
fn main() {
println!("{:?}", GENERAL_PARTITION_TYPES.get("EFI"));
}