Skip to content

refactor(fs): split FileSystem into core + FileSystemExt#765

Closed
chaliy wants to merge 1 commit intomainfrom
claude/slim-filesystem-trait-DOago
Closed

refactor(fs): split FileSystem into core + FileSystemExt#765
chaliy wants to merge 1 commit intomainfrom
claude/slim-filesystem-trait-DOago

Conversation

@chaliy
Copy link
Contributor

@chaliy chaliy commented Mar 18, 2026

Summary

  • Extract usage(), mkfifo(), and limits() from FileSystem into a new FileSystemExt supertrait with sensible defaults
  • FileSystem now contains only the 13 core POSIX-like methods; FileSystemExt holds 3 optional extension methods
  • Custom backends need only impl FileSystemExt for T {} to accept defaults, reducing implementation burden

Test plan

  • cargo check --all-targets --all-features passes
  • cargo clippy --all-targets --all-features -- -D warnings clean
  • cargo fmt --check clean
  • cargo test --all-features — all 95 doctests pass, all integration tests pass
  • Existing custom FS implementations (examples, tests) updated and compile

Closes #742

Extract optional methods (usage, mkfifo, limits) from FileSystem into a
new FileSystemExt supertrait. This reduces the implementation burden for
custom filesystem backends — they only need an empty `impl FileSystemExt
for T {}` to accept sensible defaults.

FileSystem: 13 required POSIX methods (core contract)
FileSystemExt: 3 optional methods with defaults (resource tracking, FIFOs)

Closes #742
@chaliy
Copy link
Contributor Author

chaliy commented Mar 19, 2026

Superseded by new PR from rebased branch with doc fix.

@chaliy chaliy closed this Mar 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

refactor: slim down FileSystem trait (19 methods, several unused)

1 participant