diff --git a/CHANGELOG.md b/CHANGELOG.md index 343e27fe3..a4d4f2f1b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ - Added the `ComponentName1` and `ComponentName2` protocols. The `ComponentName` wrapper will automatically select `ComponentName2` if available, and fall back to `ComponentName1` otherwise. +- `FileType`, `FileHandle`, `RegularFile`, and `Directory` now implement `Debug`. ### Changed diff --git a/uefi/src/proto/media/file/dir.rs b/uefi/src/proto/media/file/dir.rs index 03358346c..640ec7a18 100644 --- a/uefi/src/proto/media/file/dir.rs +++ b/uefi/src/proto/media/file/dir.rs @@ -13,6 +13,7 @@ use {alloc::alloc::Global, core::alloc::Allocator}; /// addition to supporting the normal `File` operations, `Directory` /// supports iterating over its contained files. #[repr(transparent)] +#[derive(Debug)] pub struct Directory(RegularFile); impl Directory { diff --git a/uefi/src/proto/media/file/mod.rs b/uefi/src/proto/media/file/mod.rs index c75be782f..bcd351705 100644 --- a/uefi/src/proto/media/file/mod.rs +++ b/uefi/src/proto/media/file/mod.rs @@ -236,6 +236,7 @@ impl FileInternal for T {} /// /// Dropping this structure will result in the file handle being closed. #[repr(transparent)] +#[derive(Debug)] pub struct FileHandle(*mut FileImpl); impl FileHandle { @@ -365,7 +366,8 @@ pub(super) struct FileImpl { flush: extern "efiapi" fn(this: &mut FileImpl) -> Status, } -/// Disambiguates the file type. Returned by `File::into_type()`. +/// Disambiguate the file type. Returned by `File::into_type()`. +#[derive(Debug)] pub enum FileType { /// The file was a regular (data) file. Regular(RegularFile), diff --git a/uefi/src/proto/media/file/regular.rs b/uefi/src/proto/media/file/regular.rs index b4fd1af73..f289fb56d 100644 --- a/uefi/src/proto/media/file/regular.rs +++ b/uefi/src/proto/media/file/regular.rs @@ -7,11 +7,12 @@ use crate::{Result, Status}; /// In addition to supporting the normal `File` operations, `RegularFile` /// supports direct reading and writing. #[repr(transparent)] +#[derive(Debug)] pub struct RegularFile(FileHandle); impl RegularFile { /// A special position used to seek to the end of a file with `set_position()`. - pub const END_OF_FILE: u64 = core::u64::MAX; + pub const END_OF_FILE: u64 = u64::MAX; /// Coverts a `FileHandle` into a `RegularFile` without checking the file kind. /// # Safety