Skip to content

Commit 386aade

Browse files
committed
high level fs abstraction WIP
1 parent c5ef515 commit 386aade

File tree

4 files changed

+16
-9
lines changed

4 files changed

+16
-9
lines changed

Cargo.toml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,11 @@ logger = []
2727
# were observed on the VirtualBox UEFI implementation (see uefi-rs#121).
2828
# In those cases, this feature can be excluded by removing the default features.
2929
panic-on-logger-errors = []
30+
# high level FS abstraction
31+
fs = [
32+
"alloc",
33+
"exts"
34+
]
3035

3136
[dependencies]
3237
bitflags = "1.3.1"

src/fs/file_system.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,9 @@ impl From<PathError> for FileSystemError {
4848
/// Return type for public [FileSystem] operations.
4949
pub type FileSystemResult<T> = Result<T, FileSystemError>;
5050

51-
/// Entry point into the file system abstraction described by the module description. Accessor to
52-
/// an UEFI volume. Available methods try to be close to the `fs` module of `libstd`.
51+
/// The file system abstraction provided by this module. It acts as convenient accessor to an UEFI
52+
/// volume in top of the [`SimpleFileSystemProtocol`]. The available methods try to be close to the
53+
/// `fs` module from the Rust standard library.
5354
///
5455
/// # Technical Background
5556
/// Some random interesting information how this abstraction helps.
@@ -63,7 +64,7 @@ pub struct FileSystem<'name, 'boot_services> {
6364
}
6465

6566
impl<'name, 'boot_services> FileSystem<'name, 'boot_services> {
66-
/// Constructor. The name is only used to help you as a user to identify this file system.
67+
/// Constructor. The name is only used to help developers to identify this file system.
6768
/// This may be "root", "main", or "boot".
6869
pub fn new(
6970
name: &'name str,

src/fs/mod.rs

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
//! A high-level file system API for UEFI applications. It supports you to conveniently perform the
2-
//! following important operations:
1+
//! A high-level file system API for UEFI applications. It supports developers to conveniently
2+
//! perform the following operations:
33
//! - read file to bytes
44
//! - write bytes to file
55
//! - create files
@@ -19,9 +19,10 @@
1919
//! `&str` and validated internally. There are no `File` objects that are exposed to users.
2020
//!
2121
//! The difference to using the [SimpleFileSystemProtocol] directly is that the abstractions in this
22-
//! module take care of automatic release of resources and support you by returning data owned on
23-
//! the heap (such as file info). There is no synchronization as it is untypically that users
24-
//! bootstrap Application Processors (AP) during the UEFI stage, i.e., before hand-off to a kernel.
22+
//! module take care of automatic release of resources and support developers by returning data
23+
//! owned on the heap (such as file info). There is no synchronization as it is untypically that
24+
//! users bootstrap Application Processors (AP) during the UEFI stage, i.e., before hand-off to a
25+
//! kernel.
2526
2627
mod dir_entry_iter;
2728
mod file_info;

src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,5 +64,5 @@ pub mod alloc;
6464
#[cfg(feature = "logger")]
6565
pub mod logger;
6666

67-
#[cfg(all(feature = "exts", feature = "alloc"))]
67+
#[cfg(feature = "fs")]
6868
pub mod fs;

0 commit comments

Comments
 (0)