You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: gpt.rs
    path of file: ./repos/aero/src/aero_kernel/src/fs/block
    
    the code of the file until where you have to start completion: // Copyright (C) 2021-2024 The Aero Project Developers.
//
// This file is part of The Aero Project.
//
// Aero is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Aero is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You sh
    
    pub fn new(controller: Arc<BlockDevice>) -> Option<Self> {
        // Get the GPT header.
        let mut header = Box::<GptTableHeader>::new_uninit();

        controller
            .read_block(1, header.as_bytes_mut())
            .expect("gpt: failed to read first sector");

        // SAFETY: The buffer is initialized above.
        let header = unsafe { header.assume_init() };

        if header.signature != GPT_TABLE_SIGNATURE {
            return None;
        }

        let entry_size = header.entry_size as usize;
        assert_eq!(entry_size, core::mem::size_of::<GptEntry>());

        let mut entry_list = Box::<[GptEntry]>::new_uninit_slice(header.num_entries as usize);

        controller
            .read_block(
                header.starting_lba as _,
                MaybeUninit::slice_as_bytes_mut(&mut entry_list),
            )
            .expect("gpt: failed to read entry list");

        // SAFETY: The entries list is initialized above.
        let entries = unsafe { entry_list.assume_init() };

        Some(Self { entries })
    }