pub fn new(chunk: [u8; 128]) -> Self {
        // get the various guids
        let part_type_guid          = bytes_to_guid(chunk[0..16].try_into().unwrap());
        let part_guid               = bytes_to_guid(chunk[16..32].try_into().unwrap());

        // get the various lba and flag things
        let first_lba               = u64::from_ne_bytes(chunk[32..40].try_into().unwrap());
        let last_lba                = u64::from_ne_bytes(chunk[40..48].try_into().unwrap());
        let attr_flags              = u64::from_ne_bytes(chunk[48..56].try_into().unwrap());

        // get the partition name
        let part_name: [u8; 72]     = chunk[56..].try_into().unwrap();
        
        // return the structure
        GPTPartition {
            part_type_guid,
            part_guid,
            first_lba,
            last_lba,
            attr_flags,
            part_name
        }
    }
/// creates a new GPTPartition from raw bytes
creates a new GPTPartition from raw bytes
creates a new GPTPartition from raw bytes
pub fn new(chunk: [u8; 128]) -> Self {
        // get the various guids
        let part_type_guid          = bytes_to_guid(chunk[0..16].try_into().unwrap());
        let part_guid               = bytes_to_guid(chunk[16..32].try_into().unwrap());
        // get the various lba and flag things
        let first_lba               = u64::from_ne_bytes(chunk[32..40].try_into().unwrap());
        let last_lba                = u64::from_ne_bytes(chunk[40..48].try_into().unwrap());
        let attr_flags              = u64::from_ne_bytes(chunk[48..56].try_into().unwrap());
        // get the partition name
        let part_name: [u8; 72]     = chunk[56..].try_into().unwrap();
        // return the structure
        GPTPartition {
            part_type_guid,
            part_guid,
            first_lba,
            last_lba,
            attr_flags,
            part_name
        }
    }
pub fn new ( chunk : [ u8 ; 128 ] ) -> Self { // get the various guids let part_type_guid = bytes_to_guid ( chunk [ 0 .. 16 ] . try_into ( ) . unwrap ( ) ) ; let part_guid = bytes_to_guid ( chunk [ 16 .. 32 ] . try_into ( ) . unwrap ( ) ) ; // get the various lba and flag things let first_lba = u64 :: from_ne_bytes ( chunk [ 32 .. 40 ] . try_into ( ) . unwrap ( ) ) ; let last_lba = u64 :: from_ne_bytes ( chunk [ 40 .. 48 ] . try_into ( ) . unwrap ( ) ) ; let attr_flags = u64 :: from_ne_bytes ( chunk [ 48 .. 56 ] . try_into ( ) . unwrap ( ) ) ; // get the partition name let part_name : [ u8 ; 72 ] = chunk [ 56 .. ] . try_into ( ) . unwrap ( ) ; // return the structure GPTPartition { part_type_guid , part_guid , first_lba , last_lba , attr_flags , part_name } }
creates a new GPTPartition from raw bytes
creates a new GPTPartition from raw bytes
chunk
[u8; 128]
chunk
[u8; 128]