Skip to content

♻️ Extract Filesystem IO trait#239

Open
hhalex wants to merge 8 commits intofjall-rs:mainfrom
hyli-org:feat/extract_io_trait
Open

♻️ Extract Filesystem IO trait#239
hhalex wants to merge 8 commits intofjall-rs:mainfrom
hyli-org:feat/extract_io_trait

Conversation

@hhalex
Copy link

@hhalex hhalex commented Jan 22, 2026

No description provided.

@codecov
Copy link

codecov bot commented Jan 22, 2026

@marvin-j97 marvin-j97 added enhancement New feature or request epic api labels Jan 22, 2026
src/fs.rs Outdated
/// Filesystem abstraction for pluggable storage backends.
pub trait FileSystem: Send + Sync + std::panic::RefUnwindSafe + std::panic::UnwindSafe {
/// Opens an existing file for reading.
fn open(path: &Path) -> io::Result<fs::File>;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While this trait allows creating a shim file system it still requires "proper" std::fs Files. For like really deterministic simulation testing and what not, File should really be a trait itself. Then the file system and actual files could be fully simulated, kind of like the backend trait in redb, though we have to define more stuff because we have to actually deal with directories.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes totally agree, i am giving a try with another trait for Files. and add it as a type member of the FileSystem trait.

@hhalex hhalex changed the title ✨ Extract IO trait ♻️ Extract Filesystem IO trait Jan 23, 2026
@hhalex hhalex marked this pull request as ready for review January 23, 2026 14:40
@hhalex hhalex force-pushed the feat/extract_io_trait branch from 177c402 to ce49061 Compare February 13, 2026 10:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api enhancement New feature or request epic

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants