Skip to main content

strate_fs_abstraction/
lib.rs

1//! Filesystem abstraction layer.
2//!
3//! This crate provides common abstractions for filesystem drivers:
4//!
5//! - [`FsError`]: Comprehensive error type for filesystem operations
6//! - [`CheckedOps`]: Safe arithmetic operations with overflow detection
7//! - [`WindowsString`]: UTF-8 to UTF-16 conversion for Windows APIs
8//! - [`VfsFileSystem`]: Core trait for filesystem implementations (with `alloc`
9//!   feature)
10//! - [`FsCapabilities`]: Filesystem capability flags
11//! - [`VfsFileInfo`], [`VfsDirEntry`]: VFS data types
12//!
13//! # Features
14//!
15//! - `alloc`: Enables `Vec` and `String` support, VFS traits
16//! - `std`: Enables full standard library support
17
18#![cfg_attr(not(feature = "std"), no_std)]
19
20#[cfg(feature = "alloc")]
21extern crate alloc;
22
23pub mod capabilities;
24pub mod error;
25pub mod safe_math;
26pub mod types;
27pub mod unicode;
28#[cfg(feature = "alloc")]
29pub mod vfs;
30
31// Re-exports for convenience
32pub use capabilities::FsCapabilities;
33pub use error::{FsError, FsResult};
34pub use safe_math::CheckedOps;
35pub use types::{OpenFlags, RenameFlags, VfsFileInfo, VfsFileType, VfsTimestamp};
36#[cfg(feature = "alloc")]
37pub use types::{VfsDirEntry, VfsVolumeInfo};
38#[cfg(feature = "alloc")]
39pub use unicode::WindowsString;
40#[cfg(feature = "alloc")]
41pub use vfs::{BlockDevice, VfsFileSystem, VfsFileSystemExt};